assistants.admin¶
Add models to interface.
Module Contents¶
-
class
assistants.admin.AssistantAdmin¶ Bases:
django.contrib.admin.ModelAdminAbstract class that filter queryset and checks permissions.
-
get_queryset(self, request)¶ Filter queryset to only show assistants the user has access to.
- Parameters
request (WSGIRequest) – The get_queryset request.
- Returns
All the assistants a user has access to.
- Return type
QuerySet
-
has_view_or_change_permission(self, request, obj=None)¶ Restrict the user from viewing/changing assistants the user has access to.
- Parameters
request (WSGIRequest) – The has_view_or_change_permission request.
obj (Assistant) – The Assistant object.
- Returns
Whether this user can access this Assistant.
- Return type
QuerySet
-
has_add_permission(self, request)¶ Restrict the user from adding an Assistant if no permission was given.
- Parameters
request (WSGIRequest) – The has_add_permission request.
- Returns
Whether the user has add permissions or not.
- Return type
bool
-
has_delete_permission(self, request, obj=None)¶ Restrict the user from deleting this assistant if no permission was given.
- Parameters
request (WSGIRequest) – The has_delete_permission request.
obj (Assistant) – The Assistant.
- Returns
Whether the user has delete permissions or not.
- Return type
bool
-
formfield_for_foreignkey(self, db_field, request, **kwargs)¶ Filter the dropdown for choosing the course (based on the courses that the user can edit).
- Parameters
db_field (database field) – The database field of the dropdown.
request (WSGIRequest) – The formfield_for_foreignkey request.
- Returns
The Assistants the user is allowed to see.
- Return type
QuerySet
-
static
warnings(obj)¶ Add warnings to an assistant when there is no statement forwarder of the assistant in LL.
- Parameters
obj (Assistant) – The Assistant object.
- Returns
A warning message.
- Return type
str
-
static
has_error(obj)¶ Check whether or not the obj contains a broken statement forwarder.
- Parameters
obj (Assistant) – The Assistant object.
- Returns
Whether or not the Assistant has an error.
- Return type
bool
-
render_change_form(self, request, context, add=False, change=False, form_url='', obj=None)¶ Override the render_change_form to add a warning when a statement forwarder is broken.
- Parameters
request (WSGIRequest) – The render_change_form request.
context (str) – The context of the render_change_form context.
add (bool) – Add render_change_form parameter, default is false.
change (bool) – Change render_change_form parameter, default is false.
form_url (str) – The render_change_form url.
obj (Assistant) – The Assistant object.
- Returns
The form with possibly the warning message.
- Return type
-
-
class
assistants.admin.NewActivityCreatedAdmin¶ Bases:
assistants.admin.AssistantAdminAdd new activity to admin interface.
-
delete_queryset(self, request, queryset)¶ Override bulk delete function. Also deletes the LL Forwarders.
- Parameters
request (WSGIRequest) – The delete_queryset request.
queryset (QuerySet) – All New Activity Assistants.
-
-
class
assistants.admin.QuizCompletedFeedbackAdmin¶ Bases:
assistants.admin.AssistantAdminAdd feedback for quiz to admin interface.
-
delete_queryset(self, request, queryset)¶ Override bulk delete function. Also deletes the LL Forwarders.
- Parameters
request (WSGIRequest) – The delete_queryset request.
queryset (QuerySet) – All Quiz Completed Feedback Assistants.
-