-
Notifications
You must be signed in to change notification settings - Fork 30
Ertugrulbal hw 3 #77
base: main
Are you sure you want to change the base?
Ertugrulbal hw 3 #77
Conversation
… to ecommerce/urls.py
| ### Payments | ||
|
|
||
| It contains bank model and bank account model. | ||
| ## All models' serializers, filters, viewsets was created, these are; |
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.
- I am a bit confused here, because these kind of information should'nt be added on README.md file, because you can alrady mention this infos in your commit and when you create a PR you can leave these information as a comment
| class BasketItemViewSet(DetailedViewSetMixin, viewsets.ModelViewSet): | ||
| queryset = BasketItem.objects.all() | ||
| serializer_class = BasketItemSerializer | ||
|
|
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.
- I don't know these detailed views works as expected but maybe you can add code blocks in your detailed views;
serializer_action_classes = {
"detailed_list": BasketDetailedSerializer,
"detailed": BasketDetailedSerializer,
}| serializer = CustomerSerializer(data=addresses, many=True) | ||
| serializer.is_valid(raise_exception=True) | ||
| serializer.save() | ||
| address.customers.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 ile Address arasında 1-M ilişki var. address modelinin customers adında bir fieldı yok.
|
|
||
|
|
||
| class BasketFilter(filters.FilterSet): | ||
| name = filters.CharFilter(label=_("Name"), method="") |
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.
eksik kalmis sanki?
|
|
||
| class Meta: | ||
| model = BasketItem | ||
| fields = ("basket", "product","quantity","price" ) |
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.
id eklememizde fayda var.
All models' serializers, filters, viewsets was created, these are;
Also all models' serializer roots was created at the ecommerce/urls.py
Pagination was added to ecommerce/settings.py