Skip to content

Commit

Permalink
Merge pull request #318 from SELab-2/seeder-improvements
Browse files Browse the repository at this point in the history
chore: add fixturew
  • Loading branch information
tyboro2002 authored Apr 16, 2024
2 parents a3316ac + 09eecf3 commit 441ef50
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion backend/api/fixtures/large/large.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion backend/api/fixtures/medium/medium.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion backend/api/fixtures/small/small.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"model": "api.fileextension", "pk": 1, "fields": {"extension": "mov"}}, {"model": "api.fileextension", "pk": 2, "fields": {"extension": "pages"}}, {"model": "api.fileextension", "pk": 3, "fields": {"extension": "jpg"}}, {"model": "api.fileextension", "pk": 4, "fields": {"extension": "webm"}}, {"model": "api.fileextension", "pk": 5, "fields": {"extension": "json"}}, {"model": "api.fileextension", "pk": 6, "fields": {"extension": "avi"}}, {"model": "api.fileextension", "pk": 7, "fields": {"extension": "png"}}, {"model": "api.fileextension", "pk": 8, "fields": {"extension": "key"}}, {"model": "api.fileextension", "pk": 9, "fields": {"extension": "mp4"}}, {"model": "api.fileextension", "pk": 10, "fields": {"extension": "flac"}}, {"model": "api.fileextension", "pk": 11, "fields": {"extension": "css"}}, {"model": "api.fileextension", "pk": 12, "fields": {"extension": "tiff"}}, {"model": "api.fileextension", "pk": 13, "fields": {"extension": "wav"}}, {"model": "api.fileextension", "pk": 14, "fields": {"extension": "txt"}}, {"model": "api.fileextension", "pk": 15, "fields": {"extension": "bmp"}}, {"model": "api.fileextension", "pk": 16, "fields": {"extension": "docx"}}, {"model": "api.fileextension", "pk": 17, "fields": {"extension": "xls"}}, {"model": "api.fileextension", "pk": 18, "fields": {"extension": "pptx"}}, {"model": "api.fileextension", "pk": 19, "fields": {"extension": "doc"}}, {"model": "api.fileextension", "pk": 20, "fields": {"extension": "ppt"}}, {"model": "api.fileextension", "pk": 21, "fields": {"extension": "html"}}, {"model": "api.fileextension", "pk": 22, "fields": {"extension": "jpeg"}}, {"model": "api.fileextension", "pk": 23, "fields": {"extension": "csv"}}, {"model": "api.fileextension", "pk": 24, "fields": {"extension": "odt"}}, {"model": "api.fileextension", "pk": 25, "fields": {"extension": "js"}}, {"model": "api.fileextension", "pk": 26, "fields": {"extension": "mp3"}}, {"model": "api.fileextension", "pk": 27, "fields": {"extension": "gif"}}, {"model": "api.fileextension", "pk": 28, "fields": {"extension": "xlsx"}}, {"model": "api.fileextension", "pk": 29, "fields": {"extension": "numbers"}}, {"model": "api.fileextension", "pk": 30, "fields": {"extension": "odp"}}, {"model": "api.fileextension", "pk": 31, "fields": {"extension": "pdf"}}, {"model": "api.fileextension", "pk": 32, "fields": {"extension": "ods"}}]
[{"model": "api.fileextension", "pk": 1, "fields": {"extension": "mov"}}, {"model": "api.fileextension", "pk": 2, "fields": {"extension": "pages"}}, {"model": "api.fileextension", "pk": 3, "fields": {"extension": "jpg"}}, {"model": "api.fileextension", "pk": 4, "fields": {"extension": "webm"}}, {"model": "api.fileextension", "pk": 5, "fields": {"extension": "json"}}, {"model": "api.fileextension", "pk": 6, "fields": {"extension": "avi"}}, {"model": "api.fileextension", "pk": 7, "fields": {"extension": "png"}}, {"model": "api.fileextension", "pk": 8, "fields": {"extension": "key"}}, {"model": "api.fileextension", "pk": 9, "fields": {"extension": "mp4"}}, {"model": "api.fileextension", "pk": 10, "fields": {"extension": "flac"}}, {"model": "api.fileextension", "pk": 11, "fields": {"extension": "css"}}, {"model": "api.fileextension", "pk": 12, "fields": {"extension": "tiff"}}, {"model": "api.fileextension", "pk": 13, "fields": {"extension": "wav"}}, {"model": "api.fileextension", "pk": 14, "fields": {"extension": "txt"}}, {"model": "api.fileextension", "pk": 15, "fields": {"extension": "bmp"}}, {"model": "api.fileextension", "pk": 16, "fields": {"extension": "docx"}}, {"model": "api.fileextension", "pk": 17, "fields": {"extension": "xls"}}, {"model": "api.fileextension", "pk": 18, "fields": {"extension": "pptx"}}, {"model": "api.fileextension", "pk": 19, "fields": {"extension": "doc"}}, {"model": "api.fileextension", "pk": 20, "fields": {"extension": "ppt"}}, {"model": "api.fileextension", "pk": 21, "fields": {"extension": "html"}}, {"model": "api.fileextension", "pk": 22, "fields": {"extension": "jpeg"}}, {"model": "api.fileextension", "pk": 23, "fields": {"extension": "csv"}}, {"model": "api.fileextension", "pk": 24, "fields": {"extension": "odt"}}, {"model": "api.fileextension", "pk": 25, "fields": {"extension": "js"}}, {"model": "api.fileextension", "pk": 26, "fields": {"extension": "mp3"}}, {"model": "api.fileextension", "pk": 27, "fields": {"extension": "gif"}}, {"model": "api.fileextension", "pk": 28, "fields": {"extension": "xlsx"}}, {"model": "api.fileextension", "pk": 29, "fields": {"extension": "numbers"}}, {"model": "api.fileextension", "pk": 30, "fields": {"extension": "odp"}}, {"model": "api.fileextension", "pk": 31, "fields": {"extension": "pdf"}}, {"model": "api.fileextension", "pk": 32, "fields": {"extension": "ods"}}, {"model": "api.course", "pk": 1, "fields": {"name": "Profit-focused empowering time-frame", "academic_startyear": 2025, "description": "Which inside woman foot degree girl. Fear guy from. Song never finally fire.", "faculty": "Psychologie_PedagogischeWetenschappen", "parent_course": null}}, {"model": "api.course", "pk": 2, "fields": {"name": "Customizable needs-based customer loyalty", "academic_startyear": 2025, "description": "My north own Republican company. Teach manage join general matter not. Impact player fast term gun it close. Usually relationship rate themselves sense control thought require.", "faculty": "Psychologie_PedagogischeWetenschappen", "parent_course": null}}, {"model": "api.course", "pk": 3, "fields": {"name": "Expanded radical framework", "academic_startyear": 2024, "description": "Popular truth officer. Other social follow result most alone interest.", "faculty": "Recht_Criminologie", "parent_course": null}}, {"model": "api.project", "pk": 1, "fields": {"name": "Expanded heuristic firmware", "description": "Truth evening watch tend. Civil popular rise should knowledge require or.", "visible": true, "archived": false, "locked_groups": false, "start_date": "2024-03-18T09:19:46.850Z", "deadline": "2024-06-09T09:19:46.850Z", "max_score": 2, "score_visible": false, "group_size": 15, "course": 3}}, {"model": "api.project", "pk": 2, "fields": {"name": "Multi-layered maximized interface", "description": "Natural water place development role though painting. Guy measure several hand where TV upon. Nothing product today environmental adult produce last.", "visible": true, "archived": false, "locked_groups": false, "start_date": "2024-03-12T09:19:46.850Z", "deadline": "2024-05-21T09:19:46.850Z", "max_score": 46, "score_visible": false, "group_size": 12, "course": 2}}, {"model": "api.project", "pk": 3, "fields": {"name": "Multi-layered coherent capacity", "description": "Letter Republican already among. Identify summer four most seat despite.", "visible": true, "archived": false, "locked_groups": false, "start_date": "2024-03-03T09:19:46.850Z", "deadline": "2024-04-24T09:19:46.850Z", "max_score": 62, "score_visible": true, "group_size": 5, "course": 1}}, {"model": "api.project", "pk": 4, "fields": {"name": "Reactive analyzing middleware", "description": "This nature shoulder would business.", "visible": true, "archived": false, "locked_groups": true, "start_date": "2024-07-02T09:19:46.850Z", "deadline": "2024-07-19T09:19:46.850Z", "max_score": 48, "score_visible": false, "group_size": 15, "course": 1}}, {"model": "api.project", "pk": 5, "fields": {"name": "Focused 3rdgeneration hub", "description": "Miss go million card subject raise. Hand wonder strong stay keep research author stop.", "visible": true, "archived": false, "locked_groups": true, "start_date": "2024-01-23T09:20:45.063Z", "deadline": "2024-06-16T09:20:45.063Z", "max_score": 27, "score_visible": true, "group_size": 3, "course": 1}}, {"model": "api.project", "pk": 6, "fields": {"name": "Versatile upward-trending Local Area Network", "description": "Season financial model now including. Star pick turn conference product treatment Democrat happy. Without plant quite protect.", "visible": true, "archived": false, "locked_groups": false, "start_date": "2024-02-06T09:20:45.063Z", "deadline": "2024-07-23T09:20:45.063Z", "max_score": 12, "score_visible": false, "group_size": 8, "course": 2}}, {"model": "api.project", "pk": 7, "fields": {"name": "Face-to-face mission-critical attitude", "description": "His prove ago trip modern. Top source make try difference prevent media. Mother lose anything million risk.", "visible": false, "archived": false, "locked_groups": false, "start_date": "2024-03-30T09:20:45.063Z", "deadline": "2024-07-16T09:20:45.063Z", "max_score": 78, "score_visible": false, "group_size": 2, "course": 1}}, {"model": "api.project", "pk": 8, "fields": {"name": "Visionary optimizing paradigm", "description": "Hotel product buy laugh memory way serve draw. Only at shake build. Court pass without bad. Account pick ball might start wife compare.", "visible": true, "archived": false, "locked_groups": true, "start_date": "2024-01-25T09:20:45.063Z", "deadline": "2024-06-27T09:20:45.063Z", "max_score": 76, "score_visible": false, "group_size": 12, "course": 1}}, {"model": "api.student", "pk": "0", "fields": {"is_active": true, "student_id": "0", "courses": [1]}}, {"model": "api.student", "pk": "1", "fields": {"is_active": true, "student_id": "1", "courses": [1]}}, {"model": "api.student", "pk": "2", "fields": {"is_active": true, "student_id": "2", "courses": [1]}}, {"model": "api.student", "pk": "3", "fields": {"is_active": true, "student_id": "3", "courses": [1]}}, {"model": "api.student", "pk": "4", "fields": {"is_active": true, "student_id": "4", "courses": [1]}}, {"model": "api.student", "pk": "5", "fields": {"is_active": true, "student_id": "5", "courses": [1]}}, {"model": "api.student", "pk": "6", "fields": {"is_active": true, "student_id": "6", "courses": [1]}}, {"model": "api.student", "pk": "7", "fields": {"is_active": true, "student_id": "7", "courses": [1]}}, {"model": "api.student", "pk": "8", "fields": {"is_active": true, "student_id": "8", "courses": [1]}}, {"model": "api.student", "pk": "9", "fields": {"is_active": true, "student_id": "9", "courses": [1]}}, {"model": "api.group", "pk": 1, "fields": {"project": 4, "score": 9.0, "students": []}}, {"model": "api.group", "pk": 2, "fields": {"project": 3, "score": 26.0, "students": ["0", "2", "8"]}}, {"model": "api.group", "pk": 3, "fields": {"project": 1, "score": 1.0, "students": ["0", "3", "4", "6", "7", "8", "9"]}}, {"model": "api.group", "pk": 4, "fields": {"project": 2, "score": 23.0, "students": ["7", "9"]}}, {"model": "api.group", "pk": 5, "fields": {"project": 4, "score": 32.0, "students": []}}, {"model": "api.group", "pk": 6, "fields": {"project": 1, "score": 1.0, "students": ["1", "2", "3", "5"]}}, {"model": "api.group", "pk": 7, "fields": {"project": 2, "score": 27.0, "students": ["1", "4", "5", "6"]}}, {"model": "api.group", "pk": 8, "fields": {"project": 2, "score": 29.0, "students": []}}, {"model": "api.group", "pk": 9, "fields": {"project": 6, "score": 11.0, "students": []}}, {"model": "api.group", "pk": 10, "fields": {"project": 2, "score": 0.0, "students": []}}, {"model": "api.group", "pk": 11, "fields": {"project": 2, "score": 20.0, "students": []}}, {"model": "api.group", "pk": 12, "fields": {"project": 3, "score": 29.0, "students": []}}, {"model": "api.group", "pk": 13, "fields": {"project": 3, "score": 46.0, "students": []}}, {"model": "api.group", "pk": 14, "fields": {"project": 6, "score": 4.0, "students": []}}, {"model": "api.submission", "pk": 1, "fields": {"group": 1, "submission_number": null, "submission_time": "2024-04-03T00:00:00Z"}}, {"model": "api.submission", "pk": 2, "fields": {"group": 2, "submission_number": null, "submission_time": "2024-04-09T00:00:00Z"}}, {"model": "api.submission", "pk": 3, "fields": {"group": 2, "submission_number": null, "submission_time": "2024-04-06T00:00:00Z"}}, {"model": "api.submission", "pk": 4, "fields": {"group": 6, "submission_number": null, "submission_time": "2024-04-10T00:00:00Z"}}, {"model": "api.submission", "pk": 5, "fields": {"group": 5, "submission_number": null, "submission_time": "2024-04-01T00:00:00Z"}}, {"model": "api.submission", "pk": 6, "fields": {"group": 2, "submission_number": null, "submission_time": "2024-04-08T00:00:00Z"}}, {"model": "api.submission", "pk": 7, "fields": {"group": 5, "submission_number": null, "submission_time": "2024-04-06T00:00:00Z"}}, {"model": "api.submission", "pk": 8, "fields": {"group": 6, "submission_number": null, "submission_time": "2024-04-09T00:00:00Z"}}, {"model": "api.submission", "pk": 9, "fields": {"group": 3, "submission_number": null, "submission_time": "2024-04-10T00:00:00Z"}}, {"model": "api.submission", "pk": 10, "fields": {"group": 5, "submission_number": null, "submission_time": "2024-04-12T00:00:00Z"}}, {"model": "api.submission", "pk": 11, "fields": {"group": 1, "submission_number": null, "submission_time": "2024-04-04T00:00:00Z"}}, {"model": "api.submission", "pk": 12, "fields": {"group": 11, "submission_number": null, "submission_time": "2024-04-01T00:00:00Z"}}, {"model": "api.submission", "pk": 13, "fields": {"group": 11, "submission_number": null, "submission_time": "2024-04-11T00:00:00Z"}}, {"model": "api.submission", "pk": 14, "fields": {"group": 11, "submission_number": null, "submission_time": "2024-04-04T00:00:00Z"}}, {"model": "api.submission", "pk": 15, "fields": {"group": 10, "submission_number": null, "submission_time": "2024-04-05T00:00:00Z"}}, {"model": "api.submission", "pk": 16, "fields": {"group": 11, "submission_number": null, "submission_time": "2024-04-01T00:00:00Z"}}, {"model": "api.submission", "pk": 17, "fields": {"group": 6, "submission_number": null, "submission_time": "2024-04-03T00:00:00Z"}}, {"model": "api.submission", "pk": 18, "fields": {"group": 14, "submission_number": null, "submission_time": "2024-04-04T00:00:00Z"}}, {"model": "api.submission", "pk": 19, "fields": {"group": 6, "submission_number": null, "submission_time": "2024-04-05T00:00:00Z"}}, {"model": "api.submission", "pk": 20, "fields": {"group": 11, "submission_number": null, "submission_time": "2024-04-15T00:00:00Z"}}, {"model": "api.assistant", "pk": "10", "fields": {"is_active": true, "courses": [1]}}, {"model": "api.assistant", "pk": "11", "fields": {"is_active": true, "courses": [2]}}, {"model": "api.assistant", "pk": "12", "fields": {"is_active": true, "courses": [2]}}, {"model": "api.assistant", "pk": "13", "fields": {"is_active": true, "courses": [2]}}, {"model": "api.assistant", "pk": "14", "fields": {"is_active": true, "courses": [2]}}, {"model": "api.teacher", "pk": "15", "fields": {"is_active": true, "courses": [1]}}, {"model": "api.teacher", "pk": "16", "fields": {"is_active": true, "courses": [1]}}, {"model": "api.teacher", "pk": "17", "fields": {"is_active": true, "courses": [1]}}]
5 changes: 3 additions & 2 deletions backend/api/seeders/seeder.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from random import choice, randint, sample
from functools import wraps
from random import choice, randint, sample
from time import time

from django.db import connection
from django.utils import timezone

Expand Down Expand Up @@ -49,7 +50,7 @@ def handle(*args, **kwargs):

print('Seeder {} took {}'.format(
func.__name__, format_time((time() - start))
))
), flush=True)

return result

Expand Down
2 changes: 1 addition & 1 deletion backend/authentication/fixtures/large/large.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion backend/authentication/fixtures/medium/medium.json

Large diffs are not rendered by default.

Loading

0 comments on commit 441ef50

Please sign in to comment.