
"mptt.forms"
************

Form components for working with trees.

class class mptt.forms.TreeNodeChoiceField(queryset, *args, **kwargs)

   A ModelChoiceField for tree nodes.

   label_from_instance(obj)

      Creates labels which represent the tree level of each node when
      generating option labels.

class class mptt.forms.TreeNodeMultipleChoiceField(queryset, *args, **kwargs)

   A ModelMultipleChoiceField for tree nodes.

class class mptt.forms.TreeNodePositionField(*args, **kwargs)

   A ChoiceField for specifying position relative to another node.

   DEFAULT_CHOICES = ((u'first-child', <django.utils.functional.__proxy__ object at 0x92378cc>), (u'last-child', <django.utils.functional.__proxy__ object at 0x92376ac>), (u'left', <django.utils.functional.__proxy__ object at 0x92379ac>), (u'right', <django.utils.functional.__proxy__ object at 0x92379ec>))

   FIRST_CHILD = u'first-child'

   LAST_CHILD = u'last-child'

   LEFT = u'left'

   RIGHT = u'right'

class class mptt.forms.MoveNodeForm(node, *args, **kwargs)

   A form which allows the user to move a given node from one location
   in its tree to another, with optional restriction of the nodes
   which are valid target nodes for the move.

   base_fields = {'target': <mptt.forms.TreeNodeChoiceField object at 0x9237a2c>, 'position': <mptt.forms.TreeNodePositionField object at 0x9237b4c>}

   media

   save()

      Attempts to move the node using the selected target and
      position.

      If an invalid move is attempted, the related error message will
      be added to the form's non-field errors and the error will be
      re-raised. Callers should attempt to catch "InvalidNode" to
      redisplay the form with the error, should it occur.
