Changeset View
Changeset View
Standalone View
Standalone View
training/models/trainings.py
| Show All 18 Lines | |||||
| class TrainingDifficulty(models.TextChoices): | class TrainingDifficulty(models.TextChoices): | ||||
| beginner = 'beginner', 'Beginner' | beginner = 'beginner', 'Beginner' | ||||
| intermediate = 'intermediate', 'Intermediate' | intermediate = 'intermediate', 'Intermediate' | ||||
| advanced = 'advanced', 'Advanced' | advanced = 'advanced', 'Advanced' | ||||
| class Training(mixins.CreatedUpdatedMixin, models.Model): | class Training(mixins.CreatedUpdatedMixin, mixins.StaticThumbnailURLMixin, models.Model): | ||||
| class Meta: | class Meta: | ||||
| indexes = [ | indexes = [ | ||||
| models.Index(fields=['status', 'type', 'difficulty']), | models.Index(fields=['status', 'type', 'difficulty']), | ||||
| models.Index(fields=['status', 'difficulty', 'type']), | models.Index(fields=['status', 'difficulty', 'type']), | ||||
| ] | ] | ||||
| name = models.CharField(unique=True, max_length=512) | name = models.CharField(unique=True, max_length=512) | ||||
| slug = models.SlugField(unique=True, blank=True) | slug = models.SlugField(unique=True, blank=True) | ||||
| ▲ Show 20 Lines • Show All 55 Lines • Show Last 20 Lines | |||||