Quick Reference
Models
Query | Description |
Event.objects.filter(appid=”example”) | filter for appid eq example |
Event.objects..exclude(username=”rick”) | show everything not excluding username eq rick |
Event.objects.filter(appid=”example”).exclude(user__in=[“bob”,”fred”]) | include appid eq example and exclude user bob or fred |
Upgrade.objects.filter(device_number=’device_numberooo’).values() | Display as dict() |
Management Commands
Commands | Description |
./manage.py dumpdata updowngrade –indent 2 |
http://stackoverflow.com/questions/14115318/create-django-model-or-update-if-exists
Latest posts by Rick Donato (see all)
- How to Configure a BIND Server on Ubuntu - March 15, 2018
- What is a BGP Confederation? - March 6, 2018
- Cisco – What is BGP ORF (Outbound Route Filtering)? - March 5, 2018
Want to become a Django expert?
Here is our hand-picked selection of the best courses you can find online:
The Complete Web Development Bootcamp course
Django Practical Guide course
Django Full Stack Developer Bootcamp
and our recommended certification practice exams:
AlphaPrep Practice Tests - Free Trial