No Longer Coder

    M:N 1

    [Django DRF] Serializer에서 id를 사용한 M:N 관계

    Django REST Framework(DRF)에서 Many-to-Many(M:N) 관계 Book과 Author 모델이 M:N 관계에 있다고 가정 Book 모델이 여러 Author를 가질 수 있고, 반대로 Author도 여러 Book을 가질 수 있는 상황 이미 작성된 author를 사용한다고 가정 # models.py from django.db import models class Author(models.Model): id = models.IntegerField(primary_key=True) name = models.CharField(max_length=100) class Book(models.Model): title = models.CharField(max_length=100) authors = mo..

    Today_I_Learned 2023.11.13
    이전
    1
    다음
    더보기
    프로필사진

    Code Snippets

    • 분류 전체보기 (83)
      • Today_I_Learned (10)
      • Problem_Solving (73)

    Tag

    BOJ, 자바, 프로그래머스, 순열, 다이나믹프로그래밍, 알고리즘, 재귀, 문자열, java, 2차원배열, 백준, binarysearch, python, 코딩테스트, 이분탐색, 자료구조, 완전탐색, PS, 파이썬, 정렬,

    최근글과 인기글

    • 최근글
    • 인기글

    Archives

    Calendar

    «   2025/07   »
    일 월 화 수 목 금 토
    1 2 3 4 5
    6 7 8 9 10 11 12
    13 14 15 16 17 18 19
    20 21 22 23 24 25 26
    27 28 29 30 31

    방문자수Total

    • Today :
    • Yesterday :

    Copyright © Kakao Corp. All rights reserved.

    티스토리툴바