Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
blog
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
Service Desk
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
cubicweb
cubes
blog
Commits
5ebb8152c714
Commit
5ebb8152c714
authored
15 years ago
by
Sylvain Thénault
Browse files
Options
Downloads
Patches
Plain Diff
fix sameetype overriding
parent
b34fc7161e62
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
views/primary.py
+5
-4
5 additions, 4 deletions
views/primary.py
views/secondary.py
+6
-8
6 additions, 8 deletions
views/secondary.py
with
11 additions
and
12 deletions
views/primary.py
+
5
−
4
View file @
5ebb8152
...
...
@@ -36,10 +36,11 @@
def
render_entity_relations
(
self
,
entity
):
super
(
BlogPrimaryView
,
self
).
render_entity_relations
(
entity
)
rset
=
entity
.
related
(
'
entry_of
'
,
'
object
'
)
strio
=
UStringIO
()
self
.
paginate
(
self
.
_cw
,
w
=
strio
.
write
,
page_size
=
10
,
rset
=
rset
)
self
.
wview
(
'
adaptedlist
'
,
rset
,
'
null
'
)
self
.
w
(
strio
.
getvalue
())
if
rset
:
strio
=
UStringIO
()
self
.
paginate
(
self
.
_cw
,
w
=
strio
.
write
,
page_size
=
10
,
rset
=
rset
)
self
.
wview
(
'
sameetypelist
'
,
rset
)
self
.
w
(
strio
.
getvalue
())
def
render_entity_title
(
self
,
entity
):
self
.
w
(
u
'
<h1>%s</h1>
'
%
xml_escape
(
entity
.
dc_title
()))
...
...
This diff is collapsed.
Click to expand it.
views/secondary.py
+
6
−
8
View file @
5ebb8152
"""
Secondary views for blogs
:organization: Logilab
:copyright: 2003-200
9
LOGILAB S.A. (Paris, FRANCE), all rights reserved.
:copyright: 2003-20
1
0 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
:contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
"""
__docformat__
=
"
restructuredtext en
"
...
...
@@ -142,6 +142,6 @@
## list views ##################################################################
class
BlogEntry
Adapted
ListView
(
baseviews
.
Adapted
ListView
):
__select__
=
baseviews
.
Adapted
ListView
.
__select__
&
implements
(
'
BlogEntry
'
)
class
BlogEntry
SameEType
ListView
(
baseviews
.
SameEType
ListView
):
__select__
=
baseviews
.
SameEType
ListView
.
__select__
&
implements
(
'
BlogEntry
'
)
countrql
=
'
Any COUNT(B) WHERE B is BlogEntry, B creation_date >= %(firstday)s, B creation_date <= %(lastday)s
'
...
...
@@ -147,4 +147,5 @@
countrql
=
'
Any COUNT(B) WHERE B is BlogEntry, B creation_date >= %(firstday)s, B creation_date <= %(lastday)s
'
item_vid
=
'
blog
'
def
call
(
self
,
**
kwargs
):
self
.
_cw
.
add_css
(
'
cubes.blog.css
'
)
...
...
@@ -148,7 +149,8 @@
def
call
(
self
,
**
kwargs
):
self
.
_cw
.
add_css
(
'
cubes.blog.css
'
)
super
(
BlogEntryAdaptedListView
,
self
).
call
(
**
kwargs
)
print
'
yoooo
'
super
(
BlogEntrySameETypeListView
,
self
).
call
(
**
kwargs
)
if
'
year
'
in
self
.
_cw
.
form
and
'
month
'
in
self
.
_cw
.
form
:
self
.
render_next_previous
(
int
(
self
.
_cw
.
form
[
'
year
'
]),
int
(
self
.
_cw
.
form
[
'
month
'
]))
...
...
@@ -191,10 +193,6 @@
return
u
'
<a href=
"
%s
"
title=
""
>%s</a>
'
%
(
url
,
atitle
)
return
u
''
class
BlogEntryAdaptedListItemView
(
baseviews
.
AdaptedListItemView
):
__select__
=
baseviews
.
AdaptedListView
.
__select__
&
implements
(
'
BlogEntry
'
)
redirect_vid
=
'
blog
'
class
BlogEntryBlogView
(
EntityView
):
__regid__
=
'
blog
'
...
...
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