from django.db import models
from django.contrib.auth.models import User, AbstractUser, UserManager
from django.utils.translation import ugettext_lazy as _


class customer(AbstractUser):
    avatar = models.ImageField(upload_to='avatars/', blank=True, null=True,
        default='avatars/57e16d9e6e91d157489432f5.png', verbose_name='Аватар')
    description = models.CharField(max_length=255, verbose_name='О себе',
        blank=True, null=True)
    objects = UserManager()


    class Meta:
        db_table = 'Customer'
        verbose_name = _('Профиль пользователей')
        verbose_name_plural = _('Профили пользователей')


customer._meta.get_field('username').verbose_name = 'Имя пользователя'
customer._meta.get_field('first_name').verbose_name = 'Имя'
customer._meta.get_field('last_name').verbose_name = 'Фамилия'


class Picture(models.Model):
    name = models.CharField(max_length=80, verbose_name='Название')
    description = models.CharField(max_length=255, verbose_name='Описание')
    price = models.IntegerField(verbose_name='Стоимость')
    author = models.CharField(max_length=100, verbose_name='Автор', default
        ='Не указан')
    like = models.ManyToManyField(customer, verbose_name='Лайки', default=0,
        blank=True)
    image = models.ImageField(upload_to='pics/', blank=True, null=True,
        default='pics/111.jpg', verbose_name='Изображение')

    def total_likes(self):
        return self.like.count()


    class Meta:
        db_table = 'Picture'
        verbose_name = _('Картина')
        verbose_name_plural = _('Картины')

21bd4a96cde7666394b414b795907a51d6784c40
<mask token>


class customer(AbstractUser):
    <mask token>
    <mask token>
    <mask token>


    class Meta:
        db_table = 'Customer'
        verbose_name = _('Профиль пользователей')
        verbose_name_plural = _('Профили пользователей')


<mask token>


class Picture(models.Model):
    name = models.CharField(max_length=80, verbose_name='Название')
    description = models.CharField(max_length=255, verbose_name='Описание')
    price = models.IntegerField(verbose_name='Стоимость')
    author = models.CharField(max_length=100, verbose_name='Автор', default
        ='Не указан')
    like = models.ManyToManyField(customer, verbose_name='Лайки', default=0,
        blank=True)
    image = models.ImageField(upload_to='pics/', blank=True, null=True,
        default='pics/111.jpg', verbose_name='Изображение')

    def total_likes(self):
        return self.like.count()


    class Meta:
        db_table = 'Picture'
        verbose_name = _('Картина')
        verbose_name_plural = _('Картины')

<mask token>


class customer(AbstractUser):
    avatar = models.ImageField(upload_to='avatars/', blank=True, null=True,
        default='avatars/57e16d9e6e91d157489432f5.png', verbose_name='Аватар')
    description = models.CharField(max_length=255, verbose_name='О себе',
        blank=True, null=True)
    objects = UserManager()


    class Meta:
        db_table = 'Customer'
        verbose_name = _('Профиль пользователей')
        verbose_name_plural = _('Профили пользователей')


<mask token>


class Picture(models.Model):
    name = models.CharField(max_length=80, verbose_name='Название')
    description = models.CharField(max_length=255, verbose_name='Описание')
    price = models.IntegerField(verbose_name='Стоимость')
    author = models.CharField(max_length=100, verbose_name='Автор', default
        ='Не указан')
    like = models.ManyToManyField(customer, verbose_name='Лайки', default=0,
        blank=True)
    image = models.ImageField(upload_to='pics/', blank=True, null=True,
        default='pics/111.jpg', verbose_name='Изображение')

    def total_likes(self):
        return self.like.count()


    class Meta:
        db_table = 'Picture'
        verbose_name = _('Картина')
        verbose_name_plural = _('Картины')

<mask token>


class customer(AbstractUser):
    avatar = models.ImageField(upload_to='avatars/', blank=True, null=True,
        default='avatars/57e16d9e6e91d157489432f5.png', verbose_name='Аватар')
    description = models.CharField(max_length=255, verbose_name='О себе',
        blank=True, null=True)
    objects = UserManager()


    class Meta:
        db_table = 'Customer'
        verbose_name = _('Профиль пользователей')
        verbose_name_plural = _('Профили пользователей')


customer._meta.get_field('username').verbose_name = 'Имя пользователя'
customer._meta.get_field('first_name').verbose_name = 'Имя'
customer._meta.get_field('last_name').verbose_name = 'Фамилия'


class Picture(models.Model):
    name = models.CharField(max_length=80, verbose_name='Название')
    description = models.CharField(max_length=255, verbose_name='Описание')
    price = models.IntegerField(verbose_name='Стоимость')
    author = models.CharField(max_length=100, verbose_name='Автор', default
        ='Не указан')
    like = models.ManyToManyField(customer, verbose_name='Лайки', default=0,
        blank=True)
    image = models.ImageField(upload_to='pics/', blank=True, null=True,
        default='pics/111.jpg', verbose_name='Изображение')

    def total_likes(self):
        return self.like.count()


    class Meta:
        db_table = 'Picture'
        verbose_name = _('Картина')
        verbose_name_plural = _('Картины')

from django.db import models
from django.contrib.auth.models import User, AbstractUser, UserManager
from django.utils.translation import ugettext_lazy as _


class customer(AbstractUser):
    avatar = models.ImageField(upload_to='avatars/', blank=True, null=True,
        default='avatars/57e16d9e6e91d157489432f5.png', verbose_name='Аватар')
    description = models.CharField(max_length=255, verbose_name='О себе',
        blank=True, null=True)
    objects = UserManager()


    class Meta:
        db_table = 'Customer'
        verbose_name = _('Профиль пользователей')
        verbose_name_plural = _('Профили пользователей')


customer._meta.get_field('username').verbose_name = 'Имя пользователя'
customer._meta.get_field('first_name').verbose_name = 'Имя'
customer._meta.get_field('last_name').verbose_name = 'Фамилия'


class Picture(models.Model):
    name = models.CharField(max_length=80, verbose_name='Название')
    description = models.CharField(max_length=255, verbose_name='Описание')
    price = models.IntegerField(verbose_name='Стоимость')
    author = models.CharField(max_length=100, verbose_name='Автор', default
        ='Не указан')
    like = models.ManyToManyField(customer, verbose_name='Лайки', default=0,
        blank=True)
    image = models.ImageField(upload_to='pics/', blank=True, null=True,
        default='pics/111.jpg', verbose_name='Изображение')

    def total_likes(self):
        return self.like.count()


    class Meta:
        db_table = 'Picture'
        verbose_name = _('Картина')
        verbose_name_plural = _('Картины')
