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)
- NETCONF & YANG: Automate Network Configs via Python - April 2, 2026
- Palo Alto – How to Configure Your Next-Generation Firewall - April 2, 2026
- How to Harden Linux SSH: Keys, Fail2ban & Ciphers - March 1, 2026
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:
Delta Practice Tests