fairdm.core.project.views#

Views for creating and listing projects.

Module Contents#

Classes#

ProjectListView

List the public projects as cards, with filtering and sorting.

ProjectCreateView

Create a project and list the creating user at the manage level.

API#

class ProjectListView(**kwargs)#

Bases: fairdm.views.FairDMListView

List the public projects as cards, with filtering and sorting.

Initialization

model#

None

filterset_class#

None

list_item_template#

‘project/project_card.html’

grid#

None

toolbar_filters#

[‘q’, ‘status’]

image#

‘static(…)’

show_list_action#

True

show_create_action(user)#

Offer the create link only to a signed-in user.

get_queryset() → django.db.models.QuerySet[fairdm.core.models.Project]#

Limit to public projects and load everything a card draws, in a constant number of queries.

class ProjectCreateView(**kwargs)#

Bases: django.contrib.auth.mixins.LoginRequiredMixin, fairdm.views.FairDMCreateView

Create a project and list the creating user at the manage level.

Initialization

model#

None

form_class#

None

page_title#

‘_(…)’

form_valid(form: fairdm.core.project.forms.ProjectCreateForm) → django.http.HttpResponse#

Record the creator and list them at the manage level as Creator, ProjectMember and ContactPerson.

get_success_url() → str#

Redirect to the new project’s own page.