fairdm.core.project.forms#

Forms for creating and editing projects.

Module Contents#

Classes#

ProjectForm

Form for editing a project, and the base of ProjectCreateForm.

ProjectCreateForm

Form for creating a project, asking only for name, status and visibility.

API#

class ProjectForm(*args, request=None, **kwargs)#

Bases: fairdm.core.forms.ManagerOnlyFieldsMixin, fairdm.forms.ModelForm

Form for editing a project, and the base of ProjectCreateForm.

For a project that already exists, visibility and owner are offered only to someone who can manage it.

Args: *args: Positional arguments passed to ModelForm. request: The current request, which decides whether visibility and owner are offered. **kwargs: Keyword arguments passed to ModelForm.

Attributes: image: Optional cover image. name: The project’s name. status: The project’s stage, from concept to complete. visibility: Who can view the project. owner: The organization that owns the project.

Initialization

image#

‘ImageField(…)’

name#

‘CharField(…)’

status#

‘TypedChoiceField(…)’

visibility#

‘TypedChoiceField(…)’

owner#

‘OrganizationChoiceField(…)’

class Meta#
model#

None

fields#

[‘image’, ‘name’, ‘status’, ‘visibility’, ‘owner’]

manager_only_fields#

(‘visibility’, ‘owner’)

class ProjectCreateForm(*args, **kwargs)#

Bases: fairdm.core.project.forms.ProjectForm

Form for creating a project, asking only for name, status and visibility.

The other fields are available after creation on the update page.

Args: *args: Positional arguments passed to ProjectForm. **kwargs: Keyword arguments passed to ProjectForm.

Initialization

class Meta#

Bases: fairdm.core.project.forms.ProjectForm

fields#

[‘name’, ‘status’, ‘visibility’]