I think it should work :

res = Employee.gql("WHERE id = :1", some_user_id)
to_put = []
for r in res:
  r.delivery_type = some_type
  to_put.append(r)
db.put(to_put)

or

res = Employee.gql("WHERE id = :1", some_user_id)
for r in res:
  r.delivery_type = some_type
  db.put(r)


You change 'r' but you do nothing with it.

On Sep 13, 3:47 am, BornInMeadowMuffins <zhangb...@gmail.com> wrote:
> It has been solved 
> here:http://groups.google.com/group/google-appengine/browse_thread/thread/...
> But still, what's wrong with the previous code?
>
> On Sep 13, 9:09 am, BornInMeadowMuffins <zhangb...@gmail.com> wrote:
>
> > Here is my code:
> > # Database Model
> > class Employee(db.Model):
> >   id = db.IntegerProperty(required=True)
> >   name = db.StringProperty(required=True)
> >   password = db.IntegerProperty(required=True)
> >   delivery_type = db.StringProperty(choices=set(["pickup", "mail",
> > "deposit"]))
>
> > # following variables has been assigned with proper data
> > res = Employee.gql("WHERE id = :1", some_user_id)
> > for r in res:
> >   r.delivery_type = some_type
> > db.put(res)
>
> > # but when I later checked out, to see if I updated the delivery type
> > using template, it gives me None value
> > {% for r in res %}
> >   <p>{{ r.id }}</p>
> >   <p>{{ r.name }}</p>
> >   <p>{{ r.delivery_type }}</p>
> > {% endfor %}
>
> > Can anyone tell me what's the problem is?
--~--~---------~--~----~------------~-------~--~----~
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-appengine@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