21 lines
835 B
Python
21 lines
835 B
Python
from django.db import models
|
|
|
|
from common.models.baseModels import BaseModel
|
|
|
|
from django.contrib.postgres.fields import ArrayField
|
|
from django.conf import settings
|
|
|
|
from users.models import User
|
|
|
|
|
|
class Portfolio(BaseModel):
|
|
name = models.CharField(max_length=20)
|
|
category = ArrayField(models.CharField(max_length=20), default=list)
|
|
is_published = models.BooleanField(default=False)
|
|
view_count = models.IntegerField(default=0)
|
|
like_count = models.IntegerField(default=0)
|
|
scrab_count = models.IntegerField(default=0)
|
|
is_represent = models.BooleanField(default=False)
|
|
thumbnail = models.ImageField(upload_to='', blank=True)
|
|
code_id = models.CharField(max_length=26, blank=True)
|
|
user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE, related_name='portfolios', to_field="id") |