From 8268abaaf85ea94132a33a8734475cf1bc95ecf5 Mon Sep 17 00:00:00 2001 From: bglacial Date: Wed, 16 Jan 2019 23:30:24 +0100 Subject: [PATCH] Add fixtures --- fixtures/db.json | 1 + readme.md | 3 +++ 2 files changed, 4 insertions(+) create mode 100644 fixtures/db.json diff --git a/fixtures/db.json b/fixtures/db.json new file mode 100644 index 0000000..d02f8b8 --- /dev/null +++ b/fixtures/db.json @@ -0,0 +1 @@ +[{"model": "timelaps.team", "pk": 1, "fields": {"name": "OCK 1", "comment": null}}, {"model": "timelaps.team", "pk": 2, "fields": {"name": "OCK 2", "comment": null}}, {"model": "timelaps.driver", "pk": 1, "fields": {"first_name": "Nicolas", "last_name": "Riault"}}, {"model": "timelaps.driver", "pk": 2, "fields": {"first_name": "Julien", "last_name": "Roger"}}, {"model": "timelaps.rules", "pk": 1, "fields": {"min_stand_duration": 90, "max_autonomy_dry": 120, "max_autonomy_wet": 160, "max_driving_duration": 150, "relay_default_duration": 45}}, {"model": "timelaps.race", "pk": 1, "fields": {"name": "1000 Tours du mans", "start_date": "2019-01-25T16:00:00Z", "end_date": "2019-01-24T16:00:00Z", "duration": 64800, "fk_rules": 1, "comment": "A priori on gagne"}}, {"model": "timelaps.engagedpilot", "pk": 1, "fields": {"team": 1, "pilot": 1, "race": 1, "order": 0}}, {"model": "timelaps.engagedpilot", "pk": 2, "fields": {"team": 1, "pilot": 2, "race": 1, "order": 1}}, {"model": "timelaps.relay", "pk": 1, "fields": {"team_pilot": 1, "relay_start": "2019-01-25T16:00:00Z", "relay_end": null, "has_refuel": true, "pilot_chrono": 62, "comment": null}}] \ No newline at end of file diff --git a/readme.md b/readme.md index fd81176..a03532a 100644 --- a/readme.md +++ b/readme.md @@ -6,6 +6,9 @@ python3 manage.py makemigrations ##Create admin tables python3 manage.py migrate +###Populate the database +python3 manage.py loaddata fixtures/db.json + ##Create admin user python3 manage.py createsuperuser --email admin@gmail.com --username admin