From 7203e8031a69bde0558d2fb3109add250d05e886 Mon Sep 17 00:00:00 2001 From: Charles Holbrow Date: Thu, 7 Feb 2013 16:08:22 -0500 Subject: [PATCH] adding documentaiton for import_json manage command --- .../management/commands/import_json.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/karmaworld/apps/courses/management/commands/import_json.py b/karmaworld/apps/courses/management/commands/import_json.py index 012fe8f..7a970c2 100644 --- a/karmaworld/apps/courses/management/commands/import_json.py +++ b/karmaworld/apps/courses/management/commands/import_json.py @@ -10,6 +10,25 @@ from karmaworld.apps.notes.models import * from karmaworld.apps.courses.models import * class Command(BaseCommand): + args = 'all [clean]' + help = """Import data to the database from .json. + The 'all' argument is required. When the 'all' argument is used, + import_json expects the following files: + - schools.json + - courses.json + - notes.json + If an notes object in notes.json include a 'note_file' key, assume this + file can be found relative to the following directory: + files/ + + If the optional 'clean' argument is specified, all notes, courses and + files will be deleted from the db before importing + + When importing notes and courses, it is not currently possible to + import ForeignKey values for schools or courses that have already been + saved in the db. ForeignKey values within json files may only refer to + id values included in the current batch of .json files + """ def handle(self, *args, **kwargs): -- 2.25.1