doc/book/en/development/webstdlib/autoform.rst
author Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
Wed, 09 Sep 2009 22:28:09 +0200
branchstable
changeset 3157 f4b94d03f86f
parent 2172 cf8f9180e63e
child 4256 bf6e0e75acfa
permissions -rw-r--r--
[editcontrollers] handle_attribute: test for value presence before trying to convert it to int/float

The automatic entity form (:mod:`cubicweb.web.views.autoform`)
---------------------------------------------------------------

It is possible to manage attributes/relations in the simple or multiple
editing form thanks to the following *rtags*:

* `primary`, indicates that an attribute or a relation has to be
  inserted **in the simple or multiple editing forms**. In the case of
  a relation, the related entity editing form will be included in the
  editing form and represented as a combobox. Each item of the
  combobox is a link to an existing entity.

* `secondary`, indicates that an attribute or a relation has to be
  inserted **in the simple editing form only**. In the case of a
  relation, the related entity editing form will be included in the
  editing form and represented as a combobox. Each item of the combobox
  is a link to an existing entity.

* `inlineview`, includes the target entity's form in the editing form
  of the current entity. It allows to create the target entity in the
  same time as the current entity.

* `generic`, indicates that a relation has to be inserted in the simple
  editing form, in the generic box of relation creation.

* `generated`, indicates that an attribute is dynamically computed
  or other,  and that it should not be displayed in the editing form.

If necessary, it is possible to overwrite the method
`relation_category(rtype, x='subject')` to dynamically compute
a relation editing category.