diff --git a/advlabdb/adminModelViews.py b/advlabdb/adminModelViews.py index 8364ea7..c364823 100644 --- a/advlabdb/adminModelViews.py +++ b/advlabdb/adminModelViews.py @@ -1274,7 +1274,6 @@ class ImportView(SecureAdminBaseView): file = FileField( label="Import file", validators=[FileRequired(), FileAllowed(["txt"], "Only txt files are allowed!")], - description="The import file has to be a text file (with .txt at the end) encoded in UTF-8. It has to strictly follow the required format.", ) submit = SubmitField( label="Upload and import", diff --git a/advlabdb/templates/import.html b/advlabdb/templates/import.html index b1703b7..68b1737 100644 --- a/advlabdb/templates/import.html +++ b/advlabdb/templates/import.html @@ -17,10 +17,232 @@ {{ form.file.label }} {{ form.file }} {{ form.submit }} -
-
- {{ form.file.description }} +
+ +

Help

+

+ The import file has to be a text file (with .txt at the end) encoded in UTF-8. It has to strictly follow the required format. +

+

+ You can take a look at the file + + example_database_import.txt + + for an example. +

+ +

Required manipulation using the web interface

+

+ The following tables can not be imported from a file and have to be manipulated using the web interface. +

+ + +

Optional values

+

+ If an attribute is optional/nullable and has no value, then NULL (uppercase) has to be written. +

+ +

How to understand the tables in the next section

+
ID
+

+ None of the mentioned ids in the import file is meant as a database id. The ids here only refer to the imported instances. The id in the database is assigned automatically. +

+ +

+ Here is the format of a table in the "Tables" section: +

+ +
Table
+ +

+ The type of attributes can be seen in the drawio file + + DB.drawio + which can be opened using + + diagrams.net + . Some attributes have constraints marked also in the drawio file. +

+ +

Tables

+
Semester (only one!)
+ + +
Part
+ + +
Student
+ + +
+ Notes: + +
+ +
Group
+ + +
PartStudent
+ + +
Experiment
+ + +
GroupExperiment
+ + +
Appointment
+ + {{ footer|safe }} {% endblock body %} diff --git a/docs/database_import/database_import.adoc b/docs/database_import/database_import.adoc deleted file mode 100644 index 43f75ef..0000000 --- a/docs/database_import/database_import.adoc +++ /dev/null @@ -1,77 +0,0 @@ -= Database import - -The import file has to be a text file (with `.txt` at the end) encoded in UTF-8. It has to *strictly* follow the required format. - -You can take a look at the file link:example_database_import.txt[] for an example. - -== Required manipulation on the web interface - -The following tables can not be imported from a file and have to be manipulated on the web interface. - -* Semester -* Program -* Part -* User -* Assistant -* Experiment -* Semester Experiment - -== Optional values -If an attribute is optional/nullable and it has no value, then `NULL` (uppercase) has to be written. - -== How to understand this document -=== ID -None of the mentioned ids in this document is meant as database id. The ids here only refer to the imported instances. The id in the database is assigned automatically. - -=== Table -* id -> 0 / 1 / 2 / ... (starts with 0 and has step 1) -* attribute -> example1 / example2 / ... (explanation) -* ... - -The type of the attributes can be seen in the drawio file link:DB.drawio[] which can be opened using https://www.diagrams.net/[diagrams.net]. Some attributes have constraints marked also in the drawio file. - -== Tables -=== Semester (only one!) -* label -> WS / SS -* year -> 21 / 22 / ... - -=== Part -* id -* number -> 1 / 2 / ... -* program_label -> BS / MS / BE / ... (for bachelor of science, master of science, bachelor of education, etc.) - -=== Student -* student_number -* first_name -* last_name -* uni_email -* _contact_email_ (optional) -* _bachelor_thesis_ (optional) -* _bachelor_thesis_work_group_ (optional) -* _note_ (optional) - -=== Group -* id -* number -> 1 / 2 / ... -* program_label - -=== Part Student -* student_number -* part_id -* group_id - -=== Experiment -* id -* number -> 1 / 2 / ... -* program_label - -=== Group Experiment -* id -* experiment_id -* group_id - -=== Appointment -* date -> 21.08.2022 -* special -> 1 / 0 -* group_experiment_id -* assistant_email