Skip to content

Instantly share code, notes, and snippets.

@jan-matejka
Created October 11, 2012 11:14
Show Gist options
  • Select an option

  • Save jan-matejka/3871695 to your computer and use it in GitHub Desktop.

Select an option

Save jan-matejka/3871695 to your computer and use it in GitHub Desktop.
class Migration(DataMigration):
def forwards(self, orm):
"Write your forwards methods here."
log.debug("start")
for order in orm['order.order'].objects.filter(number=None):
log.debug("%s %s %s", order, order.id, order.number)
order.save()
# Note: Remember to use orm['appname.ModelName'] rather than "from appname.models..."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment