Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cubicweb
cubes
person
Commits
2d3ca66ec7f5
Commit
3b9efb47
authored
Jul 08, 2010
by
Stephanie Marcu
Browse files
remove deprecation warnings cw 3.9
parent
17e564618654
Changes
3
Hide whitespace changes
Inline
Side-by-side
hooks.py
View file @
2d3ca66e
from
cubicweb.selectors
import
i
mplements
from
cubicweb.selectors
import
i
s_instance
from
cubicweb.sobjects.notification
import
ContentAddedView
class
PersonAddedView
(
ContentAddedView
):
"""get notified from new persons"""
__select__
=
i
mplements
(
'Person'
)
__select__
=
i
s_instance
(
'Person'
)
content_attr
=
'description'
test/unittest_person.py
View file @
2d3ca66e
...
...
@@ -6,7 +6,7 @@ class PersonTC(CubicWebTC):
self
.
request
().
create_entity
(
'Person'
,
firstname
=
u
'adrien'
,
surname
=
u
'di mascio'
)
def
test_dc_title
(
self
):
e
=
self
.
e
ntity
(
'Any X WHERE X is Person'
)
e
=
self
.
e
xecute
(
'Any X WHERE X is Person'
)
.
get_entity
(
0
,
0
)
self
.
assertEquals
(
e
.
dc_title
(),
'adrien di mascio'
)
self
.
assertEquals
(
e
.
dc_long_title
(),
'Mr adrien di mascio'
)
...
...
views.py
View file @
2d3ca66e
...
...
@@ -9,7 +9,7 @@ __docformat__ = "restructuredtext en"
from
logilab.mtconverter
import
xml_escape
from
cubicweb.schema
import
display_name
from
cubicweb.selectors
import
i
mplements
,
rql_condition
from
cubicweb.selectors
import
i
s_instance
,
rql_condition
from
cubicweb.web
import
uicfg
,
action
from
cubicweb.web.views
import
baseviews
,
primary
,
vcard
from
cubicweb.web.facet
import
AttributeFacet
...
...
@@ -32,7 +32,7 @@ _afs.tag_subject_of(('Person', 'im_address', '*'), 'main', 'inlined')
class
PersonPrimaryView
(
primary
.
PrimaryView
):
__select__
=
i
mplements
(
'Person'
)
__select__
=
i
s_instance
(
'Person'
)
attr_table_relations
=
[(
'phone'
,
', '
.
join
),
(
'use_email'
,
', '
.
join
),
(
'im_address'
,
', '
.
join
),
...
...
@@ -57,7 +57,7 @@ class PersonPrimaryView(primary.PrimaryView):
class
PersonTextView
(
baseviews
.
TextView
):
__select__
=
i
mplements
(
'Person'
)
__select__
=
i
s_instance
(
'Person'
)
def
cell_call
(
self
,
row
,
col
):
entity
=
self
.
cw_rset
.
get_entity
(
row
,
col
)
...
...
@@ -67,7 +67,7 @@ class PersonTextView(baseviews.TextView):
class
PersonEmailView
(
baseviews
.
EntityView
):
"""display emails sent or received by one of this person's addresses"""
__regid__
=
'emails'
__select__
=
i
mplements
(
'Person'
)
__select__
=
i
s_instance
(
'Person'
)
title
=
_
(
'emails'
)
def
cell_call
(
self
,
row
,
col
=
0
):
...
...
@@ -91,7 +91,7 @@ class PersonEmailView(baseviews.EntityView):
class
VCardPersonView
(
vcard
.
VCardCWUserView
):
"""export a person information as a vcard"""
__select__
=
i
mplements
(
'Person'
)
__select__
=
i
s_instance
(
'Person'
)
def
vcard_content
(
self
,
entity
):
w
=
self
.
w
...
...
@@ -114,7 +114,7 @@ class VCardPersonView(vcard.VCardCWUserView):
class
AddPersonFromEmailAction
(
action
.
LinkToEntityAction
):
__regid__
=
'addperson-fromemail'
__select__
=
i
mplements
(
'EmailAddress'
)
&
rql_condition
(
'NOT P use_email X'
)
__select__
=
i
s_instance
(
'EmailAddress'
)
&
rql_condition
(
'NOT P use_email X'
)
title
=
_
(
'add Person use_email EmailAddress object'
)
etype
=
'Person'
...
...
@@ -125,5 +125,5 @@ class AddPersonFromEmailAction(action.LinkToEntityAction):
class
CivilityFacet
(
AttributeFacet
):
__regid__
=
'civility-facet'
__select__
=
i
mplements
(
'Person'
)
__select__
=
i
s_instance
(
'Person'
)
rtype
=
'civility'
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment