Hi,

What you want is setattr(incomingDb, attr_name, value).  See:
http://www.python.org/doc/2.5.2/lib/built-in-funcs.html

-Marzia

On Tue, Nov 18, 2008 at 6:20 AM, itssam <[EMAIL PROTECTED]> wrote:

>
> I'm not sure if i'm missing something here, but i want to create a DB
> Entity with a number of properties,named by the input (which will be
> sanitized).
>
> Basically taking the post attributes and pushing them all to separate
> properties... It sounds like the expando should be able to handle it
> but i'm not totally sure how.
>
> class incomingDB(db.Expando):
>        date = db.DateTimeProperty(auto_now_add=True)
>
> class testing(webapp.RequestHandler):
>  def get(self):
>     postRecord=incomingDB()
>     for attribute in self.request.arguments():
>        postRecord.attribute=self.request.get(attribute)
>
> Now obiously the postRecord."key"=self.request.get(key) wouldn't work,
> so i kind of need a postRecord.add(attribute, self.request.get
> (attribute)) method? is there one i've missed somewhere?
>
> Cheers
>  Sam
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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