add middleware for aircox used for timezone and current station selection in admin; add page summary for today's diffusions menu in link title

This commit is contained in:
bkfox
2017-05-15 16:42:30 +02:00
parent 1d02aea773
commit 8cc3caa16b
5 changed files with 143 additions and 32 deletions

View File

@ -167,6 +167,11 @@ class Station(Nameable):
max_length = 256,
blank = True,
)
default = models.BooleanField(
_('default station'),
default = True,
help_text = _('if checked, this station is used as the main one')
)
#
# Controllers
@ -333,6 +338,12 @@ class Station(Nameable):
self.slug
)
if self.default:
qs = Station.objects.filter(default = True)
if self.pk:
qs = qs.exclude(pk = self.pk)
qs.update(default = False)
super().save(*args, **kwargs)