support package#
Submodules#
support.admin module#
Generated by utils/cgit/cgit_util_generate_admin_file on 2022-01-24 14:41:34.741858
- class support.admin.AttachmentAdmin(model, admin_site)[source]#
Bases:
ModelAdmin
Admin class for model Attachment
- autocomplete_fields = ['user', 'incident']#
- property media#
- class support.admin.IncidentAdmin(model, admin_site)[source]#
Bases:
ModelAdmin
Admin class for model Incident
- autocomplete_fields = ['reported_by_user', 'assigned_to']#
- list_display = ('reported_by_user', 'reported_by_email', 'description')#
- property media#
- search_fields = ('reported_by_user', 'reported_by_email', 'description')#
support.apps module#
support.forms module#
- class support.forms.AttachmentForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, instance=None, use_required_attribute=None, renderer=None)[source]#
Bases:
ModelForm
- class Meta[source]#
Bases:
object
- fields = ('document', 'incident', 'description', 'user')#
- model#
alias of
Attachment
- base_fields = {'description': <django.forms.fields.CharField object>, 'document': <django.forms.fields.FileField object>, 'incident': <django.forms.models.ModelChoiceField object>, 'user': <django.forms.models.ModelChoiceField object>}#
- declared_fields = {}#
- property media#
Return all media required to render the widgets on this form.
- class support.forms.ContactForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None, bound_field_class=None)[source]#
Bases:
Form
Contact Support
- base_fields = {'email': <django.forms.fields.CharField object>, 'message': <django.forms.fields.CharField object>, 'title': <django.forms.fields.CharField object>, 'username': <django.forms.fields.CharField object>}#
- declared_fields = {'email': <django.forms.fields.CharField object>, 'message': <django.forms.fields.CharField object>, 'title': <django.forms.fields.CharField object>, 'username': <django.forms.fields.CharField object>}#
- property media#
Return all media required to render the widgets on this form.
- class support.forms.HelpdeskLoggedInContactForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, instance=None, use_required_attribute=None, renderer=None)[source]#
Bases:
ModelForm
Contact form for users who are logged in
- class Meta[source]#
Bases:
object
- fields = ('title', 'description', 'reported_by_user', 'incident_type')#
- base_fields = {'description': <django.forms.fields.CharField object>, 'incident_type': <django.forms.fields.TypedChoiceField object>, 'reported_by_user': <django.forms.models.ModelChoiceField object>, 'title': <django.forms.fields.CharField object>}#
- declared_fields = {}#
- property media#
Return all media required to render the widgets on this form.
- class support.forms.HelpdeskLoggedOutContactForm(*args, **kwargs)[source]#
Bases:
ModelForm
Contact form for users who are logged out
- class Meta[source]#
Bases:
object
- fields = ('reported_by_name', 'reported_by_email', 'title', 'incident_type', 'description')#
- labels = {'incident_type': 'Area', 'reported_by_email': 'Your email address', 'reported_by_name': 'Your name', 'title': 'Subject'}#
- base_fields = {'description': <django.forms.fields.CharField object>, 'incident_type': <django.forms.fields.TypedChoiceField object>, 'reported_by_email': <django.forms.fields.EmailField object>, 'reported_by_name': <django.forms.fields.CharField object>, 'title': <django.forms.fields.CharField object>}#
- declared_fields = {}#
- property media#
Return all media required to render the widgets on this form.
- class support.forms.IncidentForm(*args, **kwargs)[source]#
Bases:
ModelForm
Create a new helpdesk ticket
- class Meta[source]#
Bases:
object
- fields = ('title', 'assigned_to', 'reported_by_email', 'description', 'status', 'incident_type', 'reported_by_user', 'reported_by_name', 'severity')#
- base_fields = {'assigned_to': <django.forms.models.ModelChoiceField object>, 'description': <django.forms.fields.CharField object>, 'incident_type': <django.forms.fields.TypedChoiceField object>, 'reported_by_email': <django.forms.fields.EmailField object>, 'reported_by_name': <django.forms.fields.CharField object>, 'reported_by_user': <django.forms.models.ModelChoiceField object>, 'severity': <django.forms.fields.TypedChoiceField object>, 'status': <django.forms.fields.TypedChoiceField object>, 'title': <django.forms.fields.CharField object>}#
- declared_fields = {}#
- property media#
Return all media required to render the widgets on this form.
- class support.forms.IncidentLineItemForm(*args, **kwargs)[source]#
Bases:
ModelForm
- class Meta[source]#
Bases:
object
- fields = ('description',)#
- model#
alias of
IncidentLineItem
- base_fields = {'action': <django.forms.fields.ChoiceField object>, 'description': <django.forms.fields.CharField object>}#
- declared_fields = {'action': <django.forms.fields.ChoiceField object>, 'description': <django.forms.fields.CharField object>}#
- property media#
Return all media required to render the widgets on this form.
- class support.forms.NotifyUserByTypeForm(*args, **kwargs)[source]#
Bases:
ModelForm
- class Meta[source]#
Bases:
object
- fields = ('incident_type', 'staff')#
- model#
alias of
NotifyUserByType
- base_fields = {'incident_type': <django.forms.fields.TypedChoiceField object>, 'staff': <django.forms.models.ModelChoiceField object>}#
- declared_fields = {}#
- property media#
Return all media required to render the widgets on this form.
support.helpdesk module#
- support.helpdesk.close_old_tickets()[source]#
Called from cron via a management command to close any tickets over 30 days old with no activity
- support.helpdesk.create_ticket_api(title, description=None, reported_by_user: User = None, status='Unassigned', severity='Medium', incident_type='Other', assigned_to=None)[source]#
API for other parts of the system to raise a ticket
- support.helpdesk.get_support_statistics()[source]#
return basic stats about support. Called by utils statistics
- support.helpdesk.get_tickets(user)[source]#
get open tickets - called by the context_processors in cobalt
- support.helpdesk.notify_group_new_ticket(request, ticket)[source]#
Notify staff when a new ticket is raised
- support.helpdesk.notify_group_new_ticket_by_staff(staff_name, ticket, exclude=None)[source]#
Notify staff when a new ticket is raised by a staff member. Don’t notify the person who raised it
- support.helpdesk.notify_staff_mention(request, ticket, reply, first_name)[source]#
Notify a staff member when a comment has mentioned them
support.models module#
- class support.models.Attachment(*args, **kwargs)[source]#
Bases:
Model
screenshots etc
- exception DoesNotExist#
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned#
Bases:
MultipleObjectsReturned
- create_date#
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- description#
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- document#
The descriptor for the file attribute on the model instance. Return a FieldFile when accessed so you can write code like:
>>> from myapp.models import MyModel >>> instance = MyModel.objects.get(pk=1) >>> instance.file.size
Assign a file object on assignment so you can do:
>>> with open('/path/to/hello.world') as f: ... instance.file = File(f)
- get_next_by_create_date(*, field=<django.db.models.fields.DateTimeField: create_date>, is_next=True, **kwargs)#
- get_previous_by_create_date(*, field=<django.db.models.fields.DateTimeField: create_date>, is_next=False, **kwargs)#
- id#
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- incident#
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- incident_id#
- objects = <django.db.models.manager.Manager object>#
- user#
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- user_id#
- class support.models.Incident(*args, **kwargs)[source]#
Bases:
Model
Something that happened and needs to be tracked. Often reported by a user.
- exception DoesNotExist#
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned#
Bases:
MultipleObjectsReturned
- assigned_to#
Standard User object - who is working on it
- assigned_to_id#
- attachment_set#
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- closed_date#
date closed
- created_date#
date created
- description#
free format description
- get_incident_type_display(*, field=<django.db.models.fields.CharField: incident_type>)#
- get_next_by_created_date(*, field=<django.db.models.fields.DateTimeField: created_date>, is_next=True, **kwargs)#
- get_previous_by_created_date(*, field=<django.db.models.fields.DateTimeField: created_date>, is_next=False, **kwargs)#
- get_severity_display(*, field=<django.db.models.fields.CharField: severity>)#
- get_status_display(*, field=<django.db.models.fields.CharField: status>)#
- id#
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- incident_type#
type for this incident
- incidentlineitem_set#
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- objects = <django.db.models.manager.Manager object>#
- reported_by_email#
for use when we do not have a user object
- reported_by_name#
for use when we do not have a user object
- reported_by_user#
Standard User object - who reported it
- reported_by_user_id#
- save(*args, **kwargs)[source]#
Save the current instance. Override this in a subclass if you want to control the saving process.
The ‘force_insert’ and ‘force_update’ parameters can be used to insist that the “save” must be an SQL insert or update (or equivalent for non-SQL backends), respectively. Normally, they should not be set.
- severity#
severity of this case
- status#
status of this case
- title#
Short description
- class support.models.IncidentLineItem(*args, **kwargs)[source]#
Bases:
Model
a thing that happens to an Incident
- exception DoesNotExist#
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned#
Bases:
MultipleObjectsReturned
- comment_type#
Public or private comment
- created_date#
date created
- description#
free format description
- get_comment_type_display(*, field=<django.db.models.fields.CharField: comment_type>)#
- get_next_by_created_date(*, field=<django.db.models.fields.DateTimeField: created_date>, is_next=True, **kwargs)#
- get_previous_by_created_date(*, field=<django.db.models.fields.DateTimeField: created_date>, is_next=False, **kwargs)#
- id#
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- incident#
Parent incident
- incident_id#
- objects = <django.db.models.manager.Manager object>#
- save(*args, **kwargs)[source]#
Save the current instance. Override this in a subclass if you want to control the saving process.
The ‘force_insert’ and ‘force_update’ parameters can be used to insist that the “save” must be an SQL insert or update (or equivalent for non-SQL backends), respectively. Normally, they should not be set.
- staff#
Standard User object
- staff_id#
- class support.models.NotifyUserByType(*args, **kwargs)[source]#
Bases:
Model
Which users to tell about new tickets. We add an “All” option to the incident_type. Specifying all means the user will receive all notifications.
Note that this is for notifications only. In order to be a support staff member you need to be in the RBAC group “support.helpdesk.edit”
This allows people to be added to notifications without giving them access to the helpdesk module.
- exception DoesNotExist#
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned#
Bases:
MultipleObjectsReturned
- get_incident_type_display(*, field=<django.db.models.fields.CharField: incident_type>)#
- id#
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- incident_type#
type for this incident
- objects = <django.db.models.manager.Manager object>#
- staff#
Standard User object
- staff_id#