Hezká jména a pořadí aplikací

This commit is contained in:
Pavel "LEdoian" Turinsky 2024-06-03 02:06:00 +02:00
parent 15b09c23a7
commit 381c5ca3de
14 changed files with 30 additions and 3 deletions

View file

@ -3,6 +3,6 @@ Soubor sloužící k pojmenování a jiným nastavením djangovské aplikace.
"""
from django.apps import AppConfig
class AesopConfig(AppConfig):
name = 'aesop'
verbose_name = 'Export do AESOPa'

View file

@ -6,3 +6,4 @@ from django.apps import AppConfig
class ApiConfig(AppConfig):
name = 'api'
verbose_name = 'Různá webová API'

View file

@ -6,3 +6,4 @@ from django.apps import AppConfig
class HeaderFotkyConfig(AppConfig):
name = 'header_fotky'
verbose_name = 'Fotky v záhlaví'

View file

@ -42,8 +42,17 @@ def get_app_list(self, request, app_label=None):
"""
app_dict = self._build_app_dict(request, label=app_label)
# Sort the apps alphabetically.
app_list = sorted(app_dict.values(), key=lambda x: locale.strxfrm('!') if (x['name'] == "Seminar") else locale.strxfrm(x['name'].lower()))
aplikace_nahore = [
'seminar',
'personalni',
'novinky',
'korektury',
'various',
'prednasky',
'soustredeni',
]
app_list = [app_dict[label] for label in aplikace_nahore] + [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:

View file

@ -3,3 +3,4 @@ from django.apps import AppConfig
class NovinkyConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'novinky'
verbose_name = 'Novinky'

View file

@ -6,3 +6,4 @@ from django.apps import AppConfig
class OdevzdavatkoConfig(AppConfig):
name = 'odevzdavatko'
verbose_name = 'Odevzdávátko'

View file

@ -6,3 +6,4 @@ from django.apps import AppConfig
class PersonalniConfig(AppConfig):
name = 'personalni'
verbose_name = 'Personální' # Má to nějaký použitelnější název?

7
seminar/apps.py Normal file
View file

@ -0,0 +1,7 @@
from django.apps import AppConfig
class SeminarConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'seminar'
verbose_name = 'Seminář'

View file

@ -3,3 +3,4 @@ from django.apps import AppConfig
class SifrovackaConfig(AppConfig):
name = 'sifrovacka'
verbose_name = 'Šifrovačka'

View file

@ -6,3 +6,4 @@ from django.apps import AppConfig
class SoustredeniConfig(AppConfig):
name = 'soustredeni'
verbose_name = 'Soustředění'

View file

@ -6,3 +6,4 @@ from django.apps import AppConfig
class TreenodeConfig(AppConfig):
name = 'treenode'
verbose_name = 'TreeNody'

View file

@ -6,3 +6,4 @@ from django.apps import AppConfig
class VariousConfig(AppConfig):
name = 'various'
verbose_name = 'Různé'

View file

@ -3,3 +3,4 @@ from django.apps import AppConfig
class VyrociConfig(AppConfig):
name = 'vyroci'
verbose_name = '30. výročí M&M'

View file

@ -6,3 +6,4 @@ from django.apps import AppConfig
class VysledkovkyConfig(AppConfig):
name = 'vysledkovky'
verbose_name = 'Výsledkovky'