mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2025-07-19 04:49:37 +02:00
Fix general category handling
This commit is contained in:
parent
ce0b82acb7
commit
adf45ff557
16 changed files with 192 additions and 126 deletions
|
@ -118,6 +118,7 @@ class AdventureSerializer(CustomModelSerializer):
|
|||
def create(self, validated_data):
|
||||
visits_data = validated_data.pop('visits', [])
|
||||
category_data = validated_data.pop('category', None)
|
||||
print(category_data)
|
||||
adventure = Adventure.objects.create(**validated_data)
|
||||
for visit_data in visits_data:
|
||||
Visit.objects.create(adventure=adventure, **visit_data)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue