嗨,有可能是模型有一个ManyToManyField与所有可用的应用程序作为其选择?Django多对多可用app_labels现场
比方说,我在我的settings.py在INSTALLED_APPS这些应用
然后在我的models.py我有这个模型
class IPAddreses(models.Model):
ip = models.GenericIPAddressField()
apps = models.ManyToManyField(ContentType, blank=True)
# The apps field should be the choices of the avialable apps on the settings.py
这可能吗?
出于好奇,你的用例是什么? – Udi
要启用IPAddress白名单上的每个应用程序认证 –
另请参阅:https://docs.djangoproject.com/en/1.10/topics/auth/default/#programmatically-creating-permissions – Udi