mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2025-07-18 20:39:36 +02:00
Refactor deleteCollection function to use DELETE method for API call; update endpoint to match new API structure.
This commit is contained in:
parent
57aa2c9916
commit
56b8b55b84
3 changed files with 21 additions and 292 deletions
|
@ -0,0 +1,19 @@
|
|||
# Generated by Django 5.2.1 on 2025-05-27 16:38
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
def set_end_date_equal_to_start(apps, schema_editor):
|
||||
Visit = apps.get_model('adventures', 'Visit')
|
||||
for visit in Visit.objects.filter(end_date__isnull=True):
|
||||
visit.end_date = visit.start_date
|
||||
visit.save()
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('adventures', '0029_adventure_city_adventure_country_adventure_region'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RunPython(set_end_date_equal_to_start),
|
||||
]
|
Loading…
Add table
Add a link
Reference in a new issue