import uuid
from django.core import validators
from django.db import models
class Author(models.Model):
class Meta:
verbase_name = 'Автор'
verbase_name_plural = 'Авторы'
ordering = ('id')
unique_together = ('name','age')
TYPES = (
('a','foreign'),
('b','domestic'),
('c','other')
)
id = models.UUIDField(primary_key=True,db_index=True, default=uuid.uuid4)
name = models.CharField(
verbose_name='Имя автора',
max_length=200,
validators=[validators.RegexValidator(regex='^.*en$',message='Wrong')]
)
age = models.PositiveBigIntegerField(verbose_name='Возраст автора')
email = models.EmailField(verbose_name='Почта автора',)
lit_tupe = models.CharField(max_length=1, verbose_name='Тип литиратуры',choices=TYPES, default='a')
def __str__(self):
return self.name
class Book(models.Model):
class Meta:
get_latest_by = 'published'
title = models.CharField(max_length=200)
descripting = models.TextField()
page_num = models.PositiveIntegerField()
published = models.DateTimeField(auto_now_add=True)
def __str__(self):
return self.title
Появляется вот такая ошибка:
TypeError: 'class Meta' got invalid attribute(s): verbase_name,verbase_name_plural