Browse Source

Fix merge

export_seznamu_prednasek
Jonas Havelka 3 years ago
parent
commit
bea7399fe2
  1. 0
      odevzdavatko/templates/odevzdavatko/detail_resitele.html
  2. 2
      odevzdavatko/urls.py
  3. 10
      personalni/admin.py
  4. 7
      seminar/models/tvorba.py

0
seminar/templates/seminar/odevzdavatko/detail_resitele.html → odevzdavatko/templates/odevzdavatko/detail_resitele.html

2
odevzdavatko/urls.py

@ -15,4 +15,6 @@ urlpatterns = [
path('org/reseni/<int:pk>', org_required(viewMethodSwitch(get=views.DetailReseniView.as_view(), post=views.hodnoceniReseniView)), name='odevzdavatko_detail_reseni'),
path('org/reseni/all', org_required(views.SeznamReseniView.as_view())),
path('org/reseni/akt', org_required(views.SeznamAktualnichReseniView.as_view())),
path('resitel/reseni/<int:pk>', resitel_or_org_required(views.ResitelReseniView.as_view()), name='odevzdavatko_resitel_reseni'),
]

10
personalni/admin.py

@ -30,13 +30,15 @@ class OsobaAdmin(admin.ModelAdmin):
org.save()
udelej_orgem.short_description = "Udělej vybraných osob organizátory"
@admin.register(m.Organizator)
class OrganizatorAdmin(admin.ModelAdmin):
search_fields = ['osoba__jmeno', 'osoba__prijmeni', 'osoba__prezdivka']
class OsobaInline(admin.TabularInline):
model = m.Osoba
@admin.register(m.Organizator)
class OrganizatorAdmin(ReverseModelAdmin):
search_fields = ['osoba__jmeno', 'osoba__prijmeni', 'osoba__prezdivka']
inline_type = 'stacked'
inline_reverse = ['osoba']
@admin.register(m.Resitel)
class ResitelAdmin(ReverseModelAdmin):
search_fields = ['osoba__jmeno', 'osoba__prijmeni', 'osoba__prezdivka']

7
seminar/models/tvorba.py

@ -72,7 +72,12 @@ class Rocnik(SeminarModelBase):
return len(self.verejna_cisla()) > 0
verejne.boolean = True
verejne.short_description = 'Veřejný (jen dle čísel)'
def neverejna_cisla(self):
vc = [c for c in self.cisla.all() if not c.verejne()]
vc.sort(key=lambda c: c.poradi)
return vc
def verejna_cisla(self):
vc = [c for c in self.cisla.all() if c.verejne()]
vc.sort(key=lambda c: c.poradi)

Loading…
Cancel
Save