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
ea5822d2e6f4
Commit
ea5822d2e6f4
authored
16 years ago
by
Laure Bourgois
Browse files
Options
Downloads
Patches
Plain Diff
blog implements ISiocContainer, blogentry implements ISiocItem
parent
aec47dd6493f
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
entities.py
+35
-2
35 additions, 2 deletions
entities.py
with
35 additions
and
2 deletions
entities.py
+
35
−
2
View file @
ea5822d2
...
...
@@ -8,10 +8,10 @@
__docformat__
=
"
restructuredtext en
"
from
cubicweb.entities
import
AnyEntity
,
fetch_config
from
cubicweb.interfaces
import
ICalendarViews
,
ICalendarable
from
cubicweb.interfaces
import
ICalendarViews
,
ICalendarable
,
ISiocItem
,
ISiocContainer
from
logilab.mtconverter
import
html_escape
class
BlogEntry
(
AnyEntity
):
"""
customized class for BlogEntry entities
"""
id
=
'
BlogEntry
'
fetch_attrs
,
fetch_order
=
fetch_config
([
'
creation_date
'
,
'
title
'
],
order
=
'
DESC
'
)
...
...
@@ -12,10 +12,10 @@
from
logilab.mtconverter
import
html_escape
class
BlogEntry
(
AnyEntity
):
"""
customized class for BlogEntry entities
"""
id
=
'
BlogEntry
'
fetch_attrs
,
fetch_order
=
fetch_config
([
'
creation_date
'
,
'
title
'
],
order
=
'
DESC
'
)
__implements__
=
(
ICalendarViews
,
ICalendarable
)
__implements__
=
(
ICalendarViews
,
ICalendarable
,
ISiocItem
)
def
dc_title
(
self
):
return
self
.
title
...
...
@@ -44,9 +44,28 @@
descr
=
u
'
%s %s
'
%
(
_
(
'
posted on
'
),
self
.
format_date
(
self
.
creation_date
))
return
descr
def
isioc_item_creator
(
self
):
return
self
.
creator
def
isioc_item_content
(
self
):
return
self
.
content
def
isioc_item_container
(
self
):
rset
=
self
.
related
(
'
entry_of
'
)
entity
=
rset
.
get_entity
(
0
,
0
)
return
entity
def
isioc_item_get_reply
(
self
):
pass
def
isioc_item_creation_date
(
self
):
return
self
.
creation_date
def
isioc_item_modification_date
(
self
):
return
self
.
modification_date
class
Blog
(
AnyEntity
):
"""
customized class for Blog entities
"""
id
=
'
Blog
'
__rtags__
=
{
'
entry_of
'
:
'
create
'
}
...
...
@@ -47,9 +66,10 @@
class
Blog
(
AnyEntity
):
"""
customized class for Blog entities
"""
id
=
'
Blog
'
__rtags__
=
{
'
entry_of
'
:
'
create
'
}
__implements__
=
AnyEntity
.
__implements__
+
(
ISiocContainer
,)
def
rss_feed_url
(
self
):
...
...
@@ -57,6 +77,19 @@
return
self
.
rss_url
rql
=
'
Any E ORDERBY D DESC WHERE E is BlogEntry, E entry_of X, X eid %s, E creation_date D
'
%
self
.
eid
return
self
.
build_url
(
rql
=
rql
,
vid
=
'
rss
'
,
vtitle
=
self
.
dc_title
())
def
isioc_container_type
(
self
):
return
'
Weblog
'
def
isioc_container_creation_date
(
self
):
return
self
.
creation_date
def
isioc_container_modification_date
(
self
):
return
self
.
modification_date
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