What Does Double Underscore ( __ ) Means In Django Model QuerySet Objects Filter Method

You have learnd how to use Django model manager’s filter or exclude method to get query result data in article Django Simple CRUD Operation Example. To use filter method is so easy as below. Department.objects.filter(dept_desc__contains=’dev2qa’) <QuerySet [<Department: Development,Develop dev2qa.com website use Django>]> We can see that the filter function’s argument is dept_desc__contains=’dev2qa’, i think this is not difficult

What Does Double Underscore ( __ ) Means In Django Model QuerySet Objects Filter Method Read More »

How To Operate Foreign Key And Many To Many Field In Django Model

This example is based on the article Django Bootstrap3 Example, it reuse the Department and Employee model class. Suppose Department and Employee model are many to many relationships, that means one department can have multiple employees and one employee can belong to multiple departments. Then we need to do the following changes.

How To Operate Foreign Key And Many To Many Field In Django Model Read More »

How To Install External Django Application To Django Project Correctly

We all know that one Django project can contain multiple applications, and all the applications should be activated in the Django project settings.py file INSTALLED_APPS section ( please read article How To Create / Remove Django Project Application ), but how to install external Django application developed by others in your local Django project? This

How To Install External Django Application To Django Project Correctly Read More »

How To Add Models To Django Admin Site

When you create a Django project and start the project built-in web server successfully, it also contains an admin website in this project. This admin website is the result of django.contrib.admin and django.contrib.auth Django applications. The Django project installed some default applications in the project settings.py file when you create it. You can find them in the INSTALLED_APPS section

How To Add Models To Django Admin Site Read More »