How to migrate from function-based generic views to class-based analogs in Django

Logo devnterface d88f51727b3053dd3115e1ef9c566ad79b4c2edb3cd208c06345fc37058bebd9

Last week I’ve migrated a Django application from version 1.04 to 1.6.Among the many methods deprecated, starting from version 1.5 all generic views based on functions have been eliminated (they were already deprecated in the previous release (https://docs.djangoproject.com/en/1.4/topics/generic-views-migration/)In my application, the generic view was used in the views.py file in this way:123456789101112131415161718@cache_page() from django.views.generic.list_detail ...

Read more

How to implement two dropdowns dependent on each other using Django and jQuery

Logo devnterface d88f51727b3053dd3115e1ef9c566ad79b4c2edb3cd208c06345fc37058bebd9

Hello everyone.With today’s article I want to show how to implement two dropdowns dependent on each other using Django and jQuery.Suppose we have a 1-N relationship between car brands and car models: we want to show the list of brands in the first dropdown; then once you have selected a brand, the second dropdown will show a list of filtered model...

Read more