Forms¶
Model forms are provided for convenience and can be fed specific kwargs in order to ensure that users are not presented with choices that should not be permitted.
-
class
fiction_outlines.forms.
CharacterInstanceForm
(*args, **kwargs)[source]¶ Bases:
django.forms.models.ModelForm
Form for creating character instances
Takes an additional kwarg of
character
which should represent a Character instance.
-
class
fiction_outlines.forms.
LocationInstanceForm
(*args, **kwargs)[source]¶ Bases:
django.forms.models.ModelForm
Form for creating location instances.
Takes an additional kwarg of
location
which should represent an instance of Location.
-
class
fiction_outlines.forms.
CharacterForm
(*args, **kwargs)[source]¶ Bases:
django.forms.models.ModelForm
Form for Character model.
Takes an additional kwarg of
user
which should represent an instance ofAUTH_USER_MODEL
.
-
class
fiction_outlines.forms.
LocationForm
(*args, **kwargs)[source]¶ Bases:
django.forms.models.ModelForm
Form class for Locations
Takes an additional kwarg of
user
which should represent an instance ofAUTH_USER_MODEL
.
-
class
fiction_outlines.forms.
OutlineForm
(*args, **kwargs)[source]¶ Bases:
django.forms.models.ModelForm
Form class for Outline model
Takes an additional kwarg of
user
which should represent an instance ofAUTH_USER_MODEL
.
-
class
fiction_outlines.forms.
OutlineMoveNodeForm
(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=':', empty_permitted=False, instance=None, **kwargs)[source]¶ Bases:
treebeard.forms.MoveNodeForm
Subclass of base
treebeard
move node form allowing us to restrict target node options to within a single tree.It is recommended that you do not subclass or directly call this form, but instead use treebeard.forms.movenodeform_factory.
Example:
from treebeard.forms import movenodeform_factory from fiction_outlines import forms from fiction_outlines.views import ArcNodeMoveView class SomeFormOrModelView(ArcNodeMoveView): model = ArcElementNode # As an example form_class = movenodeform_factory(ArcElementNode, form=forms.OutlineMoveNodeForm, ...) ...