我有 2 个配置文件模型。我正在创建一个“参加者”对象。如何仅在 2 个配置文件之间进行过滤?
class Profile1(models.Model):
user = models.ForeignKey(User, null=True, unique=True)
class Profile2(models.Model):
user = models.ForeignKey(User, null=True, unique=True)
class Attendee(models.Model):
event = models.ForeignKey(Event)
# This filters through everything... How do I filter down just to the 2 profile objects?
content_type = models.ForeignKey(ContentType)
object_id = models.PositiveIntegerField()
profile = generic.GenericForeignKey('content_type', 'object_id')
谢谢你的帮助!