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
18700808
Commit
18700808
authored
3 years ago
by
OndraRehounek
Browse files
Options
Downloads
Patches
Plain Diff
Fix ordering fields
parent
59f3e091
No related branches found
No related tags found
2 merge requests
!435
Release upgrades
,
!430
Feature/majak misc enhancements
Pipeline
#7147
passed
3 years ago
Stage: build
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
district/models.py
+7
-4
7 additions, 4 deletions
district/models.py
region/models.py
+4
-4
4 additions, 4 deletions
region/models.py
with
11 additions
and
8 deletions
district/models.py
+
7
−
4
View file @
18700808
...
@@ -193,7 +193,7 @@ class DistrictHomePage(MetadataPageMixin, CalendarMixin, Page):
...
@@ -193,7 +193,7 @@ class DistrictHomePage(MetadataPageMixin, CalendarMixin, Page):
.
type
(
DistrictArticlePage
)
.
type
(
DistrictArticlePage
)
.
live
()
.
live
()
.
specific
()
.
specific
()
.
order_by
(
"
-
last_published_
at
"
)[:
6
]
.
order_by
(
"
-
districtarticlepage__d
at
e
"
)[:
6
]
)
)
@property
@property
...
@@ -276,7 +276,7 @@ class DistrictArticlePage(ArticleMixin, SubpageMixin, MetadataPageMixin, Page):
...
@@ -276,7 +276,7 @@ class DistrictArticlePage(ArticleMixin, SubpageMixin, MetadataPageMixin, Page):
self
.
get_siblings
(
inclusive
=
False
)
self
.
get_siblings
(
inclusive
=
False
)
.
live
()
# TODO? filtrovat na stejné tagy?
.
live
()
# TODO? filtrovat na stejné tagy?
.
specific
()
.
specific
()
.
order_by
(
"
-
last_published_
at
"
)[:
3
]
.
order_by
(
"
-
districtarticlepage__d
at
e
"
)[:
3
]
)
)
return
context
return
context
...
@@ -307,7 +307,10 @@ class DistrictArticlesPage(SubpageMixin, MetadataPageMixin, Page):
...
@@ -307,7 +307,10 @@ class DistrictArticlesPage(SubpageMixin, MetadataPageMixin, Page):
def
get_context
(
self
,
request
):
def
get_context
(
self
,
request
):
context
=
super
().
get_context
(
request
)
context
=
super
().
get_context
(
request
)
context
[
"
articles
"
]
=
Paginator
(
context
[
"
articles
"
]
=
Paginator
(
self
.
get_children
().
live
().
specific
().
order_by
(
"
-last_published_at
"
),
self
.
get_children
()
.
live
()
.
specific
()
.
order_by
(
"
-districtarticlepage__date
"
),
self
.
max_items
,
self
.
max_items
,
).
get_page
(
request
.
GET
.
get
(
"
page
"
))
).
get_page
(
request
.
GET
.
get
(
"
page
"
))
return
context
return
context
...
@@ -393,7 +396,7 @@ class DistrictTagsPage(SubpageMixin, MetadataPageMixin, Page):
...
@@ -393,7 +396,7 @@ class DistrictTagsPage(SubpageMixin, MetadataPageMixin, Page):
return
{
return
{
"
article_page_list
"
:
Paginator
(
"
article_page_list
"
:
Paginator
(
article_page_qs
.
order_by
(
"
-
last_published_at
"
),
article_page_qs
.
order_by
(
"
-
date
"
),
self
.
root_page
.
articles_page
.
max_items
,
self
.
root_page
.
articles_page
.
max_items
,
).
get_page
(
request
.
GET
.
get
(
"
page
"
)),
).
get_page
(
request
.
GET
.
get
(
"
page
"
)),
"
tag
"
:
tag
,
"
tag
"
:
tag
,
...
...
This diff is collapsed.
Click to expand it.
region/models.py
+
4
−
4
View file @
18700808
...
@@ -193,7 +193,7 @@ class RegionHomePage(MetadataPageMixin, CalendarMixin, Page):
...
@@ -193,7 +193,7 @@ class RegionHomePage(MetadataPageMixin, CalendarMixin, Page):
.
type
(
RegionArticlePage
)
.
type
(
RegionArticlePage
)
.
live
()
.
live
()
.
specific
()
.
specific
()
.
order_by
(
"
-
last_published_
at
"
)[:
6
]
.
order_by
(
"
-
regionarticlepage__d
at
e
"
)[:
6
]
)
)
@property
@property
...
@@ -274,7 +274,7 @@ class RegionArticlePage(ArticleMixin, SubpageMixin, MetadataPageMixin, Page):
...
@@ -274,7 +274,7 @@ class RegionArticlePage(ArticleMixin, SubpageMixin, MetadataPageMixin, Page):
self
.
get_siblings
(
inclusive
=
False
)
self
.
get_siblings
(
inclusive
=
False
)
.
live
()
.
live
()
.
specific
()
.
specific
()
.
order_by
(
"
-
last_published_
at
"
)[:
3
]
.
order_by
(
"
-
regionarticlepage__d
at
e
"
)[:
3
]
)
)
return
context
return
context
...
@@ -305,7 +305,7 @@ class RegionArticlesPage(SubpageMixin, MetadataPageMixin, Page):
...
@@ -305,7 +305,7 @@ class RegionArticlesPage(SubpageMixin, MetadataPageMixin, Page):
def
get_context
(
self
,
request
):
def
get_context
(
self
,
request
):
context
=
super
().
get_context
(
request
)
context
=
super
().
get_context
(
request
)
context
[
"
articles
"
]
=
Paginator
(
context
[
"
articles
"
]
=
Paginator
(
self
.
get_children
().
live
().
specific
().
order_by
(
"
-
last_published_
at
"
),
self
.
get_children
().
live
().
specific
().
order_by
(
"
-
regionarticlepage__d
at
e
"
),
self
.
max_items
,
self
.
max_items
,
).
get_page
(
request
.
GET
.
get
(
"
page
"
))
).
get_page
(
request
.
GET
.
get
(
"
page
"
))
return
context
return
context
...
@@ -391,7 +391,7 @@ class RegionTagsPage(SubpageMixin, MetadataPageMixin, Page):
...
@@ -391,7 +391,7 @@ class RegionTagsPage(SubpageMixin, MetadataPageMixin, Page):
return
{
return
{
"
article_page_list
"
:
Paginator
(
"
article_page_list
"
:
Paginator
(
article_page_qs
.
order_by
(
"
-
last_published_at
"
),
article_page_qs
.
order_by
(
"
-
date
"
),
self
.
root_page
.
articles_page
.
max_items
,
self
.
root_page
.
articles_page
.
max_items
,
).
get_page
(
request
.
GET
.
get
(
"
page
"
)),
).
get_page
(
request
.
GET
.
get
(
"
page
"
)),
"
tag
"
:
tag
,
"
tag
"
:
tag
,
...
...
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