It isn't exactly the same, but have you looked at the Expando class?

http://code.google.com/appengine/docs/python/datastore/expandoclass.html

This would allow you to add extra name/value pairs to an entity like
this:

class SomeEntity(Expando):
   pass

e = SomeEntity()
e.name1 = "value"
e.name2 = "value2"

You can also get a list of the properties you've defined using the
dynamic_properties() method.

cheers
Michael


On Feb 11, 2:10 pm, sagey <[email protected]> wrote:
> hello,
>
> Apologies for what i assume is a very stupid question.
>
> I did have a model that stored a list of strings using a
> stringlistproperty.
>
> I now need to store a pair of string values but am unsure of the best/
> correct way to do this?
>
> i've thought of 2 ways so far:
>
> 1) store the 2 strings in a stringlistproperty, with the 2 strings
> delimited by a sepcial character, and then split the string when i
> retrieve the values (i then got stumped by the fact that i can't use
> split in the template).
>
> or
>
> 2) create a class that has 2 string properties and then store each
> class in a list, however i can't work out from the documentation
> whether a list will support storing custom classes, i don't think it
> does (certainly trying to define db.listproperty with my own class
> type produced an error.
>
> i'd be really grateful for any help. i'm new to both python and
> appengine, so any help would be appreciated.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to