Django Filtering System with django-filter - Filter Queryset (2018)

Описание к видео Django Filtering System with django-filter - Filter Queryset (2018)

In this tutorial you will learn how to implement a filtering system with django using the django-filter package.

7 Tips For Getting Better At Django:
https://mailchi.mp/dea592ab3f6d/tips-...

Starting point for this tutorial:
https://github.com/Rechunk/snippetpro...

First, we will enable filtering using a model's fields, and afterwards we will implement our own custom field for changing the ordering of our queryset.

You will be installing the package using 'pip install django-filter'.

Afterwards, you will learn how to create a FilterSet and specify the fields to use in our form inside of the Meta class. Then, we will create a new SnippetFilter instance and pass it to our context.

In our template, we will use filter.qs to loop over the queryset.

If you enjoyed this video, make sure to subscribe and share it with anyone you think could enjoy it as well.

I hope to see you inside of the next episode,

Cheers.

Комментарии

Информация по комментариям в разработке