summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ea490af)
raw | patch | inline | side by side (parent: ea490af)
author | stefan <stefan@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Thu, 19 Feb 2009 23:32:23 +0000 (23:32 +0000) | ||
committer | stefan <stefan@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Thu, 19 Feb 2009 23:32:23 +0000 (23:32 +0000) |
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/roundup/trunk@4148 57a73879-2fb5-44c3-a270-3262357dd7e2
roundup/cgi/templating.py | patch | blob | history |
index f32b1e0e2c6d43748c873d8c391533e1ee785a44..4fc6e5dd90dc7a4ea0694542acdc9c46e78324f0 100644 (file)
for klass, htmlklass in propclasses:
if not isinstance(prop, klass):
continue
- if form.has_key(item):
- if isinstance(prop, hyperdb.Multilink):
- value = lookupIds(self._db, prop,
- handleListCGIValue(form[item]), fail_ok=1)
- elif isinstance(prop, hyperdb.Link):
- value = form.getfirst(item).strip()
- if value:
- value = lookupIds(self._db, prop, [value],
- fail_ok=1)[0]
- else:
- value = None
- else:
- value = form.getfirst(item).strip() or None
+ if isinstance(prop, hyperdb.Multilink):
+ value = []
else:
- if isinstance(prop, hyperdb.Multilink):
- value = []
- else:
- value = None
+ value = None
return htmlklass(self._client, self._classname, None, prop, item,
value, self._anonymous)
else:
self._formname = name
+ # If no value is already present for this property, see if one
+ # is specified in the current form.
+ form = self._client.form
+ if not self._value and form.has_key(self._formname):
+ if isinstance(prop, hyperdb.Multilink):
+ value = lookupIds(self._db, prop,
+ handleListCGIValue(form[self._formname]),
+ fail_ok=1)
+ elif isinstance(prop, hyperdb.Link):
+ value = form.getfirst(self._formname).strip()
+ if value:
+ value = lookupIds(self._db, prop, [value],
+ fail_ok=1)[0]
+ else:
+ value = None
+ else:
+ value = form.getfirst(self._formname).strip() or None
+ self._value = value
+
HTMLInputMixin.__init__(self)
def __repr__(self):