Building queries in Django and other database-adjacent topics
External Resources
- databases
- queries
- datetime issues:
- timezone missing in a timezone aware site: https://stackoverflow.com/questions/18622007/runtimewarning-datetimefield-received-a-naive-datetime
- convert timezone: https://stackoverflow.com/questions/5452555/converting-timezone-aware-datetime-to-local-time-in-python#5452709
- convert date to datetime: https://coderivers.org/blog/python-convert-date-to-datetime/
- strptime
- off by X minutes:
- https://stackoverflow.com/questions/60996205/python-datetime-timezone-conversion-off-by-4-minutes
- django filters, queries, expressions:
- https://docs.djangoproject.com/en/6.0/topics/db/examples/many_to_many/
- https://docs.djangoproject.com/en/6.0/topics/db/queries/
- https://docs.djangoproject.com/en/6.0/ref/models/querysets/
- https://docs.djangoproject.com/en/6.0/ref/models/expressions/
- https://www.django-rest-framework.org/api-guide/filtering/
- filter django items by month
- get all months in posts:
- https://stackoverflow.com/questions/76265539/categorize-posts-by-months-and-years-in-django
- get the year from a datetime object with ExtractYear: https://stackoverflow.com/questions/49907266/django-extract-only-year-from-date-time-in-queryset
- create date string in filter: https://stackoverflow.com/questions/17085898/conversion-of-datetime-field-to-string-in-django-queryset-values-list/60924664#60924664
- order by two fields (month/day): https://stackoverflow.com/questions/4236226/ordering-a-django-queryset-by-a-datetimes-month-day
- reverse queryset: https://stackoverflow.com/questions/31303327/reverse-queryset-order-in-django