Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated scholardb and taken-lecture import scripts to expand semesters #842

Merged
merged 21 commits into from
Oct 5, 2021

Conversation

zealotzealot
Copy link
Member

@zealotzealot zealotzealot commented Sep 29, 2021

계절학기 과목이 자동으로 업데이트되지 않는 문제를 해결하기 위한 수정사항입니다.

  • 기존 --year과 --semester이 주어지지 않으면 자동으로 기본 학기를 대상으로 하던 것을 --use-default-semester을 추가해 명시적으로 선언하게 변경
    • --year, --semester, --use-default-semester 중 아무것도 주어지지 않으면 command가 실행되지 않게 변경
  • --expand-semester-by 옵션 추가. 명시된 학기에서 해당 offset만큼 사이에 해당되는(inclusive, 오름차순) 모든 학기에 대해 import를 실행함.

자동으로 매일 돌아가는 스크립트는 '--use-default-semester --expand-semester-by=-1' 로 돌아갈 예정입니다.
--expand-semester-by가 -1인 이유는 계절학기가 시작되기 전 그 다음 정규학기로 default-semester가 넘어가기 떄문입니다.

Copy link
Contributor

@kimjson kimjson left a comment

Choose a reason for hiding this comment

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

궁금한 점 있으시면 언제든 슬랙으로 질문 주시거나 줌 요청 주셔도 좋습니다. @zealotzealot

apps/subject/management/commands/import-scholardb.py Outdated Show resolved Hide resolved
apps/subject/management/commands/import-scholardb.py Outdated Show resolved Hide resolved
apps/subject/management/commands/import-scholardb.py Outdated Show resolved Hide resolved
apps/subject/management/commands/import-scholardb.py Outdated Show resolved Hide resolved
apps/subject/management/commands/import-scholardb.py Outdated Show resolved Hide resolved
apps/subject/management/commands/import-scholardb.py Outdated Show resolved Hide resolved
apps/subject/management/commands/import-taken-lecture.py Outdated Show resolved Hide resolved
apps/subject/management/commands/import-taken-lecture.py Outdated Show resolved Hide resolved
apps/subject/models.py Outdated Show resolved Hide resolved
apps/subject/models.py Outdated Show resolved Hide resolved
@zealotzealot
Copy link
Member Author

두 스크립트의 본문(쿼리 후 업데이트하는 부분) 같은 경우는 추후에 아에 싹 새로 짤 계획이라서 본문 내용은 일부러 건드리지 않았습니다
import-scholardb같은 경우에는 구 otl(검은색 otl)부터 쓰던 스크립트인데 마이너한 부분을 제외하면 건드리지를 않아서 아마 현 otl 코드에서 가장 오래된 부분일 것 같습니다. 전반적으로 개선할 점이 있어서 자세히 뜯어보고 아예 처음부터 새로 짜면 좋을 것 같아요
import-taken-lecture 같은 경우에도 학기에 대해서 불러오는 import-taken-lecture과 유제에 대해서 불러오는 import-taken-lecture이 나누어져 있어서 이것도 argument를 다르게 받는 식으로 하나로 통합해야 할 것 같습니다.
그래서 본문 쪽은 따로 갈아엎을 예정이라 세부적인 부분을 굳이 지금 다듬어 줄 필요가 있나 싶습니다

@zealotzealot
Copy link
Member Author

두 스크립트의 본문(쿼리 후 업데이트하는 부분) 같은 경우는 추후에 아에 싹 새로 짤 계획이라서 본문 내용은 일부러 건드리지 않았습니다
import-scholardb같은 경우에는 구 otl(검은색 otl)부터 쓰던 스크립트인데 마이너한 부분을 제외하면 건드리지를 않아서 아마 현 otl 코드에서 가장 오래된 부분일 것 같습니다. 전반적으로 개선할 점이 있어서 자세히 뜯어보고 아예 처음부터 새로 짜면 좋을 것 같아요
import-taken-lecture 같은 경우에도 학기에 대해서 불러오는 import-taken-lecture과 유제에 대해서 불러오는 import-taken-lecture이 나누어져 있어서 이것도 argument를 다르게 받는 식으로 하나로 통합해야 할 것 같습니다.
그래서 본문 쪽은 따로 갈아엎을 예정이라 세부적인 부분을 굳이 지금 다듬어 줄 필요가 있나 싶습니다

라고 했지만 당장 구린 부분은 바꿔 두어도 나중에 수정할 때 편할 것 같긴 하네요
4056ed9 7a761f3 a49fc61 에 수정해 두었습니다

Copy link
Contributor

@kimjson kimjson left a comment

Choose a reason for hiding this comment

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

답글 남긴 거 확인해주시겠어요?

@zealotzealot
Copy link
Member Author

답글 남긴 거 확인해주시겠어요?

확인 후 수정했습니다. 확인 부탁드려요

@zealotzealot zealotzealot merged commit cd19229 into develop Oct 5, 2021
@zealotzealot zealotzealot deleted the feature/import-default branch October 6, 2021 02:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants