📜  django 防止重复条目 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:37.364000             🧑  作者: Mango

代码示例3
from django.db.models import Count
from app.models import Email

duplicate_emails = Email.objects.values('email').annotate(email_count=Count('email')).filter(email_count__gt=1)