Další opravy skoro-povedeného merge
This commit is contained in:
parent
e44b3296cf
commit
a82c218b71
4 changed files with 31 additions and 17 deletions
|
@ -1,6 +1,4 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.11.26 on 2019-12-09 22:26
|
||||
from __future__ import unicode_literals
|
||||
# Generated by Django 2.2.15 on 2020-08-19 07:47
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
@ -8,13 +6,13 @@ from django.db import migrations, models
|
|||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('galerie', '0007_obrazek_odstranen_datum'),
|
||||
('galerie', '0009_auto_20190610_2358'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='galerie',
|
||||
name='poradi',
|
||||
field=models.IntegerField(blank=True, default=0, verbose_name=b'Po\xc5\x99ad\xc3\xad'),
|
||||
field=models.IntegerField(blank=True, default=0, verbose_name='Pořadí'),
|
||||
),
|
||||
]
|
|
@ -60,20 +60,19 @@ class SeznamListView(generic.ListView):
|
|||
)
|
||||
return prednasky
|
||||
|
||||
# FIXME nahradit anotaci s filtrem po prechodu na Django 2.2
|
||||
def get_context_data(self,**kwargs):
|
||||
context = super(SeznamListView, self).get_context_data(**kwargs)
|
||||
# FIXME nahradit anotaci s filtrem po prechodu na Django 2.2
|
||||
def get_context_data(self,**kwargs):
|
||||
context = super(SeznamListView, self).get_context_data(**kwargs)
|
||||
|
||||
# hlasovani se vztahuje k nejnovejsimu soustredeni
|
||||
sous = Soustredeni.objects.first()
|
||||
seznam = Seznam.objects.filter(soustredeni = sous, stav = STAV_NAVRH).first()
|
||||
# hlasovani se vztahuje k nejnovejsimu soustredeni
|
||||
sous = Soustredeni.objects.first()
|
||||
seznam = Seznam.objects.filter(soustredeni = sous, stav = STAV_NAVRH).first()
|
||||
|
||||
for obj in self.object_list:
|
||||
hlasovani_set = obj.hlasovani_set.filter(seznam=seznam).only('body')
|
||||
obj.body = sum(map(lambda x: x.body,hlasovani_set))
|
||||
for obj in self.object_list:
|
||||
hlasovani_set = obj.hlasovani_set.filter(seznam=seznam).only('body')
|
||||
obj.body = sum(map(lambda x: x.body,hlasovani_set))
|
||||
|
||||
return context
|
||||
|
||||
return context
|
||||
|
||||
|
||||
def SeznamExportView(request, seznam):
|
||||
|
|
17
seminar/migrations/0086_auto_20200819_0959.py
Normal file
17
seminar/migrations/0086_auto_20200819_0959.py
Normal file
|
@ -0,0 +1,17 @@
|
|||
# Generated by Django 2.2.15 on 2020-08-19 07:59
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('seminar', '0085_nepovinna_prezdivka'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterModelOptions(
|
||||
name='organizator',
|
||||
options={'ordering': ['-organizuje_do', 'osoba__jmeno', 'osoba__prijmeni'], 'verbose_name': 'Organizátor', 'verbose_name_plural': 'Organizátoři'},
|
||||
),
|
||||
]
|
|
@ -601,7 +601,7 @@ class Organizator(SeminarModelBase):
|
|||
# TODO: Chtěl bych spíš mít nejstarší orgy dole.
|
||||
# TODO: Zohledňovat přezdívky?
|
||||
# TODO: Sjednotit s tím, jak se řadí organizátoři v seznau orgů na webu
|
||||
ordering = ['-organizuje_do', 'user__osoba__jmeno', 'user__osoba__prijmeni']
|
||||
ordering = ['-organizuje_do', 'osoba__jmeno', 'osoba__prijmeni']
|
||||
|
||||
@reversion.register(ignore_duplicates=True)
|
||||
class Soustredeni(SeminarModelBase):
|
||||
|
|
Loading…
Reference in a new issue