Skip to content

Commit

Permalink
feat: Reformer SignUp Add contest freelancer etc (#20)
Browse files Browse the repository at this point in the history
Co-authored-by: SeoJimin <jnuni004@naver.com>
  • Loading branch information
SeoJimin1234 and SeoJimin authored Feb 3, 2024
1 parent b0bc130 commit 4d0e831
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Generated by Django 4.0 on 2024-02-03 05:35

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('users', '0009_material_user_special_material'),
]

operations = [
migrations.AddField(
model_name='user',
name='contest_ability',
field=models.TextField(blank=True, null=True),
),
migrations.AddField(
model_name='user',
name='contest_certification',
field=models.FileField(blank=True, null=True, upload_to=''),
),
migrations.AddField(
model_name='user',
name='etc_ability',
field=models.TextField(blank=True, null=True),
),
migrations.AddField(
model_name='user',
name='etc_certification',
field=models.FileField(blank=True, null=True, upload_to=''),
),
migrations.AddField(
model_name='user',
name='freelancer_ability',
field=models.TextField(blank=True, null=True),
),
migrations.AddField(
model_name='user',
name='freelancer_certification',
field=models.FileField(blank=True, null=True, upload_to=''),
),
]
12 changes: 12 additions & 0 deletions users/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,24 @@ class User(AbstractBaseUser, PermissionsMixin):

#리폼러 가입시 필요 필드
area = models.CharField(max_length=50, blank=True, null=True)
#학력
school_ability = models.TextField(blank=True, null=True)
school_certification = models.FileField(blank=True, null=True)
#실무,인턴
career_ability = models.TextField(blank=True, null=True)
career_certification = models.FileField(blank=True, null=True)
#자격증
license_ability = models.TextField(blank=True, null=True)
license_certification = models.FileField(blank=True, null=True)
#프리랜서
freelancer_ability = models.TextField(blank=True, null=True)
freelancer_certification = models.FileField(blank=True, null = True)
#공모전
contest_ability = models.TextField(blank=True, null=True)
contest_certification = models.FileField(blank=True, null = True)
#기타
etc_ability = models.TextField(blank=True, null=True)
etc_certification = models.FileField(blank=True, null = True)
work_style = models.ManyToManyField("users.Style", related_name = 'styled_refomers', blank=True)
links = models.TextField(blank=True, null=True)
market_name = models.CharField(max_length=50, blank=True, null=True)
Expand Down
12 changes: 12 additions & 0 deletions users/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ def reformer_sign_up(
career_certification : InMemoryUploadedFile,
license_ability : str,
license_certification: InMemoryUploadedFile,
freelancer_ability : str,
freelancer_certification: InMemoryUploadedFile,
contest_ability : str,
contest_certification: InMemoryUploadedFile,
etc_ability : str,
etc_certification: InMemoryUploadedFile,
special_material : list[str],
):

Expand All @@ -78,6 +84,12 @@ def reformer_sign_up(
career_certification = career_certification,
license_ability = license_ability,
license_certification = license_certification,
freelancer_ability = freelancer_ability,
freelancer_certification = freelancer_certification,
contest_ability = contest_ability,
contest_certification = contest_certification,
etc_ability = etc_ability,
etc_certification = etc_certification,
)

user.set_password(password)
Expand Down
12 changes: 12 additions & 0 deletions users/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ class ReformerSignupInputSerializer(serializers.Serializer):
career_certification = serializers.FileField(required = False)
license_ability =serializers.CharField(required = False)
license_certification = serializers.FileField(required = False)
freelancer_ability =serializers.CharField(required = False)
freelancer_certification = serializers.FileField(required = False)
contest_ability =serializers.CharField(required = False)
contest_certification = serializers.FileField(required = False)
etc_ability =serializers.CharField(required = False)
etc_certification = serializers.FileField(required = False)
special_material = serializers.ListField(required = False)

def post(self, request):
Expand All @@ -61,6 +67,12 @@ def post(self, request):
career_certification = data.get('career_certification', None),
license_ability =data.get('license_ability', None),
license_certification = data.get('license_certification', None),
freelancer_ability =data.get('license_ability', None),
freelancer_certification = data.get('license_certification', None),
contest_ability =data.get('license_ability', None),
contest_certification = data.get('license_certification', None),
etc_ability =data.get('license_ability', None),
etc_certification = data.get('license_certification', None),
special_material = data.get('special_material', []),
)

Expand Down

0 comments on commit 4d0e831

Please sign in to comment.