-
Notifications
You must be signed in to change notification settings - Fork 0
/
models.py
28 lines (21 loc) · 968 Bytes
/
models.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
from django.db import models
class CommonFieldsNameIsPublished(models.Model):
is_published = models.BooleanField(default=True,
verbose_name='Опубликовано',
)
name = models.CharField(max_length=150,
verbose_name='Название',
help_text='''максимум 150 символов''',
)
class Meta:
abstract = True
def __str__(self):
return f'{self.name}'
class CommonFieldsSlugNameIsPublished(CommonFieldsNameIsPublished):
slug = models.SlugField(unique=True, max_length=200,
verbose_name='Адрес',
help_text='''Только slug-значения,
максимум 200 символов''',
)
class Meta:
abstract = True