web/views/autoform.py
branchstable
changeset 3332 91cff87c368f
parent 3316 c4c07aab1c39
child 3341 99c0b55892d6
--- a/web/views/autoform.py	Fri Sep 18 19:51:27 2009 +0200
+++ b/web/views/autoform.py	Fri Sep 18 19:51:45 2009 +0200
@@ -311,6 +311,14 @@
         """
         return not existant or card in '+*'
 
+    def should_hide_add_new_relation_link(self, rschema, card):
+        """return true if once an inlined creation form is added, the 'add new'
+        link should be hidden
+
+        by default true if the relation has single cardinality
+        """
+        return card in '1?'
+
 
 def etype_relation_field(etype, rtype, role='subject'):
     eschema = AutomaticEntityForm.schema.eschema(etype)