web/views/cwproperties.py
changeset 6142 8bc6eac1fac1
parent 6141 b8287e54b528
child 6453 7fdd780d87e4
--- a/web/views/cwproperties.py	Wed Aug 25 10:29:07 2010 +0200
+++ b/web/views/cwproperties.py	Wed Aug 25 10:29:18 2010 +0200
@@ -200,8 +200,8 @@
         else:
             entity = self._cw.vreg['etypes'].etype_class('CWProperty')(self._cw)
             entity.eid = self._cw.varmaker.next()
-            entity['pkey'] = key
-            entity['value'] = self._cw.vreg.property_value(key)
+            entity.cw_attr_cache['pkey'] = key
+            entity.cw_attr_cache['value'] = self._cw.vreg.property_value(key)
         return entity
 
     def form(self, formid, keys, splitlabel=False):
@@ -329,7 +329,7 @@
 
     def form_init(self, form):
         entity = form.edited_entity
-        if not (entity.has_eid() or 'pkey' in entity):
+        if not (entity.has_eid() or 'pkey' in entity.cw_attr_cache):
             # no key set yet, just include an empty div which will be filled
             # on key selection
             return