Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Maják
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TO
Maják
Merge requests
!186
Uniweb články
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Uniweb články
uniweb
into
test
Overview
0
Commits
6
Pipelines
1
Changes
25
Merged
jan.bednarik
requested to merge
uniweb
into
test
4 years ago
Overview
0
Commits
6
Pipelines
1
Changes
25
Expand
0
0
Merge request reports
Compare
test
test (base)
and
latest version
latest version
84700649
6 commits,
4 years ago
25 files
+
1451
−
41
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
25
Search (e.g. *.vue) (Ctrl+P)
shared/models.py
+
17
−
1
Options
@@ -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