Compare commits

...

2 Commits

Author SHA1 Message Date
ticvac 9c1007073d try except fix 3 weeks ago
ticvac 1f77e2a6aa hack for utf-á 4 weeks ago
  1. 10
      mamweb/admin.py
  2. 17
      tvorba/migrations/0008_alter_rocnik_options.py
  3. 4
      tvorba/models.py

10
mamweb/admin.py

@ -54,11 +54,11 @@ def get_app_list(self, request, app_label=None):
# Odhlášený admin má prázdný app_dict :-/
app_list = [app_dict[label] for label in aplikace_nahore if label in app_dict] + [app_dict[label] for label in app_dict if label not in aplikace_nahore]
# Sort the models alphabetically within each app.
for app in app_list:
app['models'].sort(key=lambda x: locale.strxfrm(x['name'].lower()))
try:
for app in app_list:
app['models'].sort(key=lambda x: locale.strxfrm(x['name'].lower()))
except OSError:
pass # locale.strxfrm nefunguje na macu... :-/ -> neprovede se řazení
return app_list
AdminSite.get_app_list = get_app_list

17
tvorba/migrations/0008_alter_rocnik_options.py

@ -0,0 +1,17 @@
# Generated by Django 4.2.16 on 2024-11-26 22:06
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('tvorba', '0007_alter_deadline_typ'),
]
operations = [
migrations.AlterModelOptions(
name='rocnik',
options={'ordering': ['-rocnik'], 'verbose_name': 'ChRočník', 'verbose_name_plural': 'Ročníky'},
),
]

4
tvorba/models.py

@ -41,8 +41,8 @@ class Rocnik(SeminarModelBase):
class Meta:
db_table = 'seminar_rocniky'
verbose_name = 'Ročník'
verbose_name_plural = 'Ročníky'
verbose_name = 'ChRočník'
verbose_name_plural = 'ChRočníky'
ordering = ['-rocnik']
# Interní ID

Loading…
Cancel
Save