straight55b / app-engine-patch

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

Serialize db.StringListProperty properties #254

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a Django project and application using app-engine-patch.
2. Define an model with a db.StringListProperty property. Instantiate some
entities of such model making sure to assing values to the property.
3. Use ./manage dumpdata to create a fixture (e.g. ./manage.py dumpdata
--format=json --indent=2 <app name> > fixture.json)
4. Examine the generated fixture and see the db.StringListProperty fields 
weren't serialized.

What is the expected output? What do you see instead?

It should be possible to serialize StringListProperty.

App-engine-patch's code in `patch.py` is overly jealous because it uses
`not isinstance(db.ListProperty)` to decide if a GAE storage property is
eligible for serialization and it is correct because ther list can contain
arbitrary data types that are potentially unserializable, but
db.StringListProperty is safe because it's a specialized subclass of
db.ListProperty that only can contain strings.

Unserializing them is handled transparently and no further changes are needed.

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

app-engine-patch 1.1RC. Linux.

Please provide any additional information below.

Original issue reported on code.google.com by cra...@gmail.com on 28 Dec 2009 at 12:07

GoogleCodeExporter commented 9 years ago
Patch for this issue.

Original comment by cra...@gmail.com on 28 Dec 2009 at 12:10

Attachments: