devilry.apps.core.models
— Devilry core datastructure¶
(edit the images umldiagram1 and umldiagram2 using yuml.me)
Functions and attributes¶
- devilry.apps.core.models.model_utils.pathsep¶
Path separator used by node-paths. The value is
'.'
, and it must not be changed.
- devilry.apps.core.models.model_utils.splitpath(path, expected_len=0)¶
Split the path on
pathsep
and return the resulting list. Example:>>> splitpath('uio.ifi.matnat') ['uio', 'ifi', 'matnat'] >>> splitpath('uio.ifi.matnat', expected_len=2) Traceback (most recent call last): ... ValueError: Path must have exactly 2 parts
- Parameters:
expected_len – Expected length of the resulting list. If the resulting list is not exactly the given length,
ValueError
is raised. Ifexpected_len
is 0 (default), no checking is done.
BaseNode¶
- class devilry.apps.core.models.BaseNode¶
The base class of the Devilry hierarchy. Implements basic functionality used by the other Node classes. This is an abstract datamodel, so it is never used directly.
- short_name¶
A django.db.models.SlugField with max 20 characters. Only numbers, letters, ‘_’ and ‘-‘.
- long_name¶
A django.db.models.CharField with max 100 characters. Gives a longer description than
short_name
.
AbstractIsAdmin¶
- class devilry.apps.core.models.AbstractIsAdmin¶
Deprecated class - needs to clear migrations before this can be removed.
AbstractIsExaminer¶
- class devilry.apps.core.models.AbstractIsExaminer¶
Abstract class implemented by all classes where it is natural to need to check if a user is examiner.
Subject¶
A subject is a course, seminar, class or something else being given regularly. A subject is further divided into periods.
- class devilry.apps.core.models.Subject(*args, **kwargs)¶
- short_name¶
A django.db.models.SlugField with max 20 characters. Only numbers, letters, ‘_’ and ‘-’. Unlike all other children of
BaseNode
, Subject.short_name is unique. This is mainly to avoid the overhead of having to recurse all the way to the top of the node hierarchy for every unique path.
- etag¶
A DateTimeField containing the etag for this object.
Period¶
A Period is a limited period of time, like spring 2009, week 34 2010 or even a single day.
- class devilry.apps.core.models.Period(*args, **kwargs)¶
A Period represents a period of time, for example a half-year term at a university.
- parentnode¶
A django.db.models.ForeignKey that points to the parent node, which is always a Subject.
- start_time¶
A django.db.models.DateTimeField representing the starting time of the period.
- end_time¶
A django.db.models.DateTimeField representing the ending time of the period.
- admins¶
A django.db.models.ManyToManyField that holds all the admins of the node.
- assignments¶
A Django RelatedManager of
assignments
for this period.
A Django RelatedManager of
RelatedExaminers
for this period.
A Django RelatedManager of
RelatedStudents
for this period.
- etag¶
A DateTimeField containing the etag for this object.
Assignment¶
Represents one assignment within a given Period in a given Subject. Each assignment contains one AssignmentGroup for each student or group of students permitted to submit deliveries.
We have three main classifications of assignments:
A old assignment is a assignment where
Period.end_time
is in the past.A published assignment is a assignment where
publishing_time
is in the past.A active assignment is a assignment where
publishing_time
is in the past and current time is beforePeriod.end_time
.
- class devilry.apps.core.models.Assignment(*args, **kwargs)¶
Data model for an assignment.
- gradeform_setup_json¶
A django.db.models.TextField for the json representing a blank gradeform used for this ‘Assignment’
- parentnode¶
A django.db.models.ForeignKey that points to the parent node, which is always a Period.
- publishing_time¶
A django.db.models.DateTimeField representing the publishing time of the assignment.
- admins¶
A django.db.models.ManyToManyField that holds all the admins of the Node.
- assignmentgroups¶
A set of
assignmentgroups
for this assignment
- scale_points_percent¶
Percent to scale points on this assignment by for period overviews. The default is 100, which means no change to the points.
- delivery_types¶
An integer identifying the type of deliveries allowed. Possible values:
- 0
Electronic deliveries using Devilry
- 1
Non-electronic deliveries, or deliveries made through another electronic system.
- 2
An alias/link to a delivery made in another Period.
- deadline_handling¶
An integer identifying how deadlines are handled.
- 0
Soft deadlines. Deliveries can be added until groups are closed.
- 1
Hard deadlines. Deliveries can not be added after the deadline has expired.
- first_deadline¶
A DateTimeField containing an optional first deadline for this assignment. This is metadata that the UI can use where it is natural.
- max_points¶
An IntegerField that contains the maximum number of points possible to achieve on this assignment. This field may be
None
, and it is normally set by the grading system plugin.DO NOT UPDATE MANUALLY. You can safely set an initial value for this manually when you create a new assignment, but when you update this field, do so using
set_max_points()
.
- passing_grade_min_points¶
An IntegerField that contains the minimum number of points required to achive a passing grade on this assignment. This means that any feedback with more this number of points or more is considered a passing grade.
WARNING: Changing this does not have any effect on existing feedback. To actually change existing feedback, you would have to update all feedback on the assignment, effectively creating new StaticFeedbacks from the latest published FeedbackDrafts for each AssignmentGroup.
- grading_system_plugin_id¶
A CharField containing the ID of the grading system plugin this assignment uses.
- students_can_create_groups¶
BooleanField specifying if students can join/leave groups on their own.
If this is
True
students should be allowed to join/leave groups. Ifstudents_can_not_create_groups_after
is specified, this students can not create groups afterstudents_can_not_create_groups_after
even if this isTrue
.ar 16 2017, 17:45 : This delivery was corrected, and given:This does not in any way affect an admins ability to organize students in groups manually.
- students_can_not_create_groups_after¶
Students can not create project groups after this time. Ignored if
students_can_create_groups
isFalse
.DateTimeField that defaults to
None
(null).
Examiner¶
- class devilry.apps.core.models.Examiner(*args, **kwargs)¶
- assignmentgroup¶
The AssignmentGroup where this groups belongs.
- user¶
A foreign key to a User.
Candidate¶
- class devilry.apps.core.models.Candidate(*args, **kwargs)¶
A student within an AssignmentGroup.
A candidate is a many-to-many between
devilry.apps.core.models.AssignmentGroup
and a user.
AssignmentGroup¶
- class devilry.apps.core.models.AssignmentGroup(*args, **kwargs)¶
Represents a student or a group of students.
- parentnode¶
A django.db.models.ForeignKey that points to the parent node, which is always an Assignment.
- name¶
An optional name for the group.
- candidates¶
A django
RelatedManager
that holds thecandidates
on this group.
- examiners¶
A django.db.models.ManyToManyField that holds the examiner(s) that are to correct and grade the assignment.
- is_open¶
A django.db.models.BooleanField that tells you if the group can add deliveries or not.
- etag¶
A DateTimeField containing the etag for this object.
- cached_data¶
A Django RelatedManager of
cached_data
for this AssignmentGroup.
- feedbackset¶
A Django RelatedManager
devilry.apps.core.models.FeedbackSet
for this AssignmentGroup
Note
Postgres triggers create a
devilry.apps.core.models.FeedbackSet
on INSERT
AssignmentGroupTag¶
- class devilry.apps.core.models.AssignmentGroupTag(*args, **kwargs)¶
An AssignmentGroup can be tagged with zero or more tags using this class.
- assignment_group¶
The AssignmentGroup where this groups belongs.
- tag¶
The tag. Max 20 characters. Can only contain a-z, A-Z, 0-9 and “_”.