📜  django 模型删除重复项 - Python 代码示例

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

代码示例2
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)