Add sites Category model
This commit is contained in:
parent
ba43e527c9
commit
72b0f9f338
1 changed files with 20 additions and 0 deletions
20
archivist/apps/sites/models.py
Normal file
20
archivist/apps/sites/models.py
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
from django.db import models
|
||||||
|
from django.urls import reverse
|
||||||
|
|
||||||
|
from django.contrib.contenttypes.fields import GenericForeignKey, GenericRelation
|
||||||
|
from django.contrib.contenttypes.models import ContentType
|
||||||
|
|
||||||
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
|
class Category(models.Model):
|
||||||
|
|
||||||
|
name = models.CharField(unique=True, max_length=64)
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
verbose_name = _("Category")
|
||||||
|
verbose_name_plural = _("Categories")
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
return self.name.capitalize()
|
||||||
|
|
Loading…
Reference in a new issue