Modify

Ticket #396 (closed defect: worksforme)

Opened 4 years ago

Last modified 4 years ago

M2M to 'self' fails

Reported by: andrew Owned by: andrew
Priority: major Milestone: 0.7
Component: commands Version: 0.7-rc1
Keywords: Cc:

Description

Traceback (most recent call last):
  File "./manage.py", line 11, in <module>
    execute_manager(settings)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/django/core/management/__init__.py", line 438, in execute_manager
    utility.execute()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/django/core/management/__init__.py", line 379, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/django/core/management/base.py", line 196, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/django/core/management/base.py", line 223, in execute
    output = self.handle(*args, **options)
  File "/Users/dmishe/work/myproject/support/south/management/commands/schemamigration.py", line 98, in handle
    old_orm = last_migration.orm(),
  File "/Users/dmishe/work/myproject/support/south/utils.py", line 62, in method
    value = function(self)
  File "/Users/dmishe/work/myproject/support/south/migration/base.py", line 418, in orm
    return FakeORM(self.migration_class(), self.app_label())
  File "/Users/dmishe/work/myproject/support/south/orm.py", line 46, in FakeORM
    _orm_cache[args] = _FakeORM(*args)  
  File "/Users/dmishe/work/myproject/support/south/orm.py", line 125, in __init__
    self.models[name] = self.make_model(app_label, model_name, data)
  File "/Users/dmishe/work/myproject/support/south/orm.py", line 344, in make_model
    fields,
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/django/db/models/base.py", line 193, in __new__
    new_class._prepare()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/django/db/models/base.py", line 238, in _prepare
    signals.class_prepared.send(sender=cls)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/django/dispatch/dispatcher.py", line 166, in send
    response = receiver(signal=self, sender=sender, **named)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/django/db/models/fields/related.py", line 82, in do_pending_lookups
    operation(field, sender, cls)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/django/db/models/fields/related.py", line 107, in resolve_related_class
    field.do_related_class(model, cls)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/django/db/models/fields/related.py", line 122, in do_related_class
    self.contribute_to_related_class(other, self.related)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/django/db/models/fields/related.py", line 1082, in contribute_to_related_class
    setattr(cls, related.get_accessor_name(), ManyRelatedObjectsDescriptor(related))
TypeError: attribute name must be string, not 'NoneType'

Attachments

Change History

comment:1 Changed 4 years ago by andrew

  • Status changed from new to closed
  • Version changed from 0.6.2 to 0.7-rc1
  • Resolution set to worksforme

Was reported on IRC:

<dmishe> [19:05] hey, i have this m2m on the model to 'self'
<dmishe> [19:05] and --auto schema migration fails with http://dpaste.org/TbER/
<dmishe> [19:06] pdb shows me that django's related.get_accessor_name() returns None and south expects it to be string?
<dmishe> [19:06] south 0.7rc1

Cannot replicate with that description - M2Ms to 'self' work for me with both --auto and --initial. Closing until there's a working example.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.