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

Conversation

@victoraysev
Copy link

  • register is done
  • add basket item is done . in url /baskets/<basket_id>/add_basket_item
    automatically saved to <basket_id> basket.


def get_queryset(self):
queryset = super().get_queryset()
user = self.request.user
Copy link
Owner

Choose a reason for hiding this comment

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

login olmamis bir customer varsa sanki problem var.


def get_queryset(self):
queryset = super().get_queryset()
user = self.request.user
Copy link
Owner

Choose a reason for hiding this comment

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

login olmamis bir customer varsa sanki problem var.

copy_data["basket_id"] = pk
serializer = BasketItemSerializer(data=copy_data)
if serializer.is_valid():
BasketItem.create(copy_data)
Copy link
Owner

Choose a reason for hiding this comment

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

kayit insert/update islemlerini modeller uzerinden degil de serializer uzerinden yapmak daha iyi bir fikir.

)

def create(self, validated_data):
user = Customer.objects.create(
Copy link
Owner

Choose a reason for hiding this comment

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

manager uzerinde create_user isminde guzel bir methodumuz var.

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