fix vocabularies to store identifiers
This commit is contained in:
parent
8b67b9b964
commit
c1f1045201
|
@ -49,7 +49,7 @@ class DeputiesSource(object):
|
|||
def format_deputy(x):
|
||||
return '%s %s (%s)' % (x.lastname, x.firstname, x.polgroup.to_object.title)
|
||||
deputies_terms = [SimpleVocabulary.createTerm(
|
||||
format_deputy(x), 'deputy:'+x.id, format_deputy(x))
|
||||
'deputy:'+x.id, 'deputy:'+x.id, format_deputy(x))
|
||||
for x in deputies]
|
||||
return deputies_terms
|
||||
|
||||
|
@ -79,7 +79,7 @@ class MinistriesSource(object):
|
|||
format_ministry(x), 'ministry:'+x.id, format_ministry(x))
|
||||
for x in ministries]
|
||||
college_term = SimpleVocabulary.createTerm(
|
||||
u'Collège','ministry:college', u'Collège')
|
||||
'ministry:college','ministry:college', u'Collège')
|
||||
return [college_term] + ministries_terms
|
||||
|
||||
def __call__(self, context):
|
||||
|
@ -158,7 +158,7 @@ class ContactsSource(object):
|
|||
contacts.sort(cmp_contact)
|
||||
contact_ids = [x.id for x in contacts]
|
||||
contacts_terms = [SimpleVocabulary.createTerm(
|
||||
x.title, 'contact:'+x.id, x.title) for x in contacts]
|
||||
'contact:'+x.id, 'contact:'+x.id, x.title) for x in contacts]
|
||||
return ContactsVocabulary(context, contact_ids, deputies_terms + ministries_terms + contacts_terms)
|
||||
|
||||
def __iter__(self):
|
||||
|
|
Reference in New Issue