Skip to content
Example project for my DjangoCon EU 2019 talk about the ORM
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
budget
customers
djangocon_eu_2019
orders
products Initial commit Apr 10, 2019
.gitignore
.python-version
README.md
docker-compose.yml
manage.py Initial commit Apr 10, 2019
requirements.txt

README.md

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
You can’t perform that action at this time.