[Mpuls-commits] r1288 - in wasko/branches/2.0: . waskaweb/model
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Fri Feb 5 18:08:19 CET 2010
Author: bh
Date: 2010-02-05 18:08:16 +0100 (Fri, 05 Feb 2010)
New Revision: 1288
Modified:
wasko/branches/2.0/ChangeLog
wasko/branches/2.0/waskaweb/model/case.py
Log:
* waskaweb/model/case.py (AliasDescription.__init__): Add
parameter and isntance variable in_session, which indicates
whether the attribute should be available in the SessionCase
object too.
(Case.aliases): Mark all aliases that should be available in the
SessionCase object.
Modified: wasko/branches/2.0/ChangeLog
===================================================================
--- wasko/branches/2.0/ChangeLog 2010-02-05 17:03:34 UTC (rev 1287)
+++ wasko/branches/2.0/ChangeLog 2010-02-05 17:08:16 UTC (rev 1288)
@@ -1,5 +1,14 @@
2010-02-05 Bernhard Herzog <bh at intevation.de>
+ * waskaweb/model/case.py (AliasDescription.__init__): Add
+ parameter and isntance variable in_session, which indicates
+ whether the attribute should be available in the SessionCase
+ object too.
+ (Case.aliases): Mark all aliases that should be available in the
+ SessionCase object.
+
+2010-02-05 Bernhard Herzog <bh at intevation.de>
+
* waskaweb/model/case.py (AliasDescription): New class to help
describe the case attriute aliases.
(Case.aliases): Convert into a list of AliasDescription instances.
Modified: wasko/branches/2.0/waskaweb/model/case.py
===================================================================
--- wasko/branches/2.0/waskaweb/model/case.py 2010-02-05 17:03:34 UTC (rev 1287)
+++ wasko/branches/2.0/waskaweb/model/case.py 2010-02-05 17:08:16 UTC (rev 1288)
@@ -631,13 +631,17 @@
converter -- A callable to convert a string representation to the
correct python value. Default None, which means no
conversion will be done.
+ in_session -- A boolean indicating whether this field should be
+ available on the SessionCase object too. Default False.
"""
- def __init__(self, name, formedname, default=None, converter=None):
+ def __init__(self, name, formedname, default=None, converter=None,
+ in_session=False):
self.name = name
self.formedname = formedname
self.default = default
self.converter = converter
+ self.in_session = in_session
def convert(self, value):
"""Convert value using self.convert.
@@ -653,18 +657,22 @@
# Definitions for some commonly used public instance attributes.
#
# This is a list of AliasDescription instances.
- aliases = [AliasDescription("knr", "fn", "", ensure_unicode),
- AliasDescription("last_name", "name", "", ensure_unicode),
- AliasDescription("first_name", "vorname", "", ensure_unicode),
+ aliases = [AliasDescription("knr", "fn", "", ensure_unicode,
+ in_session=True),
+ AliasDescription("last_name", "name", "", ensure_unicode,
+ in_session=True),
+ AliasDescription("first_name", "vorname", "", ensure_unicode,
+ in_session=True),
AliasDescription("street", "addresse_strasse", "",
ensure_unicode),
AliasDescription("streetnr", "addresse_strassenr", "",
ensure_unicode),
AliasDescription("plz", "addresse_plz", "", ensure_unicode),
AliasDescription("city", "addresse_ort", "", ensure_unicode),
- AliasDescription("first_meeting", "erstgespraech"),
- AliasDescription("cm_end", "datum_cm_ende"),
- AliasDescription("editor", "bearbeiter_id")]
+ AliasDescription("first_meeting", "erstgespraech",
+ in_session=True),
+ AliasDescription("cm_end", "datum_cm_ende", in_session=True),
+ AliasDescription("editor", "bearbeiter_id", in_session=False)]
alias_dict = dict((desc.name, desc) for desc in aliases)
More information about the Mpuls-commits
mailing list