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.
39 lines
1.1 KiB
39 lines
1.1 KiB
from django.db import models
|
|
|
|
from users.models import User
|
|
from specializations.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(User, related_name='projects')
|
|
specialization = models.ForeignKey(Specialization, related_name='projects', blank=True, null=True) # TODO: Make required
|
|
|
|
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(User)
|
|
|
|
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
|
|
|