我正在尝试使用Django guardian和groups设置对象级权限;在这里,我将权限授予组,而不是用户,并根据需要在组中添加/删除用户。例如,在example in the django-guardian-docs的基础上构建,理想情况下应该是这样的: >>> joe.has_perm_from_groups('sites.change_site
我可以添加哪些代码来过滤电子邮件是否已经存在或不是forms.py from django.forms import ModelFormfromdjango.contrib.auth.models import Userfrom django.core.exceptionsclass NewUser(ModelForm):
model = A