Skip to content

Latest commit

 

History

History
52 lines (36 loc) · 1.39 KB

README.md

File metadata and controls

52 lines (36 loc) · 1.39 KB

Pushing the ORM to its limit

This repository contains an example project with code from my DjangoCon EU 2019 talk "Pushing the ORM to its limit". It contains code to demonstrate various ORM features and tricks to work around quirks with the ORM.

Setup

This project requires Django 2.2 or newer, as specified in requirements.txt.

To install the requirements run the following in an virtualenv:

pip install -r requirements.txt

Next I have set up a Docker Compose file to run the database, so you can set that up if you have docker:

docker-compose up

Finally migrate the database and create some sample data:

./manage.py migrate
./manage.py create_sample_data

The interesting bits

There's not too much code here, as the goal is to show off the database related code. The interesting files are:

I have not set up any views or configured the admin, so I recommend using the Django shell to explore the models:

./manage.py shell