-
Notifications
You must be signed in to change notification settings - Fork 30
Homework3 #82
base: main
Are you sure you want to change the base?
Homework3 #82
Conversation
|
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% | |||
There was a problem hiding this comment.
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.
ecommerce/baskets/serializers.py
Outdated
| @atomic() | ||
| def create(self, validated_data): | ||
| basket = validated_data.pop("basket", None) | ||
| basket_item = super().create(validated_data) |
There was a problem hiding this comment.
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.
ecommerce/baskets/serializers.py
Outdated
| serializer = CustomerSerializer(data=customer, many=False) | ||
| serializer.is_valid(raise_exception=True) | ||
| serializer.save() | ||
| basket.customer.add(*serializer.instance) |
There was a problem hiding this comment.
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.
HOMEWORK 3
Filters, Serializers, Viewsets