Commit 580112e7f88365f9376a7d88d66b8ff2e7daefb0
1 parent
724a79a6
Exists in
master
and in
2 other branches
Some modifications in news model
Showing
1 changed file
with
10 additions
and
4 deletions
Show diff stats
news/models.py
@@ -15,7 +15,13 @@ def validate_img_extension(value): | @@ -15,7 +15,13 @@ def validate_img_extension(value): | ||
15 | raise ValidationError(_('File not supported.')) | 15 | raise ValidationError(_('File not supported.')) |
16 | 16 | ||
17 | class News(models.Model): | 17 | class News(models.Model): |
18 | - title = models.CharField( _("Name"), unique = True,max_length= 200) | ||
19 | - slug = AutoSlugField(_("Slug"),populate_from='title',unique=True) | ||
20 | - image = models.ImageField(verbose_name = _('News Image'), upload_to = 'news/', validators = [validate_img_extension]) | ||
21 | - content = models.TextField(_('Description')) | 18 | + title = models.CharField( _("Name"), unique = True,max_length= 200) |
19 | + slug = AutoSlugField(_("Slug"),populate_from='title',unique=True) | ||
20 | + image = models.ImageField(verbose_name = _('News Image'), upload_to = 'news/', validators = [validate_img_extension]) | ||
21 | + content = models.TextField(_('News Content')) | ||
22 | + class Meta: | ||
23 | + verbose_name = _('News') | ||
24 | + verbose_name_plural = _('News') | ||
25 | + | ||
26 | + def __str__(self): | ||
27 | + return self.title |