import uicfg.auto_form doc stable
authorPierre-Yves David <pierre-yves.david@logilab.fr>
Wed, 16 Dec 2009 14:19:01 +0100
branchstable
changeset 4256 bf6e0e75acfa
parent 4255 9d9400cb3f8c
child 4271 dfee17fa363f
child 4298 2ca56131079e
import uicfg.auto_form doc
doc/book/en/development/webstdlib/autoform.rst
--- a/doc/book/en/development/webstdlib/autoform.rst	Tue Jan 19 09:51:38 2010 +0100
+++ b/doc/book/en/development/webstdlib/autoform.rst	Wed Dec 16 14:19:01 2009 +0100
@@ -1,8 +1,25 @@
 The automatic entity form (:mod:`cubicweb.web.views.autoform`)
 ---------------------------------------------------------------
 
+Tags declaration
+~~~~~~~~~~~~~~~~~~~~
+
 It is possible to manage attributes/relations in the simple or multiple
-editing form thanks to the following *rtags*:
+editing form thanks of the methods bellow ::
+
+  uicfg.autoform_section.tag_subject_of(<relation>, tag)
+  uicfg.autoform_section.tag_object_of(<relation>, tag)
+  uicfg.autoform_field.tag_attribute(<attribut_def>, tag)
+
+Where ``<relation>`` is a three elements tuple ``(Subject Entity Type,
+relation_type, Object Entity Type)``. ``<attribut_def>`` is a two elements tuple
+``(Entity Type, Attribut Name)``. Wildcard ``*`` could be used in place of
+``Entity Type``
+
+Possible tags are detailled below
+
+Simple Tags
+~~~~~~~~~~~~~~~~~~~~
 
 * `primary`, indicates that an attribute or a relation has to be
   inserted **in the simple or multiple editing forms**. In the case of
@@ -29,3 +46,24 @@
 If necessary, it is possible to overwrite the method
 `relation_category(rtype, x='subject')` to dynamically compute
 a relation editing category.
+
+
+Advanced Tags
+~~~~~~~~~~~~~~~~~~~~
+
+Tag can also reference a custom Field crafted with the help of
+``cubicweb.web.formfields`` and ``cubicweb.web.formwidget``. In the example
+bellow, the field ``path`` of ``ExecData`` entities will be done with a standard
+file input dialogue ::
+
+  from cubicweb.web import uicfg, formfields, formwidgets
+
+  uicfg.autoform_field.tag_attribute(('Execdata', 'path'),
+      formfields.FileField(name='path', widget=formwidgets.FileInput()))
+
+
+
+
+
+
+