Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • AlekSIS/official/AlekSIS-App-Alsijil
  • sunweaver/AlekSIS-App-Alsijil
  • 8tincsoVluke/AlekSIS-App-Alsijil
  • perfreicpo/AlekSIS-App-Alsijil
  • noifobarep/AlekSIS-App-Alsijil
  • 7ingannisdo/AlekSIS-App-Alsijil
  • unmruntartpa/AlekSIS-App-Alsijil
  • balrorebta/AlekSIS-App-Alsijil
  • comliFdifwa/AlekSIS-App-Alsijil
  • 3ranaadza/AlekSIS-App-Alsijil
10 results
Show changes
Commits on Source (1)
from django.db import models
from django.utils.translation import ugettext_lazy as _
from biscuit.core.mixins import SchoolRelated
from biscuit.core.mixins import CRUDMixin
def isidentifier(value: str) -> bool:
return value.isidentifier()
class PersonalNote(SchoolRelated):
class PersonalNote(models.Model):
""" A personal note about a single person. Used in the class register to note
absences, excuses and remarks about a student in a single lesson period.
"""
......@@ -25,12 +25,12 @@ class PersonalNote(SchoolRelated):
remarks = models.CharField(max_length=200, blank=True)
class Meta:
unique_together = [['school', 'lesson_period', 'week', 'person']]
unique_together = [['lesson_period', 'week', 'person']]
ordering = ['lesson_period__lesson__date_start', 'week', 'lesson_period__period__weekday',
'lesson_period__period__period', 'person__last_name', 'person__first_name']
class LessonDocumentation(SchoolRelated):
class LessonDocumentation(models.Model, CRUDMixin):
""" A documentation on a single lesson period. Non-personal, includes
the topic and homework of the lesson.
"""
......@@ -43,20 +43,21 @@ class LessonDocumentation(SchoolRelated):
homework = models.CharField(verbose_name=_('Homework'), max_length=200, blank=True)
class Meta:
unique_together = [['school', 'lesson_period', 'week']]
unique_together = [['lesson_period', 'week']]
ordering = ['lesson_period__lesson__date_start', 'week',
'lesson_period__period__weekday', 'lesson_period__period__period']
class PersonalNoteFilter(SchoolRelated):
class PersonalNoteFilter(models.Model):
""" A filter definition that can generate statistics on personal note texts. """
identifier = models.CharField(verbose_name=_('Identifier'), max_length=30,
validators=[isidentifier])
description = models.CharField(verbose_name=_('Description'), max_length=60, blank=True)
validators=[isidentifier], unique=True)
description = models.CharField(verbose_name=_('Description'), max_length=60,
blank=True, unique=True)
regex = models.CharField(verbose_name=_('Match expression'), max_length=100)
regex = models.CharField(verbose_name=_('Match expression'), max_length=100,
unique=True)
class Meta:
unique_together = [['school', 'identifier'], ['school', 'description'], ['school', 'regex']]
ordering = ['identifier']
......@@ -17,7 +17,7 @@
<section class="sheet padding-10mm bigprint" id="titlepage">
<div>
<h1>{% trans 'Class register' %}</h1>
<img src="{% cropped_thumbnail group.school 'logo_cropping' max_size='600x600' %}" id="school-logo" />
<img src="{% cropped_thumbnail school 'logo_cropping' max_size='600x600' %}" id="school-logo" />
<p id="group-desc">
{{ group.name }}
</p>
......
......@@ -13,7 +13,7 @@ from django_tables2 import RequestConfig
from biscuit.apps.chronos.models import LessonPeriod
from biscuit.apps.chronos.util import CalendarWeek
from biscuit.core.models import Group, Person
from biscuit.core.models import Group, Person, School
from biscuit.core.decorators import admin_required
from biscuit.core.util import messages
......@@ -176,7 +176,7 @@ def full_register_group(request: HttpRequest, id_: int) -> HttpResponse:
'documentations', 'personal_notes'
)
weeks = CalendarWeek.weeks_within(group.school.current_term.date_start, group.school.current_term.date_end)
weeks = CalendarWeek.weeks_within(School.objects.first().current_term.date_start, School.objects.first().current_term.date_end)
periods_by_day = {}
for lesson_period in lesson_periods:
for week in weeks:
......@@ -216,6 +216,7 @@ def full_register_group(request: HttpRequest, id_: int) -> HttpResponse:
context['weeks'] = weeks
context['periods_by_day'] = periods_by_day
context['today'] = date.today()
context['school'] School.objects.first()
return render(request, 'alsijil/print/full_register.html', context)
......