Skip to content
This repository has been archived by the owner on Feb 5, 2024. It is now read-only.

Commit

Permalink
Merge pull request #382 from SELab-2/jefroosens/mockdata-garbage-types
Browse files Browse the repository at this point in the history
feat: mockdata for in/out garbage
  • Loading branch information
MaximStockmans authored May 21, 2023
2 parents a324a01 + 01ec664 commit bb101d0
Showing 1 changed file with 30 additions and 12 deletions.
42 changes: 30 additions & 12 deletions backend/drtrottoir/management/commands/mockdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,12 +315,16 @@ def local_image_path_to_django_image_data(image_path: str) -> File:
]

garbage = [
"Rest",
"GFT",
"Glas",
"PMD",
"KGA",
"Nucleair",
"Rest (In)",
"Rest (Out)",
"GFT (In)",
"GFT (Out)",
"Glas (In)",
"Glas (Out)",
"PMD (In)",
"PMD (Out)",
"KGA (In)",
"KGA (Out)",
]

building_images = [
Expand Down Expand Up @@ -572,14 +576,28 @@ def handle(self, *args, **options):

# Add garbage schedules
for building in buildings_in_schedule_definition_of_0:
garbage_collection_schedule_1 = GarbageCollectionSchedule(
for_day=date, building=building, garbage_type=garbage_types[0]
)
garbage_collection_schedule_2 = GarbageCollectionSchedule(
garbage_collection_schedule_1_in = GarbageCollectionSchedule(
for_day=date, building=building, garbage_type=garbage_types[1]
)
garbage_collection_schedule_1.save()
garbage_collection_schedule_2.save()
garbage_collection_schedule_1_out = GarbageCollectionSchedule(
for_day=datetime.datetime.strptime(date, "%Y-%m-%d")
+ datetime.timedelta(days=1),
building=building,
garbage_type=garbage_types[0],
)
garbage_collection_schedule_2_in = GarbageCollectionSchedule(
for_day=date, building=building, garbage_type=garbage_types[3]
)
garbage_collection_schedule_2_out = GarbageCollectionSchedule(
for_day=datetime.datetime.strptime(date, "%Y-%m-%d")
+ datetime.timedelta(days=1),
building=building,
garbage_type=garbage_types[2],
)
garbage_collection_schedule_1_in.save()
garbage_collection_schedule_1_out.save()
garbage_collection_schedule_2_in.save()
garbage_collection_schedule_2_out.save()

# Add work entries
work_entries = []
Expand Down

0 comments on commit bb101d0

Please sign in to comment.