From c86e14261450dc87e26e8022d4355c3ff31ab83a Mon Sep 17 00:00:00 2001 From: bashmak Date: Wed, 25 Apr 2018 12:51:46 +0300 Subject: [PATCH] add default orering to models and fix translation in ext.htm in accounts_app templates --- abonapp/models.py | 4 +++- accounts_app/locale/ru/LC_MESSAGES/django.po | 6 ++++++ accounts_app/models.py | 1 + chatbot/models.py | 3 +++ devapp/models.py | 1 + dialing_app/models.py | 1 + mapapp/models.py | 1 + msg_app/models.py | 1 + statistics/models.py | 1 + taskapp/models.py | 1 + 10 files changed, 19 insertions(+), 1 deletion(-) diff --git a/abonapp/models.py b/abonapp/models.py index 6774eb8..59c8b33 100644 --- a/abonapp/models.py +++ b/abonapp/models.py @@ -302,6 +302,7 @@ class PassportInfo(models.Model): db_table = 'passport_info' verbose_name = _('Passport Info') verbose_name_plural = _('Passport Info') + ordering = ['series'] def __str__(self): return "%s %s" % (self.series, self.number) @@ -409,7 +410,7 @@ class AdditionalTelephone(models.Model): class Meta: db_table = 'additional_telephones' - ordering = ('owner_name',) + ordering = ['owner_name'] permissions = ( ('can_view_additionaltelephones', _('Can view additional telephones')), ) @@ -448,6 +449,7 @@ class PeriodicPayForId(models.Model): class Meta: db_table = 'periodic_pay_for_id' + ordering = ['last_pay'] @receiver(post_delete, sender=Abon) diff --git a/accounts_app/locale/ru/LC_MESSAGES/django.po b/accounts_app/locale/ru/LC_MESSAGES/django.po index 0715f3f..881bbb7 100644 --- a/accounts_app/locale/ru/LC_MESSAGES/django.po +++ b/accounts_app/locale/ru/LC_MESSAGES/django.po @@ -299,3 +299,9 @@ msgstr "Редактировать" msgid "Access to groups" msgstr "Доступ к группам" + +msgid "Administrator" +msgstr "Сотрудник" + +msgid "Manage responsibility groups" +msgstr "Ответственность за группы" diff --git a/accounts_app/models.py b/accounts_app/models.py index 692a32c..596fefb 100644 --- a/accounts_app/models.py +++ b/accounts_app/models.py @@ -86,6 +86,7 @@ class BaseAccount(AbstractBaseUser, PermissionsMixin): class Meta: db_table = 'base_accounts' + ordering = ['username'] class UserProfileManager(MyUserManager): diff --git a/chatbot/models.py b/chatbot/models.py index 1046adf..6a21947 100644 --- a/chatbot/models.py +++ b/chatbot/models.py @@ -20,6 +20,7 @@ class TelegramBot(models.Model): db_table = 'chat_telegram_bot' verbose_name = _('Telegram bot') verbose_name_plural = _('Telegram bots') + ordering = ['chat_id'] class MessageHistory(models.Model): @@ -34,6 +35,7 @@ class MessageHistory(models.Model): db_table = 'chat_message_history' verbose_name = _('Message history') verbose_name_plural = _('Message histories') + ordering = ['-date_sent'] class MessageQueueManager(models.Manager): @@ -68,3 +70,4 @@ class MessageQueue(models.Model): db_table = 'chat_message_queue' verbose_name = _('Message queue') verbose_name_plural = _('Message queue') + ordering = ['target_employee__username'] diff --git a/devapp/models.py b/devapp/models.py index fa9aa06..945edd2 100644 --- a/devapp/models.py +++ b/devapp/models.py @@ -138,3 +138,4 @@ class Port(models.Model): ) verbose_name = _('Port') verbose_name_plural = _('Ports') + ordering = ['num'] diff --git a/dialing_app/models.py b/dialing_app/models.py index e191eb2..17fa39f 100644 --- a/dialing_app/models.py +++ b/dialing_app/models.py @@ -110,6 +110,7 @@ class SMSOut(models.Model): ) verbose_name = _('Out SMS') verbose_name_plural = _('Out SMS') + ordering = ['-when'] def __str__(self): return self.text diff --git a/mapapp/models.py b/mapapp/models.py index e18e3e5..6be2314 100644 --- a/mapapp/models.py +++ b/mapapp/models.py @@ -14,6 +14,7 @@ class Dot(models.Model): db_table = 'dots' verbose_name = _('Map point') verbose_name_plural = _('Map points') + ordering = ['title'] permissions = ( ('can_view', _('Can view')), ) diff --git a/msg_app/models.py b/msg_app/models.py index d95d96e..b17413c 100644 --- a/msg_app/models.py +++ b/msg_app/models.py @@ -243,3 +243,4 @@ class Conversation(models.Model): permissions = ( ('can_view_conversation', _('Can view conversation')), ) + ordering = ['title'] diff --git a/statistics/models.py b/statistics/models.py index 9c9db7d..349915c 100644 --- a/statistics/models.py +++ b/statistics/models.py @@ -127,3 +127,4 @@ class StatCache(models.Model): class Meta: db_table = 'flowcache' + ordering = ['-last_time'] diff --git a/taskapp/models.py b/taskapp/models.py index b4d02a0..0209ab9 100644 --- a/taskapp/models.py +++ b/taskapp/models.py @@ -132,3 +132,4 @@ class ExtraComment(models.Model): ) verbose_name = _('Extra comment') verbose_name_plural = _('Extra comments') + ordering = ['-date_create']