Add Certificate model and write crud for it

This commit is contained in:
komoliddin
2026-04-23 16:07:37 +05:00
parent 320f490d23
commit 76563b3ef0
9 changed files with 86 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
from django.db import models
from django_core.models import AbstractBaseModel
from model_bakery import baker
from django.utils.translation import gettext_lazy as _
class CertificateModel(AbstractBaseModel):
title = models.CharField(verbose_name=_("title"), max_length=255, blank=False, null=False)
file_url = models.URLField(verbose_name=_("file url"), max_length=255, blank=False, null=False)
def __str__(self):
return self.title
@classmethod
def _baker(cls):
return baker.make(cls)
class Meta:
db_table = "certificate"
verbose_name = _("Certificate")
verbose_name_plural = _("Certificates")