我有以下型號: from django.contrib.sites.models import Site
class Entity(models.Model):
name = models.CharField('Name', max_length=64)
desc = models.TextField('Description',)
tags
我的模型: class Car:
name = models.CharField(max_length=50, blank=True, default='')
class Wheel:
name = models.CharField(max_length=50, blank=True, default='')
cars = models.ManyToManyFi
我想創建交叉銷售產品: class Product(models.Model):
name = models.CharField(max_length=150, blank=True, default='')
...
class CrossSellingProduct(models.Model)
parent_product = models.ForeignKey
我有這些模型, class Place(models.Model):
name = models.CharField(max_length=200)
user = models.ForeignKey(User, on_delete=models.CASCADE,
related_name='places', default=1)
subscribers =
我在DRF中使用帶有貫穿模型的m2m字段。一切工作正常,除了當我嘗試嵌套會員串行器。 models.py class SweepStakes(models.Model):
name = models.CharField(max_length=255)
class Event(models.Model):
我有哪裏登錄的用戶可以顯示在發佈感興趣的M2M領域以下模型: models.py from django.db import models
class Publication:
title = models.CharField(max_lenth=512)
users_interested = models.ManyToManyField(User)
views.py