sebastian-ardila / google-app-engine-django

Automatically exported from code.google.com/p/google-app-engine-django
Apache License 2.0
0 stars 0 forks source link

Dumpdata fails with Django 1.2.1 #173

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Use Django 1.2.1
2. ./manage.py dumpdata

What is the expected output? What do you see instead?
Expected a data dump for fixtures.

The following exceptions were raised:
AttributeError: 'ModelOptions' object has no attribute 'auto_created'

What version of the product are you using? On what operating system?
Django 1.2.1, appengine_django r105, Mac OSX 1.6.3

Please provide any additional information below.

Original issue reported on code.google.com by felixle...@gmail.com on 16 Jun 2010 at 4:06

GoogleCodeExporter commented 9 years ago
I have the same error when defining a simple model (e.g. the poll application 
from the Django tutorial) and running "python manage.py shell".

Original comment by Dominic....@gmail.com on 17 Jun 2010 at 2:12

GoogleCodeExporter commented 9 years ago
I can't seem to reproduce this.

With a simple Django application called 'test' installed in my settings.py 
containing a models.py with the Poll model in it, I can use the shell and 
dumpdata without issues.

~/google-app-engine-django/trunk$ python manage.py shell
Python 2.5.2 (r252:60911, Jan 20 2010, 23:14:04) 
[GCC 4.2.4 (Ubuntu 4.2.4-1ubuntu3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> import django
>>> django.VERSION
(1, 1, 2, 'final', 0)
>>> from test.models import Poll
>>> p = Poll(question='foo')
>>> p.put()
datastore_types.Key.from_path(u'Poll', 2L, _app=u'google-app-engine-django')
>>> 

~/google-app-engine-django/trunk$ python manage.py dumpdata
[{"pk": "ahhnb29nbGUtYXBwLWVuZ2luZS1kamFuZ29yCgsSBFBvbGwYAQw", "model": 
"test.poll", "fields": {"pub_date": null, "question": "foo"}}, {"pk": 
"ahhnb29nbGUtYXBwLWVuZ2luZS1kamFuZ29yCgsSBFBvbGwYAgw", "model": "test.poll", 
"fields": {"pub_date": null, "question": "foo"}}]

Can you provide more details on how to reproduce this please?

Original comment by m...@google.com on 17 Jun 2010 at 9:14

GoogleCodeExporter commented 9 years ago
The bug is triggered with Django 1.2.1, not Django 1.1.2

Original comment by felixle...@gmail.com on 17 Jun 2010 at 9:26

GoogleCodeExporter commented 9 years ago
My bad, I transposed the position of the 2 in my head when checking the version.

Adding auto_created=False to the ModelOptions fixes the immediate problem, but 
seems to raise a bunch more when trying to dump.
* Django 1.2.1 seems to expect a fields attribute on the ModelOptions class
* Django 1.2.1 seems to expect an attribute named using on the Model class, 
which is a function.

I'm not sure what the semantics of those two requirements are at this stage. 
Can you dig into this some more and provide a patch?

Original comment by m...@google.com on 17 Jun 2010 at 9:37

GoogleCodeExporter commented 9 years ago
Here's the patch. Needs testing though :)

Original comment by felixle...@gmail.com on 18 Jun 2010 at 8:53

Attachments:

GoogleCodeExporter commented 9 years ago
thanks for the patch

Original comment by nicolas....@gmail.com on 29 Aug 2010 at 11:53

GoogleCodeExporter commented 9 years ago
models.patch above fixed the issue for me.

Original comment by conn...@gmail.com on 19 Sep 2010 at 10:01

GoogleCodeExporter commented 9 years ago
Why is this patch not applied to SVN yet?

Original comment by jonkeat...@gmail.com on 23 Oct 2010 at 11:36

GoogleCodeExporter commented 9 years ago
Felix, can you please sign the CLA as described in the README file so that we 
can accept this patch?

Original comment by m...@google.com on 26 Oct 2010 at 12:16

GoogleCodeExporter commented 9 years ago
The bug is also triggered with Django 1.2.3!
thanks too for the patch ! 

Original comment by gwey...@gmail.com on 26 Oct 2010 at 3:27

GoogleCodeExporter commented 9 years ago
OK, signed ;)

Original comment by felixle...@gmail.com on 27 Oct 2010 at 12:23

GoogleCodeExporter commented 9 years ago
Patch merged in r108. Thanks and apologies for the delay.

Original comment by m...@google.com on 27 Oct 2010 at 9:36