Hi David,
The python functionality is there so that you can manipulate the models directly or run more complex dynamic sql if you need to. Let's say that your app is called "myapp" and you want to do something special to all User records with an aol email address, but that something special is easier to do in python than it is in sql. Your app structure should look like this : myapp/ migrations/ __init__.py migrator.py The content of migrator.py could be : migration_list = ['migration1',] def migration1(): # python code that you need to run to complete the migration goes here # e.g. from django.contrib.auth.models import User users = User.objects.filter(email_address__endswith='@aol.com') for user in users: # do something to the user here and save Hope that helps. Mike On 4/20/2007, "David Marko" <[EMAIL PROTECTED]> wrote: > >How can 'Python migrations' be used? Can someone explain or place some >example? Where should I put the function? > >--- excerpt from docs --- >Using Python migrations >Sometimes it might be easier to do your migration using Python and the >Django models. To define a python migration, simply define a function >with the same name as the migration in migrator.py > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---