diff --git a/apps/promotions/models.py b/apps/promotions/models.py index 77ad649..43a5cc9 100644 --- a/apps/promotions/models.py +++ b/apps/promotions/models.py @@ -15,10 +15,8 @@ class EventQuerySet(models.QuerySet): pass class Event(BaseModel): - actor = None - target = None - label = None - details = {} + label = models.CharField(max_length=255, db_index=True) + details = models.JSONField() # from to amount application user etc objects = EventQuerySet.as_manager() @@ -28,6 +26,8 @@ class Event(BaseModel): class PlanQuerySet(models.QuerySet): + + # this is for list of discount code for example def calculate(self, user, application=None): for plan in self.filter(application=application)[:10]: if not Promotion.objects.used(user):