🐍 Models & Queries 🐍
Posted on Mar 18th, 2021
Today’s Topics
- The woes of deployment. What issues did you encounter? What did you try that worked or did not work?
- Django Recipes codebase
- Using the Django shell
⚡ Lightning Talks
- Lookup expressions with
.filter() - Lookups that span relationships
- Complex lookups with Q
- Lookups with Related objects
- Aggregate & Annotate
🎯 Project: Continue Habit Tracker
You should aim for Habit Tracker to be done on Monday. Implement as much as you can, and we will check in with how far everyone has gotten. There are examples for a lot of what you need to do in the Django Recipes codebase but you will have to adapt them to your Habit Tracker use cases.
📖 Read | 📺 Watch | 🎧 Listen
This section is material to prep for our next topic, building APIs.
- RESTful APIs – read up through the “Standard Methods” subsection of the section on “Methods”. You can read more if you want to but it gets pretty deep.
- Safia Abdullah, You and Me Learn All About HTTP
🔖 Resources
- PrettyPrinted Video: Basics of Django Aggregations
- Pretty Printed Video: How to Use Annotate in Django
- URLs in Django
- Django QuerySets
- Django Model Managers
- Django docs: combining Aggregations with other QuerySets
- SQL Basics: Learn x in y minutes -> this may be helpful to skim for familiarity with SQL when you run into it. You do not need to write SQL because the Django ORM does it for you, and it does it well. But most developers can drop into SQL if they need to work with the database directly.
- ERD sketch from class