Notification api lari chiqarildi

This commit is contained in:
2025-11-27 00:40:27 +05:00
parent 900f23e5f6
commit e8e900c393
14 changed files with 265 additions and 4 deletions

View File

@@ -5,3 +5,4 @@ from .address import * # noqa
from .business import * # noqa
from .user_like import * # noqa
from .search_history import * # noqa
from .notification import * # noqa

View File

@@ -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)