Seconds part of translations in models

This commit is contained in:
2020-05-19 16:13:34 +02:00
parent 7c4ca62a2d
commit 65f3d73a47
5 changed files with 8 additions and 5 deletions

View File

@ -1,6 +1,7 @@
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
from django.contrib.auth.models import User
from django.utils.translation import gettext_lazy as _
from .models import Employee
@ -9,7 +10,7 @@ from .models import Employee
class EmployeeInline(admin.StackedInline):
model = Employee
can_delete = False
verbose_name_plural = 'employee'
verbose_name_plural = _('employee')
# Define a new User admin
class UserAdmin(BaseUserAdmin):

View File

@ -30,9 +30,9 @@ class Employee(MetaDataModel):
user = models.OneToOneField(User, on_delete=models.CASCADE, help_text=_('Django user'))
hospital = models.ForeignKey(Hospital, on_delete=models.CASCADE, help_text=_('Select the hospital for this employee'))
hospital = models.ForeignKey(Hospital, verbose_name=Hospital._meta.verbose_name, on_delete=models.CASCADE, help_text=_('Select the hospital for this employee'))
polyclinic = models.ManyToManyField(Polyclinic, blank=True, help_text=_('Select the polyclinic(s) for this employee'))
polyclinic = models.ManyToManyField(Polyclinic, verbose_name=Polyclinic._meta.verbose_name, blank=True, help_text=_('Select the polyclinic(s) for this employee'))
phone = models.CharField(_('Phone number'), max_length=20, blank=True, help_text=_('The direct phone number of this employee'))
def __str__(self):