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
Commits
cd778f8a
Commit
cd778f8a
authored
4 years ago
by
jan.bednarik
Browse files
Options
Downloads
Patches
Plain Diff
shared: Rename SubpageMixin
parent
12786a71
Branches
Branches containing commit
No related tags found
2 merge requests
!173
Release
,
!134
Weby pro MS
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
district/models.py
+4
-13
4 additions, 13 deletions
district/models.py
shared/models.py
+5
-5
5 additions, 5 deletions
shared/models.py
with
9 additions
and
18 deletions
district/models.py
+
4
−
13
View file @
cd778f8a
...
...
@@ -7,16 +7,7 @@ from wagtail.core.fields import StreamField
from
wagtail.core.models
import
Page
from
wagtailmetadata.models
import
MetadataPageMixin
from
shared.models
import
Article
,
PeoplePage
,
SharedSubpageMixin
class
SubpageMixin
:
"""
Must be used in class definition before MetadataPageMixin!
Obsolete, misto nej pouzivat SharedSubpageMixin
TODO je pouze v migracich, po odstraneni z nich lze smazat
"""
pass
from
shared.models
import
Article
,
PeoplePage
,
SubpageMixin
class
DistrictHomePage
(
MetadataPageMixin
,
Page
):
...
...
@@ -150,7 +141,7 @@ class DistrictHomePage(MetadataPageMixin, Page):
return
self
class
DistrictArticles
(
Shared
SubpageMixin
,
MetadataPageMixin
,
Page
):
class
DistrictArticles
(
SubpageMixin
,
MetadataPageMixin
,
Page
):
### FIELDS
max_items
=
models
.
IntegerField
(
...
...
@@ -183,7 +174,7 @@ class DistrictArticles(SharedSubpageMixin, MetadataPageMixin, Page):
return
context
class
DistrictContact
(
Shared
SubpageMixin
,
MetadataPageMixin
,
Page
):
class
DistrictContact
(
SubpageMixin
,
MetadataPageMixin
,
Page
):
class
ContactItemBlock
(
blocks
.
StructBlock
):
name
=
blocks
.
CharBlock
(
label
=
"
Role
"
)
person
=
blocks
.
PageChooserBlock
(
...
...
@@ -208,7 +199,7 @@ class DistrictContact(SharedSubpageMixin, MetadataPageMixin, Page):
verbose_name
=
"
Kontakty
"
class
DistrictTags
(
Shared
SubpageMixin
,
MetadataPageMixin
,
Page
):
class
DistrictTags
(
SubpageMixin
,
MetadataPageMixin
,
Page
):
settings_panels
=
[]
...
...
This diff is collapsed.
Click to expand it.
shared/models.py
+
5
−
5
View file @
cd778f8a
...
...
@@ -8,14 +8,14 @@ from django.db import models
from
modelcluster.contrib.taggit
import
ClusterTaggableManager
from
modelcluster.fields
import
ParentalKey
from
taggit.models
import
TaggedItemBase
from
wagtail.admin.edit_handlers
import
FieldPanel
,
HelpPanel
from
wagtail.admin.edit_handlers
import
FieldPanel
from
wagtail.core.fields
import
RichTextField
from
wagtail.core.models
import
Page
from
wagtail.images.edit_handlers
import
ImageChooserPanel
from
wagtailmetadata.models
import
MetadataPageMixin
class
Shared
SubpageMixin
:
class
SubpageMixin
:
"""
Must be used in class definition before MetadataPageMixin!
"""
@property
...
...
@@ -74,7 +74,7 @@ class ArticleMixin(models.Model):
verbose_name
=
"
Článek
"
class
Article
(
ArticleMixin
,
Page
,
Shared
SubpageMixin
,
MetadataPageMixin
):
class
Article
(
ArticleMixin
,
Page
,
SubpageMixin
,
MetadataPageMixin
):
"""
Univerzalni clanek pro vsechny weby
"""
content_panels
=
Page
.
content_panels
+
[
...
...
@@ -162,7 +162,7 @@ class Person(models.Model):
verbose_name
=
"
Pirát
"
class
PersonPage
(
Shared
SubpageMixin
,
MetadataPageMixin
,
Page
):
class
PersonPage
(
SubpageMixin
,
MetadataPageMixin
,
Page
):
"""
Stranka Pirata v kontextu jednoho webu
"""
person
=
models
.
ForeignKey
(
Person
,
on_delete
=
models
.
PROTECT
,
null
=
True
)
...
...
@@ -194,7 +194,7 @@ class PersonPage(SharedSubpageMixin, MetadataPageMixin, Page):
return
context
class
PeoplePage
(
Shared
SubpageMixin
,
MetadataPageMixin
,
Page
):
class
PeoplePage
(
SubpageMixin
,
MetadataPageMixin
,
Page
):
"""
Stranka se zobrazenim lidi v dane organizaci
"""
settings_panels
=
[]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment