# HG changeset patch # User Julien Jehannet # Date 1312370886 -7200 # Node ID 432e1f0d4857c818f60117d7d19a0dada7f03c41 # Parent 5430d0db52ab919809c33959233ba9d4e305d332 [schema] use definition for `use_email` relation instead of type declaration (closes: #1894929) This will be more adaptable for other existent `use_relastion` as the one in the cube Person. diff -r 5430d0db52ab -r 432e1f0d4857 schemas/base.py --- a/schemas/base.py Thu Aug 04 12:11:36 2011 +0200 +++ b/schemas/base.py Wed Aug 03 13:28:06 2011 +0200 @@ -46,8 +46,6 @@ # test at least :-/ primary_email = SubjectRelation('EmailAddress', cardinality='??', description=_('email address to use for notification')) - use_email = SubjectRelation('EmailAddress', cardinality='*?', composite='subject') - in_group = SubjectRelation('CWGroup', cardinality='+*', constraints=[RQLConstraint('NOT O name "owners"')], description=_('groups grant permissions to the user')) @@ -71,13 +69,20 @@ to indicate which is the preferred form.')) class use_email(RelationType): - """ """ + fulltext_container = 'subject' + +class use_email_relation(RelationDefinition): + """user's email account""" + name = "use_email" __permissions__ = { 'read': ('managers', 'users', 'guests',), 'add': ('managers', RRQLExpression('U has_update_permission S'),), 'delete': ('managers', RRQLExpression('U has_update_permission S'),), } - fulltext_container = 'subject' + subject = "CWUser" + object = "EmailAddress" + cardinality = '*?' + composite = 'subject' class primary_email(RelationType): """the prefered email"""