education package

Submodules

education.admin module

This module registers admin pages for the models

class education.admin.CourseAdmin(model, admin_site)[source]

Bases: utils.translation.TranslatedModelAdmin

exclude = None
fields = ('name_en', 'name_nl', 'course_code', 'ec', 'since', 'until', 'categories', 'old_courses')
list_filter = ('categories', 'ec')
property media
search_fields = ('name_en', 'name_nl', 'course_code')
class education.admin.ExamAdmin(model, admin_site)[source]

Bases: utils.translation.TranslatedModelAdmin, education.admin.WithDownloadCsv

accept(request, queryset)[source]
actions = ['accept', 'reject', 'reset_download_count', 'download_csv']
exclude = None
fields = None
list_display = ('type', 'course', 'exam_date', 'uploader', 'accepted', 'language', 'download_count')
list_filter = ('accepted', 'exam_date', 'type', 'language')
property media
readonly_fields = ('download_count',)
reject(request, queryset)[source]
reset_download_count(request, queryset)[source]
search_fields = ('name', 'uploader__first_name', 'uploader__last_name', 'course__name_nl', 'course__name_en')
class education.admin.SummaryAdmin(model, admin_site)[source]

Bases: utils.translation.TranslatedModelAdmin, education.admin.WithDownloadCsv

accept(request, queryset)[source]
actions = ['accept', 'reject', 'reset_download_count', 'download_csv']
exclude = None
fields = None
form

alias of education.forms.SummaryAdminForm

list_display = ('name', 'course', 'uploader', 'accepted', 'language', 'download_count')
list_filter = ('accepted', 'language')
property media
readonly_fields = ('download_count',)
reject(request, queryset)[source]
reset_download_count(request, queryset)[source]
search_fields = ('name', 'uploader__first_name', 'uploader__last_name', 'course__name_nl', 'course__name_en')
class education.admin.WithDownloadCsv[source]

Bases: object

download_csv(request, queryset)[source]

education.apps module

Configuration for the education package

class education.apps.EducationConfig(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

AppConfig for the education package

name = 'education'
verbose_name = 'Education'

education.forms module

The forms defined by the education package

class education.forms.AddExamForm(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: django.forms.models.ModelForm

Custom form to add exams, changes the possible years of the date

class Meta[source]

Bases: object

fields = ('file', 'course', 'type', 'language', 'exam_date')
model

alias of education.models.Exam

base_fields = {'course': <django.forms.models.ModelChoiceField object>, 'exam_date': <django.forms.fields.DateField object>, 'file': <django.forms.fields.FileField object>, 'language': <django.forms.fields.TypedChoiceField object>, 'type': <django.forms.fields.ChoiceField object>}
declared_fields = {'course': <django.forms.models.ModelChoiceField object>, 'exam_date': <django.forms.fields.DateField object>, 'type': <django.forms.fields.ChoiceField object>}
property media

Return all media required to render the widgets on this form.

this_year = 2020
years = [2020, 2019, 2018, 2017, 2016, 2015, 2014, 2013, 2012]
class education.forms.AddSummaryForm(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: django.forms.models.ModelForm

Custom form to add summaries, orders courses by name and formats the year as lecture years

class Meta[source]

Bases: object

fields = ('name', 'year', 'language', 'file', 'course', 'author')
model

alias of education.models.Summary

base_fields = {'author': <django.forms.fields.CharField object>, 'course': <django.forms.models.ModelChoiceField object>, 'file': <django.forms.fields.FileField object>, 'language': <django.forms.fields.TypedChoiceField object>, 'name': <django.forms.fields.CharField object>, 'year': <django.forms.fields.TypedChoiceField object>}
declared_fields = {'course': <django.forms.models.ModelChoiceField object>, 'year': <django.forms.fields.TypedChoiceField object>}
property media

Return all media required to render the widgets on this form.

this_year = 2020
years = <list_reverseiterator object>
class education.forms.SummaryAdminForm(data=None, files=None, **kwargs)[source]

Bases: django.forms.models.ModelForm

Custom form for summaries so that we can show more data in the admin

class Meta[source]

Bases: object

fields = '__all__'
model

alias of education.models.Summary

base_fields = {'accepted': <django.forms.fields.BooleanField object>, 'author': <django.forms.fields.CharField object>, 'course': <django.forms.models.ModelChoiceField object>, 'download_count': <django.forms.fields.IntegerField object>, 'email': <django.forms.fields.CharField object>, 'file': <django.forms.fields.FileField object>, 'language': <django.forms.fields.TypedChoiceField object>, 'name': <django.forms.fields.CharField object>, 'phone': <django.forms.fields.CharField object>, 'uploader': <django.forms.models.ModelChoiceField object>, 'uploader_date': <django.forms.fields.DateField object>, 'year': <django.forms.fields.IntegerField object>}
declared_fields = {'email': <django.forms.fields.CharField object>, 'phone': <django.forms.fields.CharField object>}
property media

Return all media required to render the widgets on this form.

education.models module

The models defined by the education package

class education.models.Category(*args, **kwargs)[source]

Bases: django.db.models.base.Model

Describes a course category

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

course_set

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

get_absolute_url()[source]
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

property name

Accessor that fetches the localized variant of name

name_en

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_nl

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
class education.models.Course(*args, **kwargs)[source]

Bases: django.db.models.base.Model

Describes a course

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

categories

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

course_code

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

course_set

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

ec

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

exam_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 a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

get_absolute_url()[source]
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

property name

Accessor that fetches the localized variant of name

name_en

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_nl

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
old_courses

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

since

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

summary_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 a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

until

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class education.models.Exam(*args, **kwargs)[source]

Bases: django.db.models.base.Model

Describes an exam

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

EXAM_TYPES = (('document', 'Document'), ('exam', 'Exam'), ('partial', 'Partial Exam'), ('resit', 'Resit'), ('practice', 'Practice Exam'), ('exam_answers', 'Exam Answers'), ('partial_answers', 'Partial Exam Answers'), ('resit_answers', 'Resit Answers'), ('practice_answers', 'Practice Exam Answers'))
exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

accepted

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

course

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 a ForwardManyToOneDescriptor instance.

course_id
download_count

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

exam_date

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

file

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_absolute_url()[source]
get_language_display(*, field=<django.db.models.fields.CharField: language>)
get_next_by_exam_date(*, field=<django.db.models.fields.DateField: exam_date>, is_next=True, **kwargs)
get_next_by_uploader_date(*, field=<django.db.models.fields.DateField: uploader_date>, is_next=True, **kwargs)
get_previous_by_exam_date(*, field=<django.db.models.fields.DateField: exam_date>, is_next=False, **kwargs)
get_previous_by_uploader_date(*, field=<django.db.models.fields.DateField: uploader_date>, is_next=False, **kwargs)
get_type_display(*, field=<django.db.models.fields.CharField: type>)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

language

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
type

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

uploader

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 a ForwardManyToOneDescriptor instance.

uploader_date

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

uploader_id
property year
class education.models.Summary(*args, **kwargs)[source]

Bases: django.db.models.base.Model

Describes a summary

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

accepted

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

author

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

course

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 a ForwardManyToOneDescriptor instance.

course_id
download_count

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

file

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_absolute_url()[source]
get_language_display(*, field=<django.db.models.fields.CharField: language>)
get_next_by_uploader_date(*, field=<django.db.models.fields.DateField: uploader_date>, is_next=True, **kwargs)
get_previous_by_uploader_date(*, field=<django.db.models.fields.DateField: uploader_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.

language

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
uploader

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 a ForwardManyToOneDescriptor instance.

uploader_date

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

uploader_id
year

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

education.sitemaps module

The sitemaps defined by the education package

class education.sitemaps.CourseSitemap[source]

Bases: django.contrib.sitemaps.Sitemap

Sitemap of the course pages

items()[source]
location(item)[source]
class education.sitemaps.StaticViewSitemap[source]

Bases: django.contrib.sitemaps.Sitemap

Sitemap of the static pages

changefreq = 'daily'
items()[source]
location(item)[source]
priority = 0.5

education.urls module

The routes defined by the education package

education.views module

Views provided by the education package

class education.views.BookInfoView(**kwargs)[source]

Bases: django.views.generic.base.TemplateView

Renders a page with information about book sale Only available to members and to-be members

dispatch(request, *args, **kwargs) → django.http.response.HttpResponse[source]
template_name = 'education/books.html'
class education.views.CourseDetailView(**kwargs)[source]

Bases: django.views.generic.detail.DetailView

Renders the detail page of one specific course

context_object_name = 'course'
get_context_data(**kwargs)dict[source]

Insert the single object into the context dict.

model

alias of education.models.Course

template_name = 'education/course.html'
class education.views.CourseIndexView(**kwargs)[source]

Bases: django.views.generic.list.ListView

Renders an overview of the courses

get_context_data(**kwargs)dict[source]

Get the context for this view.

get_ordering()str[source]

Return the field or fields to use for ordering the queryset.

queryset
template_name = 'education/courses.html'
class education.views.ExamCreateView(**kwargs)[source]

Bases: django.contrib.messages.views.SuccessMessageMixin, django.views.generic.edit.CreateView

Renders the form to submit a new exam

dispatch(request, *args, **kwargs)
form_class

alias of education.forms.AddExamForm

form_valid(form) → django.http.response.HttpResponse[source]

If the form is valid, save the associated model.

get_initial()dict[source]

Return the initial data to use for forms on this view.

model

alias of education.models.Exam

success_message = 'Exam submitted successfully.'
success_url = '/education/courses/exam/upload/'
template_name = 'education/add_exam.html'
class education.views.ExamDetailView(**kwargs)[source]

Bases: django.views.generic.detail.DetailView

Fetches and outputs the specified exam

dispatch(request, *args, **kwargs)
get(request, *args, **kwargs) → django.http.response.HttpResponse[source]
model

alias of education.models.Exam

class education.views.StudentParticipantView(**kwargs)[source]

Bases: django.views.generic.base.TemplateView

Renders a page with information about student information

template_name = 'education/student_participation.html'
class education.views.SummaryCreateView(**kwargs)[source]

Bases: django.contrib.messages.views.SuccessMessageMixin, django.views.generic.edit.CreateView

Renders the form to submit a new summary

dispatch(request, *args, **kwargs)
form_class

alias of education.forms.AddSummaryForm

form_valid(form) → django.http.response.HttpResponse[source]

If the form is valid, save the associated model.

get_initial()[source]

Return the initial data to use for forms on this view.

model

alias of education.models.Summary

success_message = 'Summary submitted successfully.'
success_url = '/education/courses/summary/upload/'
template_name = 'education/add_summary.html'
class education.views.SummaryDetailView(**kwargs)[source]

Bases: django.views.generic.detail.DetailView

Fetches and outputs the specified summary

dispatch(request, *args, **kwargs)
get(request, *args, **kwargs) → django.http.response.HttpResponse[source]
model

alias of education.models.Summary