S
S
Sergey08082017-09-20 06:45:54
Django
Sergey0808, 2017-09-20 06:45:54

Python Django, how to filter news by tags?

How to write a controller that filters news by tags.
There are 2 related models News and tags with many to many relationship.
There is this url:

url(r'^(?P<slug>[\w-]+)/$', NewsDetailPage.as_view(), name='detail')

How to write a presentation? What method to use? (I use CBV)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Sergeev, 2017-09-20
@SergeevAI

https://docs.djangoproject.com/en/1.11/topics/db/e...
In general, if postgres is used, it is better to store tags in JsonField

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question