On Mar 22, 11:09 pm, dhruvbird <dhruvb...@gmail.com> wrote:
> Hello,
>   I have a model with a single attribute that is a StringListProperty.
> I get an error if I define it as such:
>
> class Test(db.Expando):
>     people = db.StringListProperty(required=False, indexed=True)
>
> However, on changing it to:
> class Test(db.Expando):
>     people = db.StringListProperty(required=True, indexed=True,
> default=[])
>
> It starts working. Any ideas why this is happening??

ListPropertys are always required; you can't set their value to None.
If a particular entity has no values for the ListProperty, you need to
set it to the empty list.  (Note that you can still set a default
value of 'None', which magically uses an empty list, not None, as the
default value.)

-- 
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-appeng...@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