Wiking branch, master, updated. cdf5af2f03553c2992c468e2cc8ec20bf1bb3f98
Tomas Cerha
cerha at devel.brailcom.org
Wed Oct 20 23:58:23 CEST 2010
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Wiking".
The branch, master has been updated
via cdf5af2f03553c2992c468e2cc8ec20bf1bb3f98 (commit)
from b21faddf03858e3da972c69d7302278e1e561733 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit cdf5af2f03553c2992c468e2cc8ec20bf1bb3f98
Author: Tomáš Cerha <cerha at kadell.(none)>
Date: Wed Oct 20 23:46:35 2010 +0200
Avoid running computer functions when only determining field type.
This change requires a recent version of pytis.
-----------------------------------------------------------------------
Summary of changes:
lib/wiking/cms/users.py | 2 +-
lib/wiking/db.py | 10 +++++-----
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/lib/wiking/cms/users.py b/lib/wiking/cms/users.py
index 31ef276..da7150e 100644
--- a/lib/wiking/cms/users.py
+++ b/lib/wiking/cms/users.py
@@ -770,7 +770,7 @@ class Users(UserManagementModule):
# This language is used for translation of email messages sent to the user. This way
# it is set only once during registration. It would make sense to change it on each
# change of user interface language by that user.
- record['lang'] = pd.Value(record['lang'].type(), req.prefered_language())
+ record['lang'] = pd.Value(record.type('lang'), req.prefered_language())
errors = []
if 'old_password' in layout.order():
#if not req.check_roles(Roles.USER_ADMIN): Too dangerous?
diff --git a/lib/wiking/db.py b/lib/wiking/db.py
index 5bb8dbc..9ea522c 100644
--- a/lib/wiking/db.py
+++ b/lib/wiking/db.py
@@ -283,7 +283,7 @@ class PytisModule(Module, ActionHandler):
# record at the same time, so we create a record here just to save the data types of all
# fields for future use.
record = pp.PresentedRow(fields, self._data, None, resolver=self._resolver)
- self._type = dict([(key, record[key].type()) for key in record.keys()])
+ self._type = dict([(key, record.type(key)) for key in record.keys()])
self._links = {}
def cb_link(field):
e = self._type[field.id()].enumerator()
@@ -346,7 +346,7 @@ class PytisModule(Module, ActionHandler):
f = self._view.field(id)
if not record.editable(id):
continue
- type = record[id].type()
+ type = record.type(id)
kwargs = {}
if req.has_param(id):
value = req.param(id)
@@ -400,7 +400,7 @@ class PytisModule(Module, ActionHandler):
else:
if record.new() and self._LIST_BY_LANGUAGE and record['lang'].value() is None:
lang = req.prefered_language(raise_error=False)
- record['lang'] = pd.Value(record['lang'].type(), lang)
+ record['lang'] = pd.Value(record.type('lang'), lang)
for check in self._view.check():
result = check(record)
if result:
@@ -1188,7 +1188,7 @@ class PytisModule(Module, ActionHandler):
counter = pd.DBCounterDefault(seq, self._dbconnection,
connection_name=self.Spec.connection)
value = counter.next(transaction=transaction)
- record[key] = pd.Value(record[key].type(), value)
+ record[key] = pd.Value(record.type(key), value)
new_row, success = self._data.insert(record.rowdata(), transaction=transaction)
#debug(":::", success, new_row and [(k, new_row[k].value()) for k in new_row.keys()])
if success and new_row is not None:
@@ -1389,7 +1389,7 @@ class PytisModule(Module, ActionHandler):
def action_export(self, req):
record = self._record(req, None)
- columns = [(cid, isinstance(record[cid].type(), pytis.data.Float)
+ columns = [(cid, isinstance(record.type(cid), pytis.data.Float)
and dict(locale_format=False) or {})
for cid in self._exported_columns(req)]
fw = self._binding_forward(req)
hooks/post-receive
--
Wiking
More information about the Wiking-cvs
mailing list