Notification api lari chiqarildi
This commit is contained in:
@@ -3,6 +3,7 @@ from django_core.models.base import AbstractBaseModel
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
from core.apps.accounts.choices import NotificationType
|
||||
from django.contrib.auth import get_user_model
|
||||
from model_bakery import baker
|
||||
|
||||
|
||||
class Notification(AbstractBaseModel):
|
||||
@@ -12,6 +13,10 @@ class Notification(AbstractBaseModel):
|
||||
long = models.FloatField(verbose_name=_("Long"))
|
||||
lat = models.FloatField(verbose_name=_("Lat"))
|
||||
|
||||
@classmethod
|
||||
def _baker(cls):
|
||||
return baker.make(cls)
|
||||
|
||||
def __str__(self):
|
||||
return str(self.pk)
|
||||
|
||||
@@ -26,6 +31,10 @@ class UserNotification(AbstractBaseModel):
|
||||
notification = models.ForeignKey(Notification, verbose_name=_("Notification"), on_delete=models.CASCADE)
|
||||
is_read = models.BooleanField(verbose_name=_("Read"), default=False)
|
||||
|
||||
@classmethod
|
||||
def _baker(cls):
|
||||
return baker.make(cls)
|
||||
|
||||
def __str__(self):
|
||||
return str(self.pk)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user