You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

36 lines
1.1 KiB

# coding: utf-8
from django.db import models
from users.models import CustomUser
from specialization.models import Specialization
class Project(models.Model):
name = models.CharField(max_length=255)
price = models.DecimalField(max_digits=10, decimal_places=2)
text = models.TextField(blank=True)
# type_work = models.CharField()
# budget = models.CharField()
# cro = models.BooleanField(default=False)
user = models.ForeignKey(CustomUser, related_name='customers')
specialization = models.ForeignKey(Specialization, related_name='spec', null=True)
def __str__(self):
return self.name
class Meta:
verbose_name = 'Проект'
verbose_name_plural = 'Проекты'
class Portfolio(models.Model):
name = models.CharField(max_length=255)
description = models.TextField()
user = models.ForeignKey(CustomUser)
def __str__(self):
return self.name
class PortfolioPhoto(models.Model):
img = models.ImageField(upload_to='projects/portfolio')
portfolio = models.ForeignKey(Portfolio)
# def __str__(self):
# return self.img