add __str__ method for Order model
This commit is contained in:
parent
e74783162f
commit
3e80c51572
|
@ -69,6 +69,9 @@ class Order(CreatedUpdatedModel):
|
||||||
default=BLOCKCHAIN
|
default=BLOCKCHAIN
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
return 'order id #%s' % self.pk
|
||||||
|
|
||||||
def get_number_of_items(self):
|
def get_number_of_items(self):
|
||||||
return self.products.aggregate(
|
return self.products.aggregate(
|
||||||
sum=Sum('orderproductrelation__quantity')
|
sum=Sum('orderproductrelation__quantity')
|
||||||
|
|
Loading…
Reference in a new issue