Last active
September 6, 2019 01:14
-
-
Save ryu22e/536d70391f695fb3184a8d84328773b6 to your computer and use it in GitHub Desktop.
SQLアンチパターン for Django 1章 ジェイウォーク(信号無視)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""悪い例""" | |
from django.db import models | |
class Product(models.Model): | |
name = models.CharField(max_length=1000) | |
account_id = models.CharField(max_length=100) # カンマ区切りでIDを入れる(例: '1,2,3') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""良い例""" | |
from django.conf import settings | |
from django.db import models | |
class Product(models.Model): | |
name = models.CharField(max_length=1000) | |
account_id = models.ManyToManyField( | |
to=settings.AUTH_USER_MODEL, | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment