Skip to content
Snippets Groups Projects

Uniweb články

Merged jan.bednarik requested to merge uniweb into test
25 files
+ 1451
41
Compare changes
  • Side-by-side
  • Inline
Files
25
+ 17
1
@@ -25,7 +25,11 @@ class SubpageMixin:
class ArticleMixin(models.Model):
"""Common fields for articles"""
"""
Common fields for articles
If you want to tag articles, add tags as `tags` field in article page model.
"""
RICH_TEXT_FEATURES = [
"h2",
@@ -66,6 +70,18 @@ class ArticleMixin(models.Model):
class Meta:
abstract = True
@classmethod
def has_tags(cls):
try:
cls._meta.get_field("tags")
except models.FieldDoesNotExist:
return False
return True
def tag_filter_page(self):
"""Page used for filtering by tags in url like `?tag=foo`."""
return self.get_parent()
class Person(models.Model):
"""Informace o Piratovi. Slouzi prevazne jako cache informaci o osobe pro
Loading