From ca7e7a4be6a9dac0679c12dd9f8efb9a193aec03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Tue, 17 Apr 2012 10:48:35 +0200 Subject: [PATCH] add more document fields to sync process --- themis/importexport/sync.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/themis/importexport/sync.py b/themis/importexport/sync.py index 0008af0..b6500d1 100644 --- a/themis/importexport/sync.py +++ b/themis/importexport/sync.py @@ -210,6 +210,13 @@ class SyncFromThemis(UtilityView): datetime.datetime.strptime( data.get(attr), '%Y-%m-%d').toordinal()) + if data.get('date_sanction_promulgation'): + object.sanction_date = datetime.date.fromordinal( + datetime.datetime.strptime( + data.get('date_sanction_promulgation'), '%Y-%m-%d').toordinal()) + else: + object.sanction_date = None + for attr in ('numero_biq', 'numero_document', 'numero_bqr'): if data.get(attr): object.no = data.get(attr) @@ -268,6 +275,16 @@ class SyncFromThemis(UtilityView): authors = [self.get_author_intid(x) for x in data.get('auteurs')] object.authors = [RelationValue(x) for x in authors if x] + if data.get('etat_en_commission'): + object.commission_status = data.get('etat_en_commission') + else: + object.commission_status = None + + if data.get('vote_seance'): + object.seance_vote = data.get('vote_seance') + else: + object.seance_vote = None + if data.get('portal_type') in ('PropositionD', 'ProjetD'): if data.get('vote_seance') == u'Adoption': object.adopted = True