[Answer]-Django: Create connection between old and new application model

1👍

Run a SQL query in your favorite database manager that creates records for all the existing User records.

0👍

Instead of doing from MySql you could also do it from the django shell. Access all the records from the old user base as a query list and then create a my_object for them. As answered above there is no need for setting the signal, as the task has to be done only once. Also such an app based signal, if possible would be more cumbersome to do.

old_users = Old_users.objects.all() for user in old_users:
    object = my_object(user = user)
    object.save()

By the way, how have you added the old users to django user?

👤Sachin

Leave a comment