Modify

Ticket #240 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

Problems creating migrations with GeoDjango models

Reported by: Shige Abe Owned by: andrew
Priority: major Milestone: 0.6.2
Component: commands Version: 0.6.1
Keywords: Cc:

Description

Works fine in 0.6, not in 0.6.1

Attachments

Change History

comment:1 Changed 2 years ago by andrew

  • Status changed from new to assigned
  • Milestone set to 0.6.2

Could I have some more details? What's the error?

comment:2 Changed 2 years ago by shige.abe@…

Sorry, trying to send this from DjangoCon?... :)

0.6.0:
from pkg_resources import resource_stream

( Parsing field: created
( Parsing field: modified
( Parsing field: created
( Parsing field: modified
( Parsing field: created
( Parsing field: modified
( Parsing field: created
( Parsing field: modified
( Parsing field: created
( Parsing field: modified
( Parsing field: created
( Parsing field: modified
( Parsing field: created
( Parsing field: modified
( Parsing field: created
( Parsing field: modified

Nothing seems to have changed.

0.6.1:
from pkg_resources import resource_stream

( Parsing field: created
( Parsing field: modified
( Parsing field: created
( Parsing field: modified
( Parsing field: created
( Parsing field: modified
( Parsing field: created
( Parsing field: modified

Traceback (most recent call last):

File "./manage.py", line 28, in <module>

execute_from_command_line()

File "/home/django/public_html/sub2/lib/python2.6/site-packages/Django-1.0.3-py2.6.egg/django/core/management/init.py", line 352, in execute_from_command_line

utility.execute()

File "/home/django/public_html/sub2/lib/python2.6/site-packages/Django-1.0.3-py2.6.egg/django/core/management/init.py", line 306, in execute

self.fetch_command(subcommand).run_from_argv(self.argv)

File "/home/django/public_html/sub2/lib/python2.6/site-packages/Django-1.0.3-py2.6.egg/django/core/management/base.py", line 192, in run_from_argv

self.execute(*args, options.dict)

File "/home/django/public_html/sub2/lib/python2.6/site-packages/Django-1.0.3-py2.6.egg/django/core/management/base.py", line 219, in execute

output = self.handle(*args, options)

File "/home/django/public_html/sub2/lib/python2.6/site-packages/south/management/commands/startmigration.py", line 236, in handle

not getattr(model._meta, "abstract", False)

File "/home/django/public_html/sub2/lib/python2.6/site-packages/south/management/commands/startmigration.py", line 623, in prep_for_freeze

fields = modelsinspector.get_model_fields(model, m2m=True)

File "/home/django/public_html/sub2/lib/python2.6/site-packages/south/modelsinspector.py", line 286, in get_model_fields

args, kwargs = introspector(field)

File "/home/django/public_html/sub2/lib/python2.6/site-packages/south/modelsinspector.py", line 241, in introspector

kwargs[kwd] = get_value(field, defn)

File "/home/django/public_html/sub2/lib/python2.6/site-packages/south/modelsinspector.py", line 180, in get_value

value = get_attribute(field, attrname)

File "/home/django/public_html/sub2/lib/python2.6/site-packages/south/utils.py", line 34, in get_attribute

value = getattr(value, part)

AttributeError?: 'PointField?' object has no attribute 'dim'

comment:3 Changed 2 years ago by anonymous

Basics of the model:

class Location(geomodels.Model):

geometry = geomodels.PointField?(srid=4326)
objects = geomodels.GeoManager?()

def unicode(self):

return "%d" % self.id

comment:4 Changed 2 years ago by andrew

  • Status changed from assigned to closed
  • Resolution set to fixed

Ahh, the GIS field names internally changed in 1.1, which I developed against. Should be fixed in [fc64eabf4e16].

Bug reports can also be submitted in person at DjangoCon?, if you can find me :)

View

Add a comment

Modify Ticket

Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


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

 
Note: See TracTickets for help on using tickets.