models.py 578 B

12345678910111213141516171819
  1. from django.contrib.auth.models import AbstractUser
  2. from django.db import models
  3. # class User(AbstractUser):
  4. # avatar = models.ImageField(upload_to='media/profiles')
  5. class Product(models.Model):
  6. name = models.CharField(max_length=256)
  7. opisanie = models.TextField(max_length=999)
  8. price = models.DecimalField(max_digits=50, decimal_places=2)
  9. image = models.ImageField(upload_to='media/product')
  10. types = (
  11. ('Услуги', 'Услуги'),
  12. ('Товари', 'Товари')
  13. )
  14. type = models.CharField(max_length=6, choices=types)