straight55b / app-engine-patch

Automatically exported from code.google.com/p/app-engine-patch
0 stars 0 forks source link

Problem using "manage.py loaddata" with ReferenceProperty #141

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. manage.py dumpdata > data.json
2. manage.py flush
3. manage.py loaddata data.json

What is the expected output? What do you see instead?
If you have any models with a ReferenceProperty an exception is raised 
reading: "Cannot load Reference with unnamed key"

What version of the product are you using? On what operating system?
appenginepatch - r106

Please provide any additional information below.
It seems that it raises this exception for any ReferenceProperty without a 
key_name. Commenting out this check in the src 
(http://bitbucket.org/wkornewald/django-app-
engine/src/tip/core/serializers/python.py#cl-170) results in the fixtures 
loading successfully. Is there a reason that a ReferenceProperty without a 
key_name should not be imported?

Original issue reported on code.google.com by funkj...@gmail.com on 11 May 2009 at 5:23

GoogleCodeExporter commented 9 years ago
Currently, it's impossible to create an entity with a custom id, so the only 
way to
work around this is to have a key_name for everything. The export/import code 
would
have to convert ids to key names which isn't supported, yet. Since Google plans 
to
add support for custom ids I think I'll rather wait for them to "fix" this 
issue, so
I can concentrate on creating a port of Django's Model class (thus, bringing 
almost
"native" Django support).

Original comment by wkornew...@gmail.com on 11 May 2009 at 9:11

GoogleCodeExporter commented 9 years ago
this is fixed by the patch attached to issue 210

Original comment by jricket...@gmail.com on 28 Aug 2009 at 9:26