The student simplified API. This API is a simplified wrapper of devilry.apps.core.models — Devilry core datastructure for students. Every action requires the given user to be student on the object being manipulated.
Bases: devilry.apps.student.simplified.PublishedWhereIsCandidateMixin
Simplified wrapper for devilry.apps.core.models.Subject.
Bases: devilry.coreutils.simplified.metabases.subject.SimplifiedSubjectMetaMixin
Defines what methods a Student 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 a student.
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 student in 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.student.simplified.isrelatedstudentbase.IsRelatedStudentBase
Simplified wrapper for devilry.apps.core.models.Period.
Bases: devilry.coreutils.simplified.metabases.period.SimplifiedPeriodMetaMixin
Defines what methods a Student 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 a related student.
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 student in 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.student.simplified.PublishedWhereIsCandidateMixin
Simplified wrapper for devilry.apps.core.models.Assignment.
Bases: devilry.coreutils.simplified.metabases.assignment.SimplifiedAssignmentMetaMixin
Defines what methods a Student can use on an Assignment object using the Simplified API
alias of Assignment
Returns all objects of this type that matches arguments given in \*\*kwargs where user is a student.
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 student in 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.student.simplified.PublishedWhereIsCandidateMixin
Simplified wrapper for devilry.apps.core.models.AssignmentGroup.
Bases: devilry.coreutils.simplified.metabases.assignment_group.SimplifiedAssignmentGroupMetaMixin
Defines what methods a Student can use on an AssignmentGroup object using the Simplified API
alias of AssignmentGroup
Returns all AssignmentGroup-objects where given user is candidate.
Parameters: | user – A django user object. |
---|---|
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 student in 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.student.simplified.PublishedWhereIsCandidateMixin
Simplified wrapper for devilry.apps.core.models.Deadline.
Bases: devilry.coreutils.simplified.metabases.deadline.SimplifiedDeadlineMetaMixin
Defines what methods a Student can use on a Deadline object using the Simplified API
alias of Deadline
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 student in 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.student.simplified.PublishedWhereIsCandidateMixin
Simplified wrapper for devilry.apps.core.models.Delivery.
Bases: devilry.coreutils.simplified.metabases.delivery.SimplifiedDeliveryMetaMixin
Defines what methods a Student can use on a Delivery object using the Simplified API
alias of Delivery
Checks if the given user is an student in the given 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 a student.
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.
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 student in 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.student.simplified.PublishedWhereIsCandidateMixin
Simplified wrapper for devilry.apps.core.models.StaticFeedback.
Bases: devilry.coreutils.simplified.metabases.staticfeedback.SimplifiedStaticFeedbackMetaMixin
Defines what methods a Student can use on a StaticFeedback object using the Simplified API
alias of StaticFeedback
Returns all objects of this type that matches arguments given in \*\*kwargs where user is a student.
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 student in 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.student.simplified.PublishedWhereIsCandidateMixin
Simplified wrapper for devilry.apps.core.models.FileMeta.
Bases: devilry.coreutils.simplified.metabases.filemeta.SimplifiedFileMetaMetaMixin
Defines what methods a Student can use on a FileMeta object using the Simplified API
alias of FileMeta
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 a student.
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 student in 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. |