Суть ошибки:
models.py
class Client(models.Model):
first_name_user = models.CharField(null=False,max_length=254, verbose_name = 'Фамилия')
name_user = models.CharField(null=False,max_length=254, verbose_name = 'Имя')
first_name_other = models.CharField(blank = True, max_length = 254, verbose_name = 'Отчество')
number_phone_user = models.CharField(blank=False,max_length=254, verbose_name = 'Номер телефона')
email_user = models.EmailField(blank=True, verbose_name = 'E-mail')
registration_user = models.CharField(null=False, blank=False, max_length=254, verbose_name = 'Место жительства')
dny_user = models.IntegerField(verbose_name = 'Кол-во дней аренды')
promo_user = models.BooleanField(null=False, blank=False, verbose_name = 'Наличие скидочной карты')
date_user = models.DateField(auto_now_add = False, blank=False, verbose_name = 'Дата регистрации')
def __str__(self):
return self.first_name_user, self.name_user, self.first_name_other
class Meta:
verbose_name_plural = 'Клиенты'
verbose_name = 'Клиента'
ordering = ['name_user']
class BlackClient(models.Model):
names = models.ForeignKey(Client, on_delete=models.CASCADE, verbose_name = 'Клиент')
text_black = models.TextField(null=True, blank=True, verbose_name = 'Причина')
def __str__(self):
return self.names
class Meta:
verbose_name_plural = 'Черный список'
verbose_name = 'Черный список'
ordering = ['names']
admin.py
class ClientAdmin(admin.ModelAdmin):
list_display = ('first_name_user', 'name_user', 'first_name_other', 'number_phone_user', 'email_user')
list_display_link = ('name_user', 'first_name_user', 'first_name_other', 'number_phone_user')
search_fields = ('first_name_user', 'name_user', 'first_name_other', 'number_phone_user', 'email_user')
admin.site.register(Client, ClientAdmin),
admin.site.register(BlackClient)