organizations.views module

class organizations.views.OrganizationAutocompleteView(**kwargs)[source]

Bases: dal_select2.views.Select2QuerySetView

View to feed the Select2 widget.

Flags of the organizations are displayed in the selection list; the stylesheet flags/sprite-hq.css from app django-countries must be accessible on the page for the flag to be displayed properly; we include it centrally in static and put this in the page head:

<link rel="stylesheet" href="{% static 'flags/sprite-hq.css' %}">

The data-html attribute has to be set to True on all widgets, e.g.

organization = forms.ModelChoiceField(
    queryset=Organization.objects.all(),
    widget=autocomplete.ModelSelect2(
        url='/organizations/organization-autocomplete',
        attrs={'data-html': True}
    )
)
get_queryset()[source]

Filter the queryset with GET[‘q’].

get_result_label(item)[source]

Return the label of a result.

class organizations.views.OrganizationCreateView(**kwargs)[source]

Bases: scipost.mixins.PermissionsMixin, django.views.generic.edit.CreateView

Create a new Organization.

permission_required = 'scipost.can_manage_organizations'
form_class

alias of organizations.forms.OrganizationForm

template_name = 'organizations/organization_create.html'
success_url = '/organizations/'
class organizations.views.OrganizationUpdateView(**kwargs)[source]

Bases: scipost.mixins.PermissionsMixin, django.views.generic.edit.UpdateView

Update an Organization.

permission_required = 'scipost.can_manage_organizations'
model

alias of organizations.models.Organization

form_class

alias of organizations.forms.OrganizationForm

template_name = 'organizations/organization_update.html'
success_url = '/organizations/'
class organizations.views.OrganizationDeleteView(**kwargs)[source]

Bases: scipost.mixins.PermissionsMixin, django.views.generic.edit.DeleteView

Delete an Organization.

permission_required = 'scipost.can_manage_organizations'
model

alias of organizations.models.Organization

success_url = '/organizations/'
class organizations.views.OrganizationListView(**kwargs)[source]

Bases: scipost.mixins.PaginationMixin, django.views.generic.list.ListView

model

alias of organizations.models.Organization

paginate_by = 50
get_context_data(*args, **kwargs)[source]

Get the context for this view.

get_queryset()[source]

Return the list of items for this view.

The return value must be an iterable and may be an instance of QuerySet in which case QuerySet specific behavior will be enabled.

organizations.views.get_organization_detail(request)[source]
class organizations.views.OrganizationDetailView(**kwargs)[source]

Bases: django.views.generic.detail.DetailView

model

alias of organizations.models.Organization

get_context_data(*args, **kwargs)[source]

Insert the single object into the context dict.

get_queryset()[source]

Restrict view to permitted people if Organization details not publicly viewable.

class organizations.views.OrganizationEventCreateView(**kwargs)[source]

Bases: scipost.mixins.PermissionsMixin, django.views.generic.edit.CreateView

permission_required = 'scipost.can_manage_organizations'
model

alias of organizations.models.OrganizationEvent

form_class

alias of organizations.forms.OrganizationEventForm

template_name = 'organizations/organizationevent_form.html'
get_initial()[source]

Return the initial data to use for forms on this view.

get_success_url()[source]

Return the URL to redirect to after processing a valid form.

class organizations.views.OrganizationEventListView(**kwargs)[source]

Bases: scipost.mixins.PermissionsMixin, scipost.mixins.PaginationMixin, django.views.generic.list.ListView

permission_required = 'scipost.can_manage_organizations'
model

alias of organizations.models.OrganizationEvent

paginate_by = 10
class organizations.views.ContactPersonCreateView(**kwargs)[source]

Bases: scipost.mixins.PermissionsMixin, django.views.generic.edit.CreateView

permission_required = 'scipost.can_add_contactperson'
model

alias of organizations.models.ContactPerson

form_class

alias of organizations.forms.ContactPersonForm

template_name = 'organizations/contactperson_form.html'
get_initial()[source]

Return the initial data to use for forms on this view.

form_valid(form)[source]

If the form is valid, save the associated model.

get_success_url()[source]

Return the URL to redirect to after processing a valid form.

class organizations.views.ContactPersonUpdateView(**kwargs)[source]

Bases: scipost.mixins.PermissionsMixin, django.views.generic.edit.UpdateView

permission_required = 'scipost.can_add_contactperson'
model

alias of organizations.models.ContactPerson

form_class

alias of organizations.forms.ContactPersonForm

template_name = 'organizations/contactperson_form.html'
form_valid(form)[source]

If the form is valid, save the associated model.

get_success_url()[source]

Return the URL to redirect to after processing a valid form.

class organizations.views.ContactPersonDeleteView(**kwargs)[source]

Bases: django.contrib.auth.mixins.UserPassesTestMixin, django.views.generic.edit.DeleteView

model

alias of organizations.models.ContactPerson

test_func()[source]

Allow ContactPerson delete to OrgAdmins and all Contacts for this Organization.

get_success_url()[source]
class organizations.views.ContactPersonListView(**kwargs)[source]

Bases: scipost.mixins.PermissionsMixin, django.views.generic.list.ListView

permission_required = 'scipost.can_add_contactperson'
model

alias of organizations.models.ContactPerson

organizations.views.email_contactperson(request, contactperson_id, mail=None)[source]
organizations.views.organization_add_contact(request, organization_id, contactperson_id=None)[source]
organizations.views.activate_account(request, activation_key)[source]
organizations.views.dashboard(request)[source]

Administration page for Organization Contacts.

This page is meant as a personal page for Contacts, where they will for example be able to read their personal data and agreements.

class organizations.views.ContactDetailView(**kwargs)[source]

Bases: scipost.mixins.PermissionsMixin, django.views.generic.detail.DetailView

View details of a Contact. Accessible to Admin.

permission_required = 'scipost.can_manage_organizations'
model

alias of organizations.models.Contact

class organizations.views.ContactRoleUpdateView(**kwargs)[source]

Bases: django.contrib.auth.mixins.UserPassesTestMixin, django.views.generic.edit.UpdateView

Update a ContactRole.

model

alias of organizations.models.ContactRole

form_class

alias of organizations.forms.ContactRoleForm

template_name = 'organizations/contactrole_form.html'
test_func()[source]

Allow ContactRole update to OrgAdmins and all Contacts for this Organization.

get_success_url()[source]

Return the URL to redirect to after processing a valid form.

class organizations.views.ContactRoleDeleteView(**kwargs)[source]

Bases: scipost.mixins.PermissionsMixin, django.views.generic.edit.DeleteView

Delete a ContactRole.

permission_required = 'scipost.can_manage_organizations'
model

alias of organizations.models.ContactRole

get_success_url()[source]
organizations.views.email_contactrole(request, contactrole_id, mail=None)[source]