The examiner simplified API. This API is a simplified wrapper of devilry.apps.core.models — Devilry core datastructure for examiners. Every action requires the given user to be examiner on the object being manipulated.
Bases: devilry.apps.examiner.simplified.PublishedWhereIsExaminerMixin
Simplified wrapper for devilry.apps.core.models.Subject.
Bases: devilry.coreutils.simplified.metabases.subject.SimplifiedSubjectMetaMixin
Defines what methods an Examiner can use on a Subject object using the Simplified API
alias of Subject
Returns all objects of this type that matches arguments given in \*\*kwargs where user is an examiner.
Parameters: |
|
---|---|
Return type: | a django queryset |
Create many.
This does the same as calling create() many times, except that it does it all in a single transaction. This means that the database rolls back the changes unless they all succeed.
Param : | list_of_field_values List of field_values dicts (see create()). |
---|---|
Returns: | List of the primary keys of the created objects. |
Delete many.
This does the same as calling delete() many times, except that it does it all in a single transaction. This means that the database rolls back the changes unless they all succeed.
Param : | list_of_pks List of primary-keys/ids of the objects to delete. |
---|---|
Returns: | List of the primary keys of the deleted objects. |
Can be overridden to change fieldgroups before they are sent into the QryResultWrapper. For example, if certain fieldgroups contain senstive data for anonymous assignments, we can add those fieldgroups if a filter for a specific assignment is provided in filters and that assignment is not anonymous.
Returns: | (result_fieldgroups, search_fieldgroups) |
---|
Check if the given obj is empty. Defaults to returning False.
Can be implemented in subclasses to enable superadmins to recursively delete() the obj.
Invoked after the obj has been saved.
Override this to set custom/generated values on obj after it has been validated and saved. The default does nothing.
Invoked after the user has been authorize by write_authorize() and before obj.full_clean() in create() and update().
Override this to set custom/generated values on obj before it is validated and saved. The default does nothing.
Read the requested item and return a dict with the fields specified in Meta.resultfields and additional fields specified in result_fieldgroups.
Parameters: |
|
---|---|
Throws PermissionDenied: | |
If the given user does not have permission to view this object, or if the object does not exist. |
Checks if the given user is an examiner for the given obj, and raises PermissionDenied if not.
Parameters: |
|
---|---|
Throws PermissionDenied: | |
Search for objects.
Parameters: |
|
---|---|
Returns: | The result of the search. |
Return type: | QryResultWrapper |
Update many.
This does the same as calling update() many times, except that it does it all in a single transaction. This means that the database rolls back the changes unless they all succeed.
Param : | list_of_field_values List of field_values dicts (see update()). Each dict _must_ have a _pk_ key that maps to the primary-key/id value. |
---|---|
Returns: | List of the primary keys of the updated objects. |
Check if the given user has write (update/create) permission on the given obj.
Defaults to raising :exc:NotImplementedError
Raises PermissionDenied: | |
---|---|
If the given user do not have write permission on the given obj. |
Bases: devilry.apps.examiner.simplified.PublishedWhereIsExaminerMixin
Simplified wrapper for devilry.apps.core.models.Period.
Bases: devilry.coreutils.simplified.metabases.period.SimplifiedPeriodMetaMixin
Defines what methods an Examiner can use on a Period object using the Simplified API
alias of Period
Returns all objects of this type that matches arguments given in \*\*kwargs where user is an examiner.
Parameters: |
|
---|---|
Return type: | a django queryset |
Create many.
This does the same as calling create() many times, except that it does it all in a single transaction. This means that the database rolls back the changes unless they all succeed.
Param : | list_of_field_values List of field_values dicts (see create()). |
---|---|
Returns: | List of the primary keys of the created objects. |
Delete many.
This does the same as calling delete() many times, except that it does it all in a single transaction. This means that the database rolls back the changes unless they all succeed.
Param : | list_of_pks List of primary-keys/ids of the objects to delete. |
---|---|
Returns: | List of the primary keys of the deleted objects. |
Can be overridden to change fieldgroups before they are sent into the QryResultWrapper. For example, if certain fieldgroups contain senstive data for anonymous assignments, we can add those fieldgroups if a filter for a specific assignment is provided in filters and that assignment is not anonymous.
Returns: | (result_fieldgroups, search_fieldgroups) |
---|
Check if the given obj is empty. Defaults to returning False.
Can be implemented in subclasses to enable superadmins to recursively delete() the obj.
Invoked after the obj has been saved.
Override this to set custom/generated values on obj after it has been validated and saved. The default does nothing.
Invoked after the user has been authorize by write_authorize() and before obj.full_clean() in create() and update().
Override this to set custom/generated values on obj before it is validated and saved. The default does nothing.
Read the requested item and return a dict with the fields specified in Meta.resultfields and additional fields specified in result_fieldgroups.
Parameters: |
|
---|---|
Throws PermissionDenied: | |
If the given user does not have permission to view this object, or if the object does not exist. |
Checks if the given user is an examiner for the given obj, and raises PermissionDenied if not.
Parameters: |
|
---|---|
Throws PermissionDenied: | |
Search for objects.
Parameters: |
|
---|---|
Returns: | The result of the search. |
Return type: | QryResultWrapper |
Update many.
This does the same as calling update() many times, except that it does it all in a single transaction. This means that the database rolls back the changes unless they all succeed.
Param : | list_of_field_values List of field_values dicts (see update()). Each dict _must_ have a _pk_ key that maps to the primary-key/id value. |
---|---|
Returns: | List of the primary keys of the updated objects. |
Check if the given user has write (update/create) permission on the given obj.
Defaults to raising :exc:NotImplementedError
Raises PermissionDenied: | |
---|---|
If the given user do not have write permission on the given obj. |
Bases: devilry.apps.examiner.simplified.PublishedWhereIsExaminerMixin
Simplified wrapper for devilry.apps.core.models.Assignment.
Bases: devilry.coreutils.simplified.metabases.assignment.SimplifiedAssignmentMetaMixin
Defines what methods an Examiner can use on an Assignment object using the Simplified API
alias of Assignment
Returns all Assignment objects that matches the arguments given in \*\*kwargs where user is an examiner.
Parameters: |
|
---|---|
Return type: | a django queryset |
Create many.
This does the same as calling create() many times, except that it does it all in a single transaction. This means that the database rolls back the changes unless they all succeed.
Param : | list_of_field_values List of field_values dicts (see create()). |
---|---|
Returns: | List of the primary keys of the created objects. |
Delete many.
This does the same as calling delete() many times, except that it does it all in a single transaction. This means that the database rolls back the changes unless they all succeed.
Param : | list_of_pks List of primary-keys/ids of the objects to delete. |
---|---|
Returns: | List of the primary keys of the deleted objects. |
Can be overridden to change fieldgroups before they are sent into the QryResultWrapper. For example, if certain fieldgroups contain senstive data for anonymous assignments, we can add those fieldgroups if a filter for a specific assignment is provided in filters and that assignment is not anonymous.
Returns: | (result_fieldgroups, search_fieldgroups) |
---|
Check if the given obj is empty. Defaults to returning False.
Can be implemented in subclasses to enable superadmins to recursively delete() the obj.
Invoked after the obj has been saved.
Override this to set custom/generated values on obj after it has been validated and saved. The default does nothing.
Invoked after the user has been authorize by write_authorize() and before obj.full_clean() in create() and update().
Override this to set custom/generated values on obj before it is validated and saved. The default does nothing.
Read the requested item and return a dict with the fields specified in Meta.resultfields and additional fields specified in result_fieldgroups.
Parameters: |
|
---|---|
Throws PermissionDenied: | |
If the given user does not have permission to view this object, or if the object does not exist. |
Checks if the given user is an examiner for the given obj, and raises PermissionDenied if not.
Parameters: |
|
---|---|
Throws PermissionDenied: | |
Search for objects.
Parameters: |
|
---|---|
Returns: | The result of the search. |
Return type: | QryResultWrapper |
Update many.
This does the same as calling update() many times, except that it does it all in a single transaction. This means that the database rolls back the changes unless they all succeed.
Param : | list_of_field_values List of field_values dicts (see update()). Each dict _must_ have a _pk_ key that maps to the primary-key/id value. |
---|---|
Returns: | List of the primary keys of the updated objects. |
Check if the given user has write (update/create) permission on the given obj.
Defaults to raising :exc:NotImplementedError
Raises PermissionDenied: | |
---|---|
If the given user do not have write permission on the given obj. |
Bases: devilry.apps.examiner.simplified.PublishedWhereIsExaminerMixin
Simplified wrapper for devilry.apps.core.models.AssignmentGroup.
Bases: devilry.coreutils.simplified.metabases.assignment_group.SimplifiedAssignmentGroupMetaMixin
Defines what methods an Examiner can use on an AssignmentGroup object using the Simplified API
alias of AssignmentGroup
Returns all AssignmentGroup-objects where given user is examiners.
Parameters: | user – A django user object. |
---|---|
Return type: | a django queryset |
Checks if the given user is an examiner in the given StaticFeedback obj, and raises PermissionDenied if not.
Parameters: |
|
---|---|
Throws PermissionDenied: | |
Create many.
This does the same as calling create() many times, except that it does it all in a single transaction. This means that the database rolls back the changes unless they all succeed.
Param : | list_of_field_values List of field_values dicts (see create()). |
---|---|
Returns: | List of the primary keys of the created objects. |
Delete many.
This does the same as calling delete() many times, except that it does it all in a single transaction. This means that the database rolls back the changes unless they all succeed.
Param : | list_of_pks List of primary-keys/ids of the objects to delete. |
---|---|
Returns: | List of the primary keys of the deleted objects. |
Can be overridden to change fieldgroups before they are sent into the QryResultWrapper. For example, if certain fieldgroups contain senstive data for anonymous assignments, we can add those fieldgroups if a filter for a specific assignment is provided in filters and that assignment is not anonymous.
Returns: | (result_fieldgroups, search_fieldgroups) |
---|
Check if the given obj is empty. Defaults to returning False.
Can be implemented in subclasses to enable superadmins to recursively delete() the obj.
Invoked after the obj has been saved.
Override this to set custom/generated values on obj after it has been validated and saved. The default does nothing.
Invoked after the user has been authorize by write_authorize() and before obj.full_clean() in create() and update().
Override this to set custom/generated values on obj before it is validated and saved. The default does nothing.
Read the requested item and return a dict with the fields specified in Meta.resultfields and additional fields specified in result_fieldgroups.
Parameters: |
|
---|---|
Throws PermissionDenied: | |
If the given user does not have permission to view this object, or if the object does not exist. |
Checks if the given user is an examiner for the given obj, and raises PermissionDenied if not.
Parameters: |
|
---|---|
Throws PermissionDenied: | |
Search for objects.
Parameters: |
|
---|---|
Returns: | The result of the search. |
Return type: | QryResultWrapper |
Update the given object.
Parameters: |
|
---|---|
Param : | field_values: The values to set on the given object. |
Returns: | The primary key of the updated object. |
Throws PermissionDenied: | |
If the given user does not have permission to edit this object, if the object does not exist, or if any of the field_values is not in cls._meta.editablefields. |
Update many.
This does the same as calling update() many times, except that it does it all in a single transaction. This means that the database rolls back the changes unless they all succeed.
Param : | list_of_field_values List of field_values dicts (see update()). Each dict _must_ have a _pk_ key that maps to the primary-key/id value. |
---|---|
Returns: | List of the primary keys of the updated objects. |
Bases: devilry.apps.examiner.simplified.PublishedWhereIsExaminerMixin
Simplified wrapper for devilry.apps.core.models.Deadline.
Bases: devilry.coreutils.simplified.metabases.deadline.SimplifiedDeadlineMetaMixin
Defines what methods an Examiner can use on a Deadline object using the Simplified API
alias of Deadline
Checks if the given user is an examiner in the given Deadline obj, and raises PermissionDenied if not.
Parameters: |
|
---|---|
Throws PermissionDenied: | |
Create the given object.
Parameters: | user – Django user object. |
---|---|
Field_values : | The values to set on the given object. |
Returns: | The primary key of the newly created object. |
Throws PermissionDenied: | |
If the given user does not have permission to edit this object, if the object does not exist, or if any of the field_values is not in cls._meta.editablefields. |
Create many.
This does the same as calling create() many times, except that it does it all in a single transaction. This means that the database rolls back the changes unless they all succeed.
Param : | list_of_field_values List of field_values dicts (see create()). |
---|---|
Returns: | List of the primary keys of the created objects. |
Delete the given object. If the object is_empty() it can be deleted by any user with write_authorize(), if not then only a Superuser may delete the object
Parameters: |
|
---|---|
Returns: | The primary key of the deleted object. |
Throws PermissionDenied: | |
If the given user does not have permission to delete this object, if the object does not exist, or if the user does not have permission to recursively delete this objects and all its children. |
Delete many.
This does the same as calling delete() many times, except that it does it all in a single transaction. This means that the database rolls back the changes unless they all succeed.
Param : | list_of_pks List of primary-keys/ids of the objects to delete. |
---|---|
Returns: | List of the primary keys of the deleted objects. |
Can be overridden to change fieldgroups before they are sent into the QryResultWrapper. For example, if certain fieldgroups contain senstive data for anonymous assignments, we can add those fieldgroups if a filter for a specific assignment is provided in filters and that assignment is not anonymous.
Returns: | (result_fieldgroups, search_fieldgroups) |
---|
Invoked after the obj has been saved.
Override this to set custom/generated values on obj after it has been validated and saved. The default does nothing.
Invoked after the user has been authorize by write_authorize() and before obj.full_clean() in create() and update().
Override this to set custom/generated values on obj before it is validated and saved. The default does nothing.
Read the requested item and return a dict with the fields specified in Meta.resultfields and additional fields specified in result_fieldgroups.
Parameters: |
|
---|---|
Throws PermissionDenied: | |
If the given user does not have permission to view this object, or if the object does not exist. |
Checks if the given user is an examiner for the given obj, and raises PermissionDenied if not.
Parameters: |
|
---|---|
Throws PermissionDenied: | |
Search for objects.
Parameters: |
|
---|---|
Returns: | The result of the search. |
Return type: | QryResultWrapper |
Update the given object.
Parameters: |
|
---|---|
Param : | field_values: The values to set on the given object. |
Returns: | The primary key of the updated object. |
Throws PermissionDenied: | |
If the given user does not have permission to edit this object, if the object does not exist, or if any of the field_values is not in cls._meta.editablefields. |
Update many.
This does the same as calling update() many times, except that it does it all in a single transaction. This means that the database rolls back the changes unless they all succeed.
Param : | list_of_field_values List of field_values dicts (see update()). Each dict _must_ have a _pk_ key that maps to the primary-key/id value. |
---|---|
Returns: | List of the primary keys of the updated objects. |
Bases: devilry.apps.examiner.simplified.PublishedWhereIsExaminerMixin
Simplified wrapper for devilry.apps.core.models.Delivery.
Bases: devilry.coreutils.simplified.metabases.delivery.SimplifiedDeliveryMetaMixin
Defines what methods an Examiner can use on a Delivery object using the Simplified API
alias of Delivery
Used by this class and the corresponding class in apps.administrator.simplified.
Check if the given user can save changes to the given obj, and raise PermissionDenied if not.
Parameters: |
|
---|---|
Throws PermissionDenied: | |
Create the given object.
Parameters: | user – Django user object. |
---|---|
Field_values : | The values to set on the given object. |
Returns: | The primary key of the newly created object. |
Throws PermissionDenied: | |
If the given user does not have permission to edit this object, if the object does not exist, or if any of the field_values is not in cls._meta.editablefields. |
Returns all objects of this type that matches arguments given in \*\*kwargs where user is an examiner.
Parameters: |
|
---|---|
Return type: | a django queryset |
Create many.
This does the same as calling create() many times, except that it does it all in a single transaction. This means that the database rolls back the changes unless they all succeed.
Param : | list_of_field_values List of field_values dicts (see create()). |
---|---|
Returns: | List of the primary keys of the created objects. |
Delete the given object. If the object is_empty() it can be deleted by any user with write_authorize(), if not then only a Superuser may delete the object
Parameters: |
|
---|---|
Returns: | The primary key of the deleted object. |
Throws PermissionDenied: | |
If the given user does not have permission to delete this object, if the object does not exist, or if the user does not have permission to recursively delete this objects and all its children. |
Delete many.
This does the same as calling delete() many times, except that it does it all in a single transaction. This means that the database rolls back the changes unless they all succeed.
Param : | list_of_pks List of primary-keys/ids of the objects to delete. |
---|---|
Returns: | List of the primary keys of the deleted objects. |
Can be overridden to change fieldgroups before they are sent into the QryResultWrapper. For example, if certain fieldgroups contain senstive data for anonymous assignments, we can add those fieldgroups if a filter for a specific assignment is provided in filters and that assignment is not anonymous.
Returns: | (result_fieldgroups, search_fieldgroups) |
---|
Check if the given obj is empty. Defaults to returning False.
Can be implemented in subclasses to enable superadmins to recursively delete() the obj.
Invoked after the obj has been saved.
Override this to set custom/generated values on obj after it has been validated and saved. The default does nothing.
Read the requested item and return a dict with the fields specified in Meta.resultfields and additional fields specified in result_fieldgroups.
Parameters: |
|
---|---|
Throws PermissionDenied: | |
If the given user does not have permission to view this object, or if the object does not exist. |
Checks if the given user is an examiner for the given obj, and raises PermissionDenied if not.
Parameters: |
|
---|---|
Throws PermissionDenied: | |
Search for objects.
Parameters: |
|
---|---|
Returns: | The result of the search. |
Return type: | QryResultWrapper |
Update the given object.
Parameters: |
|
---|---|
Param : | field_values: The values to set on the given object. |
Returns: | The primary key of the updated object. |
Throws PermissionDenied: | |
If the given user does not have permission to edit this object, if the object does not exist, or if any of the field_values is not in cls._meta.editablefields. |
Update many.
This does the same as calling update() many times, except that it does it all in a single transaction. This means that the database rolls back the changes unless they all succeed.
Param : | list_of_field_values List of field_values dicts (see update()). Each dict _must_ have a _pk_ key that maps to the primary-key/id value. |
---|---|
Returns: | List of the primary keys of the updated objects. |
Bases: devilry.apps.examiner.simplified.PublishedWhereIsExaminerMixin
Simplified wrapper for devilry.apps.core.models.StaticFeedback.
Bases: devilry.coreutils.simplified.metabases.staticfeedback.SimplifiedStaticFeedbackMetaMixin
Defines what methods an Examiner can use on a StaticFeedback object using the Simplified API. Also adds to the resultfields returned by search
alias of StaticFeedback
Checks if the given user is an examiner in the given StaticFeedback obj, and raises PermissionDenied if not.
Parameters: |
|
---|---|
Throws PermissionDenied: | |
Create the given object.
Parameters: | user – Django user object. |
---|---|
Field_values : | The values to set on the given object. |
Returns: | The primary key of the newly created object. |
Throws PermissionDenied: | |
If the given user does not have permission to edit this object, if the object does not exist, or if any of the field_values is not in cls._meta.editablefields. |
Returns all objects of this type that matches arguments given in \*\*kwargs where user is an examiner.
Parameters: |
|
---|---|
Return type: | a django queryset |
Create many.
This does the same as calling create() many times, except that it does it all in a single transaction. This means that the database rolls back the changes unless they all succeed.
Param : | list_of_field_values List of field_values dicts (see create()). |
---|---|
Returns: | List of the primary keys of the created objects. |
Delete many.
This does the same as calling delete() many times, except that it does it all in a single transaction. This means that the database rolls back the changes unless they all succeed.
Param : | list_of_pks List of primary-keys/ids of the objects to delete. |
---|---|
Returns: | List of the primary keys of the deleted objects. |
Can be overridden to change fieldgroups before they are sent into the QryResultWrapper. For example, if certain fieldgroups contain senstive data for anonymous assignments, we can add those fieldgroups if a filter for a specific assignment is provided in filters and that assignment is not anonymous.
Returns: | (result_fieldgroups, search_fieldgroups) |
---|
Check if the given obj is empty. Defaults to returning False.
Can be implemented in subclasses to enable superadmins to recursively delete() the obj.
Invoked after the obj has been saved.
Override this to set custom/generated values on obj after it has been validated and saved. The default does nothing.
Read the requested item and return a dict with the fields specified in Meta.resultfields and additional fields specified in result_fieldgroups.
Parameters: |
|
---|---|
Throws PermissionDenied: | |
If the given user does not have permission to view this object, or if the object does not exist. |
Checks if the given user is an examiner for the given obj, and raises PermissionDenied if not.
Parameters: |
|
---|---|
Throws PermissionDenied: | |
Search for objects.
Parameters: |
|
---|---|
Returns: | The result of the search. |
Return type: | QryResultWrapper |
Update many.
This does the same as calling update() many times, except that it does it all in a single transaction. This means that the database rolls back the changes unless they all succeed.
Param : | list_of_field_values List of field_values dicts (see update()). Each dict _must_ have a _pk_ key that maps to the primary-key/id value. |
---|---|
Returns: | List of the primary keys of the updated objects. |
Bases: devilry.apps.examiner.simplified.PublishedWhereIsExaminerMixin
Simplified wrapper for devilry.apps.core.models.FileMeta.
Bases: devilry.coreutils.simplified.metabases.filemeta.SimplifiedFileMetaMetaMixin
Defines what methods an Examiner can use on a FileMeta object using the Simplified API
alias of FileMeta
Returns all objects of this type that matches arguments given in \*\*kwargs where user is an examiner.
Parameters: |
|
---|---|
Return type: | a django queryset |
Create many.
This does the same as calling create() many times, except that it does it all in a single transaction. This means that the database rolls back the changes unless they all succeed.
Param : | list_of_field_values List of field_values dicts (see create()). |
---|---|
Returns: | List of the primary keys of the created objects. |
Delete many.
This does the same as calling delete() many times, except that it does it all in a single transaction. This means that the database rolls back the changes unless they all succeed.
Param : | list_of_pks List of primary-keys/ids of the objects to delete. |
---|---|
Returns: | List of the primary keys of the deleted objects. |
Can be overridden to change fieldgroups before they are sent into the QryResultWrapper. For example, if certain fieldgroups contain senstive data for anonymous assignments, we can add those fieldgroups if a filter for a specific assignment is provided in filters and that assignment is not anonymous.
Returns: | (result_fieldgroups, search_fieldgroups) |
---|
Check if the given obj is empty. Defaults to returning False.
Can be implemented in subclasses to enable superadmins to recursively delete() the obj.
Invoked after the obj has been saved.
Override this to set custom/generated values on obj after it has been validated and saved. The default does nothing.
Invoked after the user has been authorize by write_authorize() and before obj.full_clean() in create() and update().
Override this to set custom/generated values on obj before it is validated and saved. The default does nothing.
Read the requested item and return a dict with the fields specified in Meta.resultfields and additional fields specified in result_fieldgroups.
Parameters: |
|
---|---|
Throws PermissionDenied: | |
If the given user does not have permission to view this object, or if the object does not exist. |
Checks if the given user is an examiner for the given obj, and raises PermissionDenied if not.
Parameters: |
|
---|---|
Throws PermissionDenied: | |
Search for objects.
Parameters: |
|
---|---|
Returns: | The result of the search. |
Return type: | QryResultWrapper |
Update many.
This does the same as calling update() many times, except that it does it all in a single transaction. This means that the database rolls back the changes unless they all succeed.
Param : | list_of_field_values List of field_values dicts (see update()). Each dict _must_ have a _pk_ key that maps to the primary-key/id value. |
---|---|
Returns: | List of the primary keys of the updated objects. |
Check if the given user has write (update/create) permission on the given obj.
Defaults to raising :exc:NotImplementedError
Raises PermissionDenied: | |
---|---|
If the given user do not have write permission on the given obj. |