Skip to content

Instantly share code, notes, and snippets.

@shofetim
Created February 8, 2013 19:17
Show Gist options
  • Select an option

  • Save shofetim/4741248 to your computer and use it in GitHub Desktop.

Select an option

Save shofetim/4741248 to your computer and use it in GitHub Desktop.
class Migration(DataMigration):
def forwards(self, orm):
Vendor = orm['vendor.Vendor']
Customer = orm['customers.Customer']
for vendor in Vendor.objects.all():
user, customer = Customer.create_user_and_customer(is_active=True)
vendor.customer = customer
vendor.save()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment