Changing GAE db. Model schema on dev_server with ListProperties? BadValueError

My understanding of modifying db.Model schemas is that it "doesn't matter" if you add a property and then try and retrieve old objects without that property.

Indeed, by adding the following property to my SiteUser

db.Model running on dev_server:

category_subscriptions = db.StringProperty()

Still allows me to get the old SiteUser object does not have this property (via a GQL query).

However, by changing the property to a list property (or StringListProperty, ListProperty):

category_subscriptions = db.StringListProperty()

results in the following error when trying to find a user:

BadValueError: Property category_subscriptions is required

This is SDK Server version 1.7.4. Why is this and how will I work around it?

+3


source to share


1 answer


here is my workaround to get it working on dev_server:

1) update your model in production and deploy it

2) use appcfg.py download_data

and grab all objects of the updated type



3) use appcfg.py upload_data

and push all objects to local datastore

voila. Now your local datastore objects can be retrieved without generatingBadValueError

0


source







All Articles