Hi,

I am writing something code to create a model, and then update it. I have a
referenced property, it works well on create function, but it does not work
in update function. The code is simple as follow:

        r = Information.get(self.params.get('id'))
        r.shop = Shop.get(self.params.get('shop'))
        for prop in Information.properties():
            if prop in self.params:
                if prop is 'end_date':
                    r.end_date =
datetime.strptime(self.params.get('end_date',None),'%Y/%m/%d')
                else:
                    setattr(r, prop, self.params.get(prop))
        r.save()
        self.redirect('/information/show/%s' % (r.key()))

Other properties are updated, but I can not update r.shop, I just tried to
assign shop2 instead of shop1 for my Information model.

Are there something I missed?


Thanks!

slackdot.com

Location:Room 807,QiLuRuanJianDaSha Qilu Software Park
        No. 1 Shunhua Rd High-Tech Development Zone
        Jinan, China 250101
Website: http://slackdot.com
Mobile: +86 15854103759

Haulyn Jason

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