insert commission presidents in the format requested by PFB

This commit is contained in:
Frédéric Péters 2011-05-06 15:09:05 +02:00
parent 3358841e9e
commit 5afda5c321
2 changed files with 10 additions and 7 deletions

View File

@ -517,9 +517,10 @@ class PresCom(RemoteObject):
''' '''
Class to handle a president of commission Class to handle a president of commission
''' '''
_attrs = ('id', 'firstname', 'name', 'title', 'classname', 'com_code', 'sexe') _attrs = ('id', 'firstname', 'name', 'title', 'classname', 'com_code', 'sexe', 'function')
_download_file = 'PresComs.xml' _download_file = 'PresComs.xml'
_node_name = 'SPresComSpeaker' _node_name = 'SPresComSpeaker'
classname = 'PresCom'
def get_name(self): def get_name(self):
return u'%s %s (%s)' % (self.name, self.firstname, self.com_code) return u'%s %s (%s)' % (self.name, self.firstname, self.com_code)
@ -527,16 +528,18 @@ class PresCom(RemoteObject):
def get_long_name(self, ctx): def get_long_name(self, ctx):
if get_mode(ctx) == 'PCF': if get_mode(ctx) == 'PCF':
if self.sexe == 'M': if self.sexe == 'M':
title = u'le président' function = u'le président'
else: else:
title = u'la présidente' function = u'la présidente'
return u'%s %s' % (self.title, title) return u'%s %s' % (self.title, function)
else: else:
if self.function:
return u'%s %s %s, %s' % (self.title, self.firstname, self.name, self.function)
if self.sexe == 'M': if self.sexe == 'M':
title = u'président' function = u'président'
else: else:
title = u'présidente' function = u'présidente'
return u'%s %s %s, %s' % (self.title, self.firstname, self.name, title) return u'%s %s %s, %s' % (self.title, self.firstname, self.name, function)
def insert_as_speaker(self, ctx, doc, cursor): def insert_as_speaker(self, ctx, doc, cursor):
# Add an annotation next to the document, with a reference to minister # Add an annotation next to the document, with a reference to minister

Binary file not shown.