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:

__init__(*args, **kwargs)[source]
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 and sphinx_hosting.forms.ProjectUpdateForm is that the user can set sphinx_hosting.models.Project.machine_name here, but can’t in sphinx_hosting.forms.ProjectUpdateForm. machine_name should not change after the project is created.

Form fields:

__init__(*args, **kwargs)[source]
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 and ProjectCreateForm is that the user cannot change sphinx_hosting.models.Project.machine_name here, but can in ProjectCreateForm. machine_name should not change after the project is created.

Form fields:

__init__(*args, **kwargs)[source]
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 and ProjectUpdateForm 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:

__init__(*args, **kwargs)[source]
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:

__init__(*args, project: Optional[Project] = None, **kwargs)[source]
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