setattr(entity, p, value) http://docs.python.org/library/functions.html#setattr
See also: getattr and delattr. Depending on your exact needs I would also suggest you consider using JSON (or something else) to encode user defined properties. Might make it easier for you to distinguish the user defined properties and reduce some of the property name validation demands. Robert On Mon, Aug 30, 2010 at 12:56, jotavaladouro <[email protected]> wrote: > Hi to everyone: > > I want to create a model that allow the user to add Properties. > > I have found expando clases but I have a problem: > > I Create the new Propertie with the same codeline, where p is the new > propertie. > entity.p=value > > How can I change the name of p propertie or create it with a name > guven by the user. > > Thanks in advance > > -- > 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. > > -- 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.
