I moved my django app from a single model to multiple apps inside a 
project, and for some reason I'm getting an error:

TypeError: int() argument must be a string or a number, not 'User' 

When i attempt to migrate and sync my project. Does anyone know what this 
is about? Tracebback is attached.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b5ea0fcc-2322-4429-a3f2-5b83e6cbec56%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
user@ubuntu:/home/ems$ sudo python manage.py migrate
Operations to perform:
  Synchronize unmigrated apps: suit
  Apply all migrations: tasks, network, sessions, admin, tags, auth, circuits, 
contenttypes, accounts, inventory, services, geo
Synchronizing apps without migrations:
  Creating tables...
  Installing custom SQL...
  Installing indexes...
Running migrations:
  Applying accounts.0001_initial...Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File 
"/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", 
line 385, in execute_from_command_line
    utility.execute()
  File 
"/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", 
line 377, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", 
line 288, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", 
line 338, in execute
    output = self.handle(*args, **options)
  File 
"/usr/local/lib/python2.7/dist-packages/django/core/management/commands/migrate.py",
 line 160, in handle
    executor.migrate(targets, plan, fake=options.get("fake", False))
  File 
"/usr/local/lib/python2.7/dist-packages/django/db/migrations/executor.py", line 
63, in migrate
    self.apply_migration(migration, fake=fake)
  File 
"/usr/local/lib/python2.7/dist-packages/django/db/migrations/executor.py", line 
97, in apply_migration
    migration.apply(project_state, schema_editor)
  File 
"/usr/local/lib/python2.7/dist-packages/django/db/migrations/migration.py", 
line 107, in apply
    operation.database_forwards(self.app_label, schema_editor, project_state, 
new_state)
  File 
"/usr/local/lib/python2.7/dist-packages/django/db/migrations/operations/models.py",
 line 36, in database_forwards
    schema_editor.create_model(model)
  File "/usr/local/lib/python2.7/dist-packages/django/db/backends/schema.py", 
line 208, in create_model
    definition, extra_params = self.column_sql(model, field)
  File "/usr/local/lib/python2.7/dist-packages/django/db/backends/schema.py", 
line 120, in column_sql
    default_value = self.effective_default(field)
  File "/usr/local/lib/python2.7/dist-packages/django/db/backends/schema.py", 
line 183, in effective_default
    default = field.get_db_prep_save(default, self.connection)
  File 
"/usr/local/lib/python2.7/dist-packages/django/db/models/fields/related.py", 
line 1722, in get_db_prep_save
    return self.related_field.get_db_prep_save(value, connection=connection)
  File 
"/usr/local/lib/python2.7/dist-packages/django/db/models/fields/__init__.py", 
line 627, in get_db_prep_save
    prepared=False)
  File 
"/usr/local/lib/python2.7/dist-packages/django/db/models/fields/__init__.py", 
line 907, in get_db_prep_value
    value = self.get_prep_value(value)
  File 
"/usr/local/lib/python2.7/dist-packages/django/db/models/fields/__init__.py", 
line 915, in get_prep_value
    return int(value)
TypeError: int() argument must be a string or a number, not 'User'

Reply via email to