clean code with space
This commit is contained in:
@@ -7,6 +7,8 @@ class CustomTokenObtainPairSerializer(TokenObtainPairSerializer):
|
|||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super().__init__(*args, **kwargs)
|
super().__init__(*args, **kwargs)
|
||||||
del self.fields['password']
|
del self.fields['password']
|
||||||
|
|
||||||
|
|
||||||
class ProfileSerializer(serializers.ModelSerializer):
|
class ProfileSerializer(serializers.ModelSerializer):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = User
|
model = User
|
||||||
|
|||||||
@@ -46,8 +46,11 @@ class OrderModel(models.Model):
|
|||||||
verbose_name = 'سفارش'
|
verbose_name = 'سفارش'
|
||||||
verbose_name_plural = 'سفارشات'
|
verbose_name_plural = 'سفارشات'
|
||||||
|
|
||||||
|
|
||||||
# def total_without_tax(self):
|
# def total_without_tax(self):
|
||||||
# return sum(item.total() for item in self.items.all())
|
# return sum(item.total() for item in self.items.all())
|
||||||
|
|
||||||
|
|
||||||
def save(self, *args, **kwargs):
|
def save(self, *args, **kwargs):
|
||||||
try:
|
try:
|
||||||
push_object = PushSubscription.objects.get(user=self.user)
|
push_object = PushSubscription.objects.get(user=self.user)
|
||||||
@@ -59,6 +62,7 @@ class OrderModel(models.Model):
|
|||||||
print('didnt send')
|
print('didnt send')
|
||||||
super().save(*args, **kwargs)
|
super().save(*args, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
def discount(self):
|
def discount(self):
|
||||||
pass
|
pass
|
||||||
# total_with_item_discount = sum(item.total_with_discount() for item in self.items.all())
|
# total_with_item_discount = sum(item.total_with_discount() for item in self.items.all())
|
||||||
@@ -73,12 +77,14 @@ class OrderModel(models.Model):
|
|||||||
def tax(self):
|
def tax(self):
|
||||||
return self.total_without_tax() * 0.2
|
return self.total_without_tax() * 0.2
|
||||||
|
|
||||||
|
|
||||||
def total(self):
|
def total(self):
|
||||||
pass
|
pass
|
||||||
# return self.total_with_discount() + self.tax()
|
# return self.total_with_discount() + self.tax()
|
||||||
|
|
||||||
def remove_order_item(self, item_pk, quantity):
|
def remove_order_item(self, item_pk, quantity):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def add_order_item(self, item_pk, quantity):
|
def add_order_item(self, item_pk, quantity):
|
||||||
status = ''
|
status = ''
|
||||||
return status
|
return status
|
||||||
|
|||||||
Reference in New Issue
Block a user