web/views/forms.py
branchstable
changeset 3689 deb13e88e037
parent 3517 8832e231fad7
child 3720 5376aaadd16b
child 3880 88fc53eb5b5f
--- a/web/views/forms.py	Thu Oct 15 18:43:04 2009 +0200
+++ b/web/views/forms.py	Thu Oct 15 20:29:21 2009 +0200
@@ -346,8 +346,8 @@
             for field in field.actual_fields(self):
                 fieldname = field.name
                 if fieldname != 'eid' and (
-                    (eschema.has_subject_relation(fieldname) or
-                     eschema.has_object_relation(fieldname))):
+                    (fieldname in eschema.subjrels or
+                     fieldname in eschema.objrels)):
                     field.eidparam = True
                     self.fields.append(HiddenInitialValueField(field))
         return super(EntityFieldsForm, self).build_context(values)
@@ -375,7 +375,7 @@
             return INTERNAL_FIELD_VALUE
         if attr == '__type':
             return entity.id
-        if self.schema.rschema(attr).is_final():
+        if self.schema.rschema(attr).final:
             attrtype = entity.e_schema.destination(attr)
             if attrtype == 'Password':
                 return entity.has_eid() and INTERNAL_FIELD_VALUE or ''
@@ -457,7 +457,7 @@
         if isinstance(rtype, basestring):
             rtype = entity.schema.rschema(rtype)
         done = None
-        assert not rtype.is_final(), rtype
+        assert not rtype.final, rtype
         if entity.has_eid():
             done = set(e.eid for e in getattr(entity, str(rtype)))
         result = []