shared task for send notif and sms
This commit is contained in:
@@ -66,9 +66,11 @@ class OrderModel(models.Model):
|
||||
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
# genrate order id
|
||||
if not self.pk:
|
||||
last_instance = self.__class__.objects.order_by("pk").last()
|
||||
self.order_id = (last_instance.pk + 1001) if last_instance else 1001
|
||||
|
||||
super().save(*args, **kwargs)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user