doc/book/en/devweb/edition/form.rst
branchstable
changeset 5464 c6c9a80ad1dd
parent 5418 4f0047cfecb5
child 5465 a838ac0ff890
equal deleted inserted replaced
5463:37a2455639b9 5464:c6c9a80ad1dd
    18 widgets to edit it, for instance :class:`cubicweb.web.formwidgets.TextInput` (a
    18 widgets to edit it, for instance :class:`cubicweb.web.formwidgets.TextInput` (a
    19 bare text field), :class:`~cubicweb.web.formwidgets.DateTimePicker` (a simple
    19 bare text field), :class:`~cubicweb.web.formwidgets.DateTimePicker` (a simple
    20 calendar) or even :class:`~cubicweb.web.formwidgets.JQueryDatePicker` (the JQuery
    20 calendar) or even :class:`~cubicweb.web.formwidgets.JQueryDatePicker` (the JQuery
    21 calendar).  You can of course also write your own widget.
    21 calendar).  You can of course also write your own widget.
    22 
    22 
       
    23 Exploring the available forms
       
    24 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       
    25 
       
    26 A small excursion into a |cubicweb| shell is the quickest way to
       
    27 discover available forms (or application objects in general).
       
    28 
       
    29 .. sourcecode:: python
       
    30 
       
    31  >>> from pprint import pprint
       
    32  >>> pprint( session.vreg['forms'] )
       
    33  {'base': [<class 'cubicweb.web.views.forms.FieldsForm'>,
       
    34            <class 'cubicweb.web.views.forms.EntityFieldsForm'>],
       
    35   'changestate': [<class 'cubicweb.web.views.workflow.ChangeStateForm'>,
       
    36                   <class 'cubes.tracker.views.forms.VersionChangeStateForm'>],
       
    37   'composite': [<class 'cubicweb.web.views.forms.CompositeForm'>,
       
    38                 <class 'cubicweb.web.views.forms.CompositeEntityForm'>],
       
    39   'deleteconf': [<class 'cubicweb.web.views.editforms.DeleteConfForm'>],
       
    40   'edition': [<class 'cubicweb.web.views.autoform.AutomaticEntityForm'>,
       
    41               <class 'cubicweb.web.views.workflow.TransitionEditionForm'>,
       
    42               <class 'cubicweb.web.views.workflow.StateEditionForm'>],
       
    43   'logform': [<class 'cubicweb.web.views.basetemplates.LogForm'>],
       
    44   'massmailing': [<class 'cubicweb.web.views.massmailing.MassMailingForm'>],
       
    45   'muledit': [<class 'cubicweb.web.views.editforms.TableEditForm'>],
       
    46   'sparql': [<class 'cubicweb.web.views.sparql.SparqlForm'>]}
       
    47 
       
    48 
       
    49 The two most important form families here (for all pracitcal purposes)
       
    50 are `base` and `edition`. Most of the time one wants alterations of
       
    51 the AutomaticEntityForm (from the `edition` category).
       
    52 
       
    53 The Automatic Entity Form
       
    54 ~~~~~~~~~~~~~~~~~~~~~~~~~
    23 
    55 
    24 .. automodule:: cubicweb.web.views.autoform
    56 .. automodule:: cubicweb.web.views.autoform
    25 
    57 
    26 Anatomy of a choices function
    58 Anatomy of a choices function
    27 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    59 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   180 unpublished versions defined in the project (sorted by number) for
   212 unpublished versions defined in the project (sorted by number) for
   181 which the current user is allowed to establish the relation. Of
   213 which the current user is allowed to establish the relation. Of
   182 course, we take care *not* to provide a version the ticket is already
   214 course, we take care *not* to provide a version the ticket is already
   183 linked to (through ``done_in``).
   215 linked to (through ``done_in``).
   184 
   216 
       
   217 
   185 APIs
   218 APIs
   186 ~~~~
   219 ~~~~
   187 
   220 
   188 .. automodule:: cubicweb.web.formfields
   221 .. automodule:: cubicweb.web.formfields
   189 .. automodule:: cubicweb.web.formwidgets
   222 .. automodule:: cubicweb.web.formwidgets