stephenmcd/django-forms-builder — Issue #50: Migration error in South
Author: georgema1982
Created: 2012-02-18 23:07:04+00:00
State: open

I'm using South to migrate the database. But encountered the following error:

SouthFieldClass(default=[], to=orm['sites.Site'], symmetrical=False)
^
SyntaxError: invalid syntax

I think the cause is the following definition:

def default_sites():
return [Site.objects.get_current()]
sites_field = models.ManyToManyField(Site, default=default_sites)

It somehow generates {'default': '[]', 'to': "orm['sites.Site']", 'symmetrical': 'False'} in migration file.