-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #97 from OfirMatasas/static-orders
Create static orders
- Loading branch information
Showing
2 changed files
with
186 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,184 @@ | ||
from django.db import migrations | ||
from django.utils import timezone | ||
from daycare.models import DayCare | ||
from orders.models import StatusOptions | ||
import datetime | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
('orders', '0002_test_data'), | ||
('daycare', '0004_static_daycare_users'), | ||
('dogowner', '0004_test_static_data'), | ||
] | ||
|
||
def generate_data(apps, schema_editor): | ||
from dogowner.models import DogOwner | ||
from orders.models import Order | ||
|
||
all_daycares = DayCare.objects.all() | ||
all_dog_owners = DogOwner.objects.all() | ||
|
||
Order.objects.create(daycare_id=all_daycares.get(pk=4), dog_owner_id=all_dog_owners.get(pk=4), | ||
price_per_day=100, start_date=timezone.datetime(2024, 3, 23), | ||
status=StatusOptions.Approved, | ||
end_date=timezone.datetime(2024, 3, 23) + datetime.timedelta(days=7)), | ||
Order.objects.create(daycare_id=all_daycares.get(pk=4), dog_owner_id=all_dog_owners.get(pk=5), | ||
price_per_day=200, start_date=timezone.datetime(2023, 5, 6), | ||
status=StatusOptions.Canceled, | ||
end_date=timezone.datetime(2023, 5, 6) + datetime.timedelta(days=4)), | ||
Order.objects.create(daycare_id=all_daycares.get(pk=5), dog_owner_id=all_dog_owners.get(pk=5), | ||
price_per_day=500, start_date=timezone.datetime(2023, 2, 23), | ||
status=StatusOptions.Canceled, | ||
end_date=timezone.datetime(2023, 2, 23) + datetime.timedelta(days=10)), | ||
Order.objects.create(daycare_id=all_daycares.get(pk=5), dog_owner_id=all_dog_owners.get(pk=6), | ||
price_per_day=200, start_date=timezone.datetime(2023, 6, 7), | ||
status=StatusOptions.Approved, | ||
end_date=timezone.datetime(2023, 6, 7) + datetime.timedelta(days=14)), | ||
Order.objects.create(daycare_id=all_daycares.get(pk=6), dog_owner_id=all_dog_owners.get(pk=6), | ||
price_per_day=100, start_date=timezone.datetime(2023, 7, 15), | ||
status=StatusOptions.Pending, | ||
end_date=timezone.datetime(2023, 7, 15) + datetime.timedelta(days=5)), | ||
Order.objects.create(daycare_id=all_daycares.get(pk=6), dog_owner_id=all_dog_owners.get(pk=7), | ||
price_per_day=200, start_date=timezone.datetime(2024, 1, 20), | ||
status=StatusOptions.Pending, | ||
end_date=timezone.datetime(2024, 1, 20) + datetime.timedelta(days=8)), | ||
Order.objects.create(daycare_id=all_daycares.get(pk=7), dog_owner_id=all_dog_owners.get(pk=7), | ||
price_per_day=100, start_date=timezone.datetime(2023, 6, 6), | ||
status=StatusOptions.Approved, | ||
end_date=timezone.datetime(2023, 6, 6) + datetime.timedelta(days=5)), | ||
Order.objects.create(daycare_id=all_daycares.get(pk=7), dog_owner_id=all_dog_owners.get(pk=8), | ||
price_per_day=200, start_date=timezone.datetime(2024, 5, 6), | ||
status=StatusOptions.Pending, | ||
end_date=timezone.datetime(2024, 5, 6) + datetime.timedelta(days=10)), | ||
Order.objects.create(daycare_id=all_daycares.get(pk=8), dog_owner_id=all_dog_owners.get(pk=8), | ||
price_per_day=100, start_date=timezone.datetime(2023, 4, 20), | ||
status=StatusOptions.Pending, | ||
end_date=timezone.datetime(2023, 4, 20) + datetime.timedelta(days=3)), | ||
Order.objects.create(daycare_id=all_daycares.get(pk=8), dog_owner_id=all_dog_owners.get(pk=9), | ||
price_per_day=200, start_date=timezone.datetime(2023, 3, 30), | ||
status=StatusOptions.Approved, | ||
end_date=timezone.datetime(2023, 3, 30) + datetime.timedelta(days=2)), | ||
Order.objects.create(daycare_id=all_daycares.get(pk=9), dog_owner_id=all_dog_owners.get(pk=9), | ||
price_per_day=100, start_date=timezone.datetime(2022, 7, 3), | ||
status=StatusOptions.Pending, | ||
end_date=timezone.datetime(2022, 7, 3) + datetime.timedelta(days=9)), | ||
Order.objects.create(daycare_id=all_daycares.get(pk=9), dog_owner_id=all_dog_owners.get(pk=10), | ||
price_per_day=200, start_date=timezone.datetime(2022, 10, 10), | ||
status=StatusOptions.Canceled, | ||
end_date=timezone.datetime(2022, 10, 10) + datetime.timedelta(days=6)), | ||
Order.objects.create(daycare_id=all_daycares.get(pk=10), dog_owner_id=all_dog_owners.get(pk=10), | ||
price_per_day=100, start_date=timezone.datetime(2022, 12, 15), | ||
status=StatusOptions.Pending, | ||
end_date=timezone.datetime(2022, 12, 15) + datetime.timedelta(days=6)), | ||
Order.objects.create(daycare_id=all_daycares.get(pk=10), dog_owner_id=all_dog_owners.get(pk=11), | ||
price_per_day=200, start_date=timezone.datetime(2023, 5, 9), | ||
status=StatusOptions.Approved, | ||
end_date=timezone.datetime(2023, 5, 9) + datetime.timedelta(days=2)), | ||
Order.objects.create(daycare_id=all_daycares.get(pk=11), dog_owner_id=all_dog_owners.get(pk=11), | ||
price_per_day=100, start_date=timezone.datetime(2022, 9, 10), | ||
status=StatusOptions.Pending, | ||
end_date=timezone.datetime(2022, 9, 10) + datetime.timedelta(days=5)), | ||
Order.objects.create(daycare_id=all_daycares.get(pk=11), dog_owner_id=all_dog_owners.get(pk=12), | ||
price_per_day=200, start_date=timezone.datetime(2022, 6, 11), | ||
status=StatusOptions.Approved, | ||
end_date=timezone.datetime(2022, 6, 11) + datetime.timedelta(days=4)), | ||
Order.objects.create(daycare_id=all_daycares.get(pk=12), dog_owner_id=all_dog_owners.get(pk=12), | ||
price_per_day=100, start_date=timezone.datetime(2023, 5, 5), | ||
status=StatusOptions.Approved, | ||
end_date=timezone.datetime(2023, 5, 5) + datetime.timedelta(days=7)), | ||
Order.objects.create(daycare_id=all_daycares.get(pk=12), dog_owner_id=all_dog_owners.get(pk=13), | ||
price_per_day=200, start_date=timezone.datetime(2023, 2, 22), | ||
status=StatusOptions.Canceled, | ||
end_date=timezone.datetime(2023, 2, 22) + datetime.timedelta(days=4)), | ||
Order.objects.create(daycare_id=all_daycares.get(pk=13), dog_owner_id=all_dog_owners.get(pk=13), | ||
price_per_day=100, start_date=timezone.datetime(2022, 7, 8), | ||
status=StatusOptions.Pending, | ||
end_date=timezone.datetime(2022, 7, 8) + datetime.timedelta(days=3)), | ||
Order.objects.create(daycare_id=all_daycares.get(pk=13), dog_owner_id=all_dog_owners.get(pk=14), | ||
price_per_day=200, start_date=timezone.datetime(2022, 8, 1), | ||
status=StatusOptions.Approved, | ||
end_date=timezone.datetime(2022, 8, 1) + datetime.timedelta(days=12)), | ||
Order.objects.create(daycare_id=all_daycares.get(pk=14), dog_owner_id=all_dog_owners.get(pk=14), | ||
price_per_day=100, start_date=timezone.datetime(2023, 1, 1), | ||
status=StatusOptions.Pending, | ||
end_date=timezone.datetime(2023, 1, 1) + datetime.timedelta(days=6)), | ||
Order.objects.create(daycare_id=all_daycares.get(pk=14), dog_owner_id=all_dog_owners.get(pk=15), | ||
price_per_day=200, start_date=timezone.datetime(2022, 7, 7), | ||
status=StatusOptions.Canceled, | ||
end_date=timezone.datetime(2022, 7, 7) + datetime.timedelta(days=2)), | ||
Order.objects.create(daycare_id=all_daycares.get(pk=15), dog_owner_id=all_dog_owners.get(pk=15), | ||
price_per_day=100, start_date=timezone.datetime(2022, 7, 20), | ||
status=StatusOptions.Pending, | ||
end_date=timezone.datetime(2022, 7, 20) + datetime.timedelta(days=4)), | ||
Order.objects.create(daycare_id=all_daycares.get(pk=15), dog_owner_id=all_dog_owners.get(pk=16), | ||
price_per_day=200, start_date=timezone.datetime(2022, 8, 27), | ||
status=StatusOptions.Approved, | ||
end_date=timezone.datetime(2022, 8, 27) + datetime.timedelta(days=7)), | ||
Order.objects.create(daycare_id=all_daycares.get(pk=16), dog_owner_id=all_dog_owners.get(pk=16), | ||
price_per_day=100, start_date=timezone.datetime(2023, 1, 15), | ||
status=StatusOptions.Pending, | ||
end_date=timezone.datetime(2023, 1, 15) + datetime.timedelta(days=4)), | ||
Order.objects.create(daycare_id=all_daycares.get(pk=16), dog_owner_id=all_dog_owners.get(pk=17), | ||
price_per_day=200, start_date=timezone.datetime(2022, 12, 8), | ||
status=StatusOptions.Pending, | ||
end_date=timezone.datetime(2022, 12, 8) + datetime.timedelta(days=2)), | ||
Order.objects.create(daycare_id=all_daycares.get(pk=17), dog_owner_id=all_dog_owners.get(pk=17), | ||
price_per_day=100, start_date=timezone.datetime(2022, 9, 23), | ||
status=StatusOptions.Approved, | ||
end_date=timezone.datetime(2022, 9, 23) + datetime.timedelta(days=1)), | ||
Order.objects.create(daycare_id=all_daycares.get(pk=17), dog_owner_id=all_dog_owners.get(pk=18), | ||
price_per_day=200, start_date=timezone.datetime(2022, 11, 12), | ||
status=StatusOptions.Pending, | ||
end_date=timezone.datetime(2022, 11, 12) + datetime.timedelta(days=6)), | ||
Order.objects.create(daycare_id=all_daycares.get(pk=18), dog_owner_id=all_dog_owners.get(pk=18), | ||
price_per_day=100, start_date=timezone.datetime(2022, 9, 8), | ||
status=StatusOptions.Canceled, | ||
end_date=timezone.datetime(2022, 9, 8) + datetime.timedelta(days=5)), | ||
Order.objects.create(daycare_id=all_daycares.get(pk=18), dog_owner_id=all_dog_owners.get(pk=19), | ||
price_per_day=200, start_date=timezone.datetime(2023, 1, 23), | ||
status=StatusOptions.Approved, | ||
end_date=timezone.datetime(2023, 1, 23) + datetime.timedelta(days=5)), | ||
Order.objects.create(daycare_id=all_daycares.get(pk=19), dog_owner_id=all_dog_owners.get(pk=19), | ||
price_per_day=100, start_date=timezone.datetime(2022, 6, 12), | ||
status=StatusOptions.Canceled, | ||
end_date=timezone.datetime(2022, 6, 12) + datetime.timedelta(days=1)), | ||
Order.objects.create(daycare_id=all_daycares.get(pk=19), dog_owner_id=all_dog_owners.get(pk=20), | ||
price_per_day=200, start_date=timezone.datetime(2023, 2, 8), | ||
status=StatusOptions.Approved, | ||
end_date=timezone.datetime(2023, 2, 8) + datetime.timedelta(days=10)), | ||
Order.objects.create(daycare_id=all_daycares.get(pk=20), dog_owner_id=all_dog_owners.get(pk=20), | ||
price_per_day=100, start_date=timezone.datetime(2023, 3, 11), | ||
status=StatusOptions.Pending, | ||
end_date=timezone.datetime(2023, 3, 11) + datetime.timedelta(days=6)), | ||
Order.objects.create(daycare_id=all_daycares.get(pk=20), dog_owner_id=all_dog_owners.get(pk=21), | ||
price_per_day=200, start_date=timezone.datetime(2023, 1, 17), | ||
status=StatusOptions.Pending, | ||
end_date=timezone.datetime(2023, 1, 17) + datetime.timedelta(days=4)), | ||
Order.objects.create(daycare_id=all_daycares.get(pk=21), dog_owner_id=all_dog_owners.get(pk=21), | ||
price_per_day=100, start_date=timezone.datetime(2022, 8, 23), | ||
status=StatusOptions.Approved, | ||
end_date=timezone.datetime(2022, 8, 23) + datetime.timedelta(days=7)), | ||
Order.objects.create(daycare_id=all_daycares.get(pk=21), dog_owner_id=all_dog_owners.get(pk=22), | ||
price_per_day=200, start_date=timezone.datetime(2023, 3, 12), | ||
status=StatusOptions.Approved, | ||
end_date=timezone.datetime(2023, 3, 12) + datetime.timedelta(days=2)), | ||
Order.objects.create(daycare_id=all_daycares.get(pk=22), dog_owner_id=all_dog_owners.get(pk=22), | ||
price_per_day=100, start_date=timezone.datetime(2023, 3, 5), | ||
status=StatusOptions.Pending, | ||
end_date=timezone.datetime(2023, 3, 5) + datetime.timedelta(days=7)), | ||
Order.objects.create(daycare_id=all_daycares.get(pk=22), dog_owner_id=all_dog_owners.get(pk=23), | ||
price_per_day=200, start_date=timezone.datetime(2022, 4, 4), | ||
status=StatusOptions.Canceled, | ||
end_date=timezone.datetime(2022, 4, 4) + datetime.timedelta(days=3)), | ||
Order.objects.create(daycare_id=all_daycares.get(pk=23), dog_owner_id=all_dog_owners.get(pk=23), | ||
price_per_day=100, start_date=timezone.datetime(2023, 5, 15), | ||
status=StatusOptions.Approved, | ||
end_date=timezone.datetime(2023, 5, 15) + datetime.timedelta(days=6)), | ||
Order.objects.create(daycare_id=all_daycares.get(pk=23), dog_owner_id=all_dog_owners.get(pk=4), | ||
price_per_day=200, start_date=timezone.datetime(2023, 5, 5), | ||
end_date=timezone.datetime(2023, 5, 5) + datetime.timedelta(days=8)) | ||
|
||
operations = [ | ||
migrations.RunPython(generate_data), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters