--- a/README.md Thu Aug 18 15:29:09 2016 +0200
+++ b/README.md Thu Aug 18 15:46:01 2016 +0200
@@ -85,20 +85,22 @@
By default, the app is accessible through http://127.0.0.1:8000/home
+### 3. Importing data from CSV
-### 3. Fixture loaded data
+Make sure to have the following in the same folder:
-* User: contributeur1, password: firstuser
-* User: contributeur2, password: seconduser
+* All the images to import. The image names must match their respective item inventory number.
+* A csv file that contains the metadata for the items you will import
+* A json fixture file for initializing the collection in the database. (Optional if you want to import images in an existing collection)
+* A json fixture file for the metacategories that will be linked to the collection.
-* Collection (name): ingres
-* Image (ref): 1234567890 # You will need to move napoleon.jpg into web/media/uploads in order for the app to load the image properly
-* Annotation (guid): 34ae39ae-a9a2-4736-bc59-ba6f00e37f52
-
-To access the loaded annotation, follow:
+The following django manage.py command is used to import collection data and images:
- /collections/ingres/images/26aec320-dcfe-4cbc-b912-6a6c13e8916e/annotations/34ae39ae-a9a2-4736-bc59-ba6f00e37f52/detail
- /collections/ingres/images/26aec320-dcfe-4cbc-b912-6a6c13e8916e/annotations/34ae39ae-a9a2-4736-bc59-ba6f00e37f52/edit
+ python manage.py importimages <:export-csv-path> --encoding <:encoding> --collection-fixture <:collection_fixture_NAME> (OR --collection-id <:collection_id> --metacategories_fixture <:metacategories_fixture_NAME>
-The annotation owner is contributeur1, if you try to edit it as another user, it will create the revision but will not publish it in the current state of the project.
-
+Notes:
+* The export csv path will be used to find everything else (images and fixtures files).
+* If the csv file is not encoded in utf-8, you MUST provide --encoding so the csv file can be read
+* You MUST provide either --collection-fixture or --collection-id, else the command doesn't know to which collection the objects will belong to.
+* The command will first parse the csv, then create the objects in the database (Item and ItemMetadata), then move the images to the settings.MEDIA_ROOT+/uploads/ folder after converting them to JPEG, then create the database objects for the images. The command will ignore any csv row that lacks an image or any csv row that already has a database entry for the collection (INV number is used to test if a database entry exists).
+