Skip to content
This repository has been archived by the owner on Feb 24, 2021. It is now read-only.

Commit

Permalink
Kinda fixes #55
Browse files Browse the repository at this point in the history
  • Loading branch information
Xiphoseer committed Jun 21, 2018
1 parent 7cc544b commit 57f1916
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions pyBuchaktion/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,7 @@ class OrderTimeframeAdmin(ModelAdmin):
'end_date',
'start_date',
'semester',
'student_count',
)

form = OrderTimeframeForm
Expand Down
3 changes: 3 additions & 0 deletions pyBuchaktion/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,9 @@ def __str__(self):
def natural_key(self):
return { "from": self.start_date, "to": self.end_date }

def student_count(self):
return self.order_set.values('student').distinct().count()

# Set the singular and plural names for i18n
class Meta:
verbose_name = _("order timeframe")
Expand Down

0 comments on commit 57f1916

Please sign in to comment.