Package: python-django-south
Version: 0.7.3-1
Severity: normal

My model has:
from django.db import models
from django.utils import timezone
...
class Valve(m.Model):
    time = models.DateTimeField(default=timezone.now)

South doesn't understand this.

In fact, South should simply ignore computed defaults altogether.
They're not part of the database schema, after all.

$ ./manage.py migrate rainman
Running migrations for rainman:
 - Migrating forwards to 0003_auto__add_rainmeter.
 > rainman:0003_auto__add_rainmeter
Traceback (most recent call last):
  File "./manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/lib/python2.7/dist-packages/django/core/management/__init__.py", 
line 443, in execute_from_command_line
    utility.execute()
  File "/usr/lib/python2.7/dist-packages/django/core/management/__init__.py", 
line 382, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/lib/python2.7/dist-packages/django/core/management/base.py", line 
196, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/usr/lib/python2.7/dist-packages/django/core/management/base.py", line 
232, in execute
    output = self.handle(*args, **options)
  File "/usr/lib/pymodules/python2.7/south/management/commands/migrate.py", 
line 105, in handle
    ignore_ghosts = ignore_ghosts,
  File "/usr/lib/pymodules/python2.7/south/migration/__init__.py", line 191, in 
migrate_app
    success = migrator.migrate_many(target, workplan, database)
  File "/usr/lib/pymodules/python2.7/south/migration/migrators.py", line 221, 
in migrate_many
    result = migrator.__class__.migrate_many(migrator, target, migrations, 
database)
  File "/usr/lib/pymodules/python2.7/south/migration/migrators.py", line 292, 
in migrate_many
    result = self.migrate(migration, database)
  File "/usr/lib/pymodules/python2.7/south/migration/migrators.py", line 125, 
in migrate
    result = self.run(migration)
  File "/usr/lib/pymodules/python2.7/south/migration/migrators.py", line 93, in 
run
    south.db.db.current_orm = self.orm(migration)
  File "/usr/lib/pymodules/python2.7/south/migration/migrators.py", line 246, 
in orm
    return migration.orm()
  File "/usr/lib/pymodules/python2.7/south/utils.py", line 62, in method
    value = function(self)
  File "/usr/lib/pymodules/python2.7/south/migration/base.py", line 422, in orm
    return FakeORM(self.migration_class(), self.app_label())
  File "/usr/lib/pymodules/python2.7/south/orm.py", line 46, in FakeORM
    _orm_cache[args] = _FakeORM(*args)  
  File "/usr/lib/pymodules/python2.7/south/orm.py", line 125, in __init__
    self.models[name] = self.make_model(app_label, model_name, data)
  File "/usr/lib/pymodules/python2.7/south/orm.py", line 318, in make_model
    field = self.eval_in_context(code, app, extra_imports)
  File "/usr/lib/pymodules/python2.7/south/orm.py", line 236, in eval_in_context
    return eval(code, globals(), fake_locals)
  File "<string>", line 1
    SouthFieldClass(default=datetime.datetime(2012, 4, 25, 16, 32, 45, 683390, 
tzinfo=<UTC>))
                                                                                
      ^
SyntaxError: invalid syntax


-- System Information:
Debian Release: wheezy/sid
  APT prefers testing
  APT policy: (700, 'testing'), (650, 'unstable'), (600, 'stable'), (550, 
'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 3.1.0-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8) (ignored: LC_ALL 
set to en_US.UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages python-django-south depends on:
ii  python          2.7.2-10
ii  python-django   1.4-1
ii  python-support  1.0.14

python-django-south recommends no packages.

python-django-south suggests no packages.

-- no debconf information



-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to