Forms
- class sphinx_hosting.forms.GlobalSearchForm(*args, **kwargs)[source]
This is the search form at the top of the sidebar, underneath the logo. It is a subclass of
haystack.forms.SearchForm
, and does a search of our haystack backend.Form fields:
q
: Search (CharField
)
- property media
Return all media required to render the widgets on this form.
- class sphinx_hosting.forms.ProjectCreateForm(*args, **kwargs)[source]
This is the form we use to create a new
sphinx_hosting.models.Project
. The difference between this andsphinx_hosting.forms.ProjectUpdateForm
is that the user can setsphinx_hosting.models.Project.machine_name
here, but can’t insphinx_hosting.forms.ProjectUpdateForm
.machine_name
should not change after the project is created.Form fields:
title
: Project Name (CharField
)description
: Brief Description (CharField
)machine_name
: Machine Name (MachineNameField
)
- property media
Return all media required to render the widgets on this form.
- class sphinx_hosting.forms.ProjectUpdateForm(*args, **kwargs)[source]
This is the form we use to update an existing
sphinx_hosting.models.Project
. The difference between this andProjectCreateForm
is that the user cannot changesphinx_hosting.models.Project.machine_name
here, but can inProjectCreateForm
.machine_name
should not change after the project is created.Form fields:
- property media
Return all media required to render the widgets on this form.
- class sphinx_hosting.forms.ProjectReadonlyUpdateForm(*args, **kwargs)[source]
This is the form we use to on the
sphinx_hosting.views.ProjectDetailView
to show the viewer the project title and description. The difference between this andProjectUpdateForm
is that all the fields are readonly, and there are no submit buttons. We’re doing it this way instead of just rendering a non-form widget so that we can ensure that the page looks the same.Form fields:
- property media
Return all media required to render the widgets on this form.
- class sphinx_hosting.forms.VersionUploadForm(*args, project: Optional[Project] = None, **kwargs)[source]
This is the form on
sphinx_hosting.views.ProjectDetailView
that allows the user to upload a new documentation set.- Keyword Arguments
project – the project to which this documentation set should be associated
Form fields:
file
: File (FileField
)
- property media
Return all media required to render the widgets on this form.
Fields
- class sphinx_hosting.form_fields.MachineNameField(*, allow_unicode=False, **kwargs)[source]
This is a form field for our
sphinx_hosting.fields.MachineNameField
that applies the appropriate validators.The difference this field and
django.forms.SlugField
is that this field will allow “-” characters in the value