Forms
- class sphinx_hosting.forms.GlobalSearchForm(*args, **kwargs)[source]
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]
The form we use to create a new
sphinx_hosting.models.Project. The difference between this andsphinx_hosting.forms.ProjectUpdateFormis that the user can setsphinx_hosting.models.Project.machine_namehere, but can’t insphinx_hosting.forms.ProjectUpdateForm.machine_nameshould not change after the project is created.Form fields:
title: Project Name (CharField)description: Brief Description (CharField)machine_name: Machine Name (MachineNameField)latest_version: Latest version (ModelChoiceField)
- property media
Return all media required to render the widgets on this form.
- class sphinx_hosting.forms.ProjectUpdateForm(*args, **kwargs)[source]
The form we use to update an existing
sphinx_hosting.models.Project. The difference between this andProjectCreateFormis that the user cannot changesphinx_hosting.models.Project.machine_namehere, but can inProjectCreateForm.machine_nameshould 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]
The form we use to on the
sphinx_hosting.views.ProjectDetailViewto show the viewer the project title and description. The difference between this andProjectUpdateFormis 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: Project = None, **kwargs)[source]
The form on
sphinx_hosting.views.ProjectDetailViewthat 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]
A form field for our
sphinx_hosting.fields.MachineNameFieldthat applies the appropriate validators.The difference this field and
django.forms.SlugFieldis that this field will allow “-” characters in the value