不同的应用程序间创建ManyToManyField

from django.db import models
from games.models import Game, Genre
from shots.utils import get_unique_slug
from django.utils import timezone

...

model for streamer

class Streamer(models.Model):
nick = models.CharField(max_length=30)
twitch = models.CharField(max_length=70)
games = models.ManyToManyField('games.Game')
...

人生苦短,我用python
原文地址:https://www.cnblogs.com/niucunguo/p/15409612.html