Skip to content
This repository was archived by the owner on May 12, 2023. It is now read-only.

Conversation

@mataliksamil
Copy link

HOMEWORK 3
Filters, Serializers, Viewsets

@mataliksamil
Copy link
Author

Son commit payments app için olan kısımlarla birlikte baya bir kalabalık oldu. Pull requesti nasıl geri çekeceğimi bilemedim

@@ -1,5 +1,5 @@
SECRET_KEY=g)8v11ythdn-p_^4+@z23_1&x=qzp^(-#py*8v$&4bnjb&=$a%
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bu dosyaya gerce bilgileri eklememeliyiz.

@atomic()
def create(self, validated_data):
basket = validated_data.pop("basket", None)
basket_item = super().create(validated_data)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

basket olmadan basket item olusturamayiz, ayrica detailed serializerlari genelde sadece veri gosterimi icin kullaniyoruz.

serializer = CustomerSerializer(data=customer, many=False)
serializer.is_valid(raise_exception=True)
serializer.save()
basket.customer.add(*serializer.instance)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

customer burada none degerine sahip bunun add seklinde bir attribute'u olmadigini soyleyecektir.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants