This commit is contained in:
A'zamov Samandar
2025-12-06 21:50:28 +05:00
parent 3aa20fdaa1
commit f5766aa319
140 changed files with 2376 additions and 1582 deletions

View File

@@ -0,0 +1,26 @@
from django.db import models
from django_core.models.base import AbstractBaseModel
from django.utils.translation import gettext_lazy as _
from django.core.validators import MinValueValidator
class AdTopPlanModel(AbstractBaseModel):
name = models.CharField(_("Plan Name"), max_length=255, unique=True)
price = models.DecimalField(
_("Price"),
max_digits=10,
decimal_places=2,
validators=[MinValueValidator(0)]
)
duration = models.PositiveIntegerField(_("Duration (days)"))
description = models.TextField(_("Description"), blank=True)
is_active = models.BooleanField(_("Is Active"), default=True)
def __str__(self):
return f"{self.name} - {self.duration} days"
class Meta:
db_table = "ad_top_plan"
verbose_name = _("Ad Top Plan")
verbose_name_plural = _("Ad Top Plans")
ordering = ["price"]