작성
·
175
0
답변 1
1
안녕하세요.
동일한 모델필드를 가지는 모델 클래스가 다수 있을 경우, 모델의 abstract 기능을 활용해보실 수 있습니다.
https://docs.djangoproject.com/en/4.0/topics/db/models/#abstract-base-classes
user, report_content 필드를 상위 abstract model로 생성하고, UserReport, CommentReport, ReCommentreport 에서는 이 abstract model을 상속받고, 각각 reported_user, reported_comment, reported_recomment 필드만 정의하는 거죠.
화이팅입니다. :-)
정말 감사합니다 선생님!!!!