Modellar tayyor

This commit is contained in:
2025-11-24 11:46:23 +05:00
parent 3da10c2a7f
commit 5632e0c484
48 changed files with 877 additions and 33 deletions

View File

@@ -0,0 +1 @@
from .banner import * # noqa

View File

@@ -0,0 +1,21 @@
from django.db import models
from django.utils.translation import gettext_lazy as _
from django_core.models.base import AbstractBaseModel
class Banner(AbstractBaseModel):
title = models.CharField(max_length=255, verbose_name=_("Title"))
description = models.TextField(verbose_name=_("Description"))
mobile_image = models.ImageField(verbose_name=_("Mobile Image"), upload_to="banner/mobile_image/")
desktop_image = models.ImageField(verbose_name=_("Desktop Image"), upload_to="banner/desktop_image/")
link = models.URLField(verbose_name=_("Link"))
bg_color = models.CharField(verbose_name=_("BG Color"), max_length=255)
text_color = models.CharField(verbose_name=_("Text Color"), max_length=255)
def __str__(self):
return str(self.pk)
class Meta:
db_table = "banner"
verbose_name = _("Banner")
verbose_name_plural = _("Banners")