Skip to content

refactor: 일정 만들기 주소 추가#35

Merged
bmh7190 merged 5 commits intomainfrom
feat/#5-코스만들기,조회,수정,삭제
Feb 15, 2025

Hidden character warning

The head ref may contain hidden characters: "feat/#5-\ucf54\uc2a4\ub9cc\ub4e4\uae30,\uc870\ud68c,\uc218\uc815,\uc0ad\uc81c"
Merged

refactor: 일정 만들기 주소 추가#35
bmh7190 merged 5 commits intomainfrom
feat/#5-코스만들기,조회,수정,삭제

Conversation

@bmh7190
Copy link
Contributor

@bmh7190 bmh7190 commented Feb 15, 2025

Related issue 🚀

  • closed #{이슈_번호}

Work Description 💚

  • 그냥 간단하게 모델에서 주소를 추가해줬습니다!
  • 근데 문제가 있는게 세부 일정 생성할 때 아예 0번부터 시작한단 말이죠?! 0번이 만날 장소고,, 그게 겹치는게 걸립니다! 아예 만날 장소 자체를 0번 세부 일정으로 들어가게 해야할지..? 아니면 그대로 냅둘지!
  • 만약 세부 일정으로 자동 생성하게 되면,,api를 싹 갈아엎어야 할 수도 있을거 같슴다!

image
image

  • 일정 관련한 모든 API 토큰으로 유저 정보 받도록 해줬습니다!

PR 참고 사항

  • 모델 지금 보니까 일정 이름은 필수로 입력해야 되더라구요! postman에서 일정 이름 없이 post요청 보내는건 되는데 장고 어드민 페이지에서 보니까 코스이름을 리턴하게 되어있어서 그런지 입력 안 하면 null로 되고, 그래서 리턴 값이 없으면 오류가 나는거 같습니다! 이 부분 확인해주세요!

@bmh7190 bmh7190 requested a review from fivedasol February 15, 2025 13:31
@bmh7190 bmh7190 self-assigned this Feb 15, 2025
raise serializers.ValidationError("유효한 사용자 정보를 찾을 수 없습니다.")

user = request.user # request.user 사용

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

여기서 http body로 user_id로 받던거 수정했습니다!


serializer = CreateCourseSerializser(data=request.data, context={'request': request})
serializer = CreateCourseSerializer(data=request.data, context={'request': request})

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

시리얼라이저 오타가 있길래 그것도 수정해줬어요!

'SIGNING_KEY': 'hellomakourse',
'ACCESS_TOKEN_LIFETIME': timedelta(hours=1),
'ACCESS_TOKEN_LIFETIME': timedelta(days=30),
'REFRESH_TOKEN_LIFETIME': timedelta(days=7),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Accesstoken 기한 30일로 변경해서 개발하는데 편리하게 해줬습니다!

@fivedasol
Copy link
Contributor

수정한 코드들은 모두 괜찮은거 같습니다!
일정 순번같은 경우는 세부일정들을 0이 아니라 1부터 시작하는걸로 변경하는건 어떨까요??

그리고 일정 이름은 null로 뜨지 않게 처음 사용자가 이름을 정하기 않았더라면 defalut로 생성일자를 이름으로 설정하든지 아니면 "이름을 정해주세요"라는걸로 해넣든지 하는건 어떻게 생각하시나요??
피그마를 보면 처음에 일정만들때 날짜만 정하고 생성하는걸로 되어있어서요..!!

@bmh7190
Copy link
Contributor Author

bmh7190 commented Feb 15, 2025

아하 default 값 정해주는거 좋은거 같습니다! "이름을 정해주세요"로 하겠습니다! 그리고 1번부터 시작하도록 지정해불게요!

meet_date_third = models.DateTimeField(null=True , blank= True)
course_name = models.CharField(max_length=20, null=True, blank= True)
course_name = models.CharField(max_length=20, blank=True, default="일정 이름을 정해주세요")
meet_place = models.CharField(max_length=50, null=True, blank= True)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

여기 "일정 이름을 정해주세요" 로 default값을 수정했슴다!

if not self.entry_name:
self.entry_name = f"{self.num}번째 일정"

super().save(*args, **kwargs) # 부모 클래스의 save 호출
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

여기서 1번 부터 시작하도록 바꿔줬고, 위와 같은 이유로 default 값을 지정해줬습니다!

@fivedasol
Copy link
Contributor

확인했습니다! 머지해도 될거같아요
수고하셨습니다~!

@bmh7190 bmh7190 merged commit aee3bec into main Feb 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants