본문 바로가기 메뉴 바로가기

마스터링

프로필사진
  • 글쓰기
  • 관리
  • 태그
  • 방명록
  • RSS

마스터링

검색하기 폼
  • 분류 전체보기 (60)
    • LANGUAGE (8)
      • go (2)
      • python (5)
    • DEV (16)
      • various knowledge (6)
      • Django (8)
      • nginx (1)
      • electron (1)
      • javascript (0)
    • OPS (1)
      • Docker (1)
    • ALGORITHM (24)
      • Programmers (12)
      • BOJ (3)
      • LeetCode (4)
    • 책리뷰 (4)
  • 방명록

ManyToMany (1)
[Django] ManyToManyField

ManyToManyField django에서 다대다 관계는 ManyToManyField로 표현할 수 있습니다. 간단하게 고객과 아이스크림의 관계를 ManyToManyField로 표현 해보겠습니다. ManyToManyField 예제 class Customer(models.Model): name = models.CharField(max_length=20) def __str__(self): return self.name class Icecream(models.Model): name = models.CharField(max_length=20) customer = models.ManyToManyField(Customer, related_name="favorite_icecream") def __str__(self)..

DEV/Django 2022. 3. 21. 23:33
이전 1 다음
이전 다음
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
TAG
  • print
  • Two Scoops of Django
  • go context
  • ManyToMany
  • conTeXt
  • taggit
  • dfs
  • django
  • stdout
  • 파이썬
  • go
  • 소프트웨어 장인
  • gunicorn
  • 독후감
  • 문자열 뒤집기
  • for-else
  • 의대 신경학 강의
  • Python
  • 프로그래머스
  • sql lite
  • 팰린드롬수
  • 방금그곡
  • query
  • 백준
  • leetcode
more
«   2025/05   »
일 월 화 수 목 금 토
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
글 보관함

Blog is powered by Tistory / Designed by Tistory

티스토리툴바