I have model People:
with name, phone email, address fields
using Django's management commands I want populate Contact model
with the same fields
command file: from django.core.management.base import BaseCommand
class Command(BaseCommand):
help = 'Sorting leads '
def handle(self, *args, **kwargs):
pass
1.Multiple People with the same name and phone number should be merged together, so the resulting Contact contains all emails and addresses from merged Leads. 2. Multiple People with the same name, but different phone number and e-mail should be saved as separate contacts
How have I do it ? Should I do with raw sql or there is better solution.