Views

class app.enquiries.views.APIEnquiries(**kwargs)

The enquiry search json view.

pagination_class

alias of Pagination

serializer_class

alias of EnquiryDetailSerializer

class app.enquiries.views.DataHubAdviserSearch(**kwargs)

Endpoint for the Client Relationship Manager autocomplete field of app.enquiries.forms.EnquiryForm.

class app.enquiries.views.EnquiryCompanySearchView(**kwargs)

DataHub company search view

model

alias of Enquiry

class app.enquiries.views.EnquiryCreateView(**kwargs)

Creates new app.enquiries.models.Enquiry

class app.enquiries.views.EnquiryDeleteView(*args, **kwargs)

Delete app.enquiries.models.Enquiry view

model

alias of Enquiry

class app.enquiries.views.EnquiryDetailView(**kwargs)

app.enquiries.models.Enquiry detail view

model

alias of Enquiry

class app.enquiries.views.EnquiryEditView(**kwargs)

app.enquiries.models.Enquiry edit view

form_class

alias of EnquiryForm

model

alias of Enquiry

class app.enquiries.views.EnquiryFilter(data=None, queryset=None, *, request=None, prefix=None)

Enquiry search filters

filter_owner_id(queryset, name, value)

Handles the owner__id parameter which can either be an int or the string 'UNASSIGNED'. In the case of 'UNASSIGNED' to filter for enquirires where owner == None.

filter_received_gt(queryset, name, value)

Returns a django.db.models.query.QuerySet only with entities which have a date_received greater than value.

filter_received_lt(queryset, name, value)

Returns a django.db.models.query.QuerySet only with entities which have date_received less than value.

class app.enquiries.views.EnquiryListCSVRenderer

A custom CSV renderer showing only selected fields.

class app.enquiries.views.EnquiryListView(**kwargs)

The enquiry search view.

filterset_class

alias of EnquiryFilter

finalize_response(*args, **kwargs)

Handles the Content-Disposition header of a ?format=csv request

pagination_class

alias of PaginationWithPaginationMeta

property paginator

Disables pagination for ?format=csv requests

serializer_class

alias of EnquiryDetailSerializer

class app.enquiries.views.ImportEnquiriesView(**kwargs)

Handles import of enquiries with a CSV file

class app.enquiries.views.Pagination

Control API views pagination.

class app.enquiries.views.PaginationWithPaginationMeta

Adds additional metadata to the template context.

app.enquiries.views.truncate_response_data(response_data, block_size=4)

Truncates pagination links.

We don’t want to show a link for every page if there are lots of pages. This replaces page links which are less useful with an ... ellipsis.

Parameters:
  • response_data (dict) – Data supposed to be passed to rest_framework.response.Response.

  • block_size (int) – How many page links should be kept at each end of the truncated portion.

Returns:

The response data with updated 'pages' key

Return type:

dict