Ticket #133 (closed defect: worksforme)

Opened 6 years ago

Last modified 6 years ago

Error when removing m2m field

Reported by: Erik Allik <eallik@…> Owned by: andrew
Priority: major Milestone: 0.6
Component: commands Version: 0.6-pre
Keywords: startmigration Cc:

Description

When removing an m2m field from a model and using the --auto flag to generate a migration, I get the following error traceback:

$ django-admin.py startmigration localsite --auto remove_eating_places_from_dish
 - Deleted field 'localsite.dish.eating_places'
Traceback (most recent call last):
  File "/Users/erik/projects/headisu/bin/django-admin.py", line 5, in <module>
    pkg_resources.run_script('Django==1.1-beta-1', 'django-admin.py')
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/pkg_resources.py", line 448, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/pkg_resources.py", line 1166, in run_script
    execfile(script_filename, namespace, namespace)
  File "/Users/erik/projects/headisu/lib/python2.5/site-packages/Django-1.1_beta_1-py2.5.egg/EGG-INFO/scripts/django-admin.py", line 5, in <module>
    management.execute_from_command_line()
  File "/Users/erik/projects/headisu/lib/python2.5/site-packages/Django-1.1_beta_1-py2.5.egg/django/core/management/__init__.py", line 350, in execute_from_command_line
    utility.execute()
  File "/Users/erik/projects/headisu/lib/python2.5/site-packages/Django-1.1_beta_1-py2.5.egg/django/core/management/__init__.py", line 304, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/Users/erik/projects/headisu/lib/python2.5/site-packages/Django-1.1_beta_1-py2.5.egg/django/core/management/base.py", line 195, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/Users/erik/projects/headisu/lib/python2.5/site-packages/Django-1.1_beta_1-py2.5.egg/django/core/management/base.py", line 222, in execute
    output = self.handle(*args, **options)
  File "/Users/erik/projects/headisu/lib/python2.5/site-packages/South-0.5-py2.5.egg/south/management/commands/startmigration.py", line 393, in handle
    field.m2m_column_name()[:-3], # strip off the '_id' at the end
AttributeError: 'ManyToManyField' object has no attribute 'm2m_column_name'

(My appologies if this is a duplicate)

Change History

comment:1 Changed 6 years ago by andrew

Are you on Django 1.0 or 1.1?

comment:2 Changed 6 years ago by Erik Allik <eallik@…>

I'm on SVN trunk, so 1.1.

comment:3 Changed 6 years ago by andrew

  • Status changed from new to closed
  • Resolution set to worksforme

This seems to work on trunk now; I suspect it was some instability there (there was another similar bug around the same time to do with the field API mysteriously changing).

Note: See TracTickets for help on using tickets.