Feat: [#64] now_worker 추가, thumbnail, code_id 수정

This commit is contained in:
sm4640
2025-06-05 18:22:38 +09:00
parent c693acf79d
commit 0b413322f9
2 changed files with 12 additions and 6 deletions

View File

@@ -3,7 +3,7 @@ from django.db import models
from common.models.baseModels import BaseModel
from common.models.choiceModels import InvitationStatus
from common.utils.fileManager import dynamic_upload_to
from common.utils.fileManager import DynamicUploadTo
from django.contrib.postgres.fields import ArrayField
from django.conf import settings
@@ -12,6 +12,8 @@ from notifications.models import Notification
from users.models import User
NICKNAME_LEN = 20
class Project(BaseModel):
title = models.CharField(max_length=20)
is_team = models.BooleanField(default=False)
@@ -22,8 +24,9 @@ class Project(BaseModel):
like_count = models.IntegerField(default=0)
scrap_count = models.IntegerField(default=0)
is_represent = models.BooleanField(default=False)
thumbnail = models.ImageField(upload_to=dynamic_upload_to('project', lambda instance: 'thumbnail'), blank=True)
code_id = models.CharField(max_length=26, blank=True)
now_worker = models.CharField(max_length=NICKNAME_LEN, blank=True)
thumbnail = models.ImageField(upload_to=DynamicUploadTo("project", "thumbnail"), null=True, blank=True)
code_id = models.CharField(max_length=26, null=True, blank=True)
owner = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE, related_name='owned_projects', to_field="id")
likers = models.ManyToManyField(settings.AUTH_USER_MODEL, related_name='liked_projects', blank=True)
scrappers = models.ManyToManyField(settings.AUTH_USER_MODEL, related_name='scrapped_projects', blank=True)