-
Notifications
You must be signed in to change notification settings - Fork 30
Ertugrulbal hw4 #95
base: main
Are you sure you want to change the base?
Ertugrulbal hw4 #95
Conversation
upy
left a comment
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.
Baskete urun ekleme ile ilgili bir calisma goremedim.
|
|
||
| class Meta: | ||
| model = Customer | ||
| fields =("id", "first_name", "last_name", "email", "is_staff", "is_active", "date_joined") |
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.
register yapilirken "is_staff", "is_active", "date_joined" bu bilgiler fazla bunlari silmemizde fayda var.
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.
ve password bilgisini almaliyiz.
| return obj | ||
| class RegisterViewSet(mixins.CreateModelMixin,GenericViewSet ): | ||
| queryset = Customer.objects.all() | ||
| serializer_class = ProfileSerializer |
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.
sanirim RegisterSerializer diyecektik?
| model = Price | ||
| fields = ("id", "product", "amount") | ||
|
|
||
| class ProductCreateSerializer(serializers.ModelSerializer): |
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.
bunu neden ekledigimizi anlamadim.
| "detailed": ProductDetailedSerializer, | ||
| } | ||
|
|
||
| class ProductCreateViewSet(viewsets.ModelViewSet): |
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.
bunu da neden ekledigimizi anlamadim
Register and ProductCreate endpoints are created. And I controlled permissions all models.