Thanks, adding the default fixed it. Although the development
datastore viewer still does not work correctly. I can not edit the new
field for the old or NEW records.

When I uploaded to production all worked fine. The production
dataviewer displayed "Missing" for the field in the old rows, and the
correct value for new ones.

The development dataserver behaves slightly differently in this use
case than the production one.

But the production one works better!

Thanks
Robin

On Jan 3, 7:41 am, Alexander Kojevnikov <alexan...@kojevnikov.com>
wrote:
> > I can insert new rows fine, and see them in the Development server
> > datastore viewer. But when I try to access the new property contains
> > "NoneType: None".
>
> You can assign a default value to the property, it will be used when
> an entity has no value for the property:
>
>   boat = db.StringProperty(default='my default value')
>
> > How can I force the Datastore to add this new property without having
> > to delete all the old data and re-add?
>
> You don't have to re-create your entities, if you want you can iterate
> through them and update the property value:
>
>   entity.boat = 'my default value'
>   entity.put()
>
> If you have many entities, you will have to do the update in multiple
> requests, probably using the __key__ index to properly iterate over
> all of them. But before doing this, consider using the 'default'
> parameter first, it's much easier.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to