[google-appengine] Re: Can not update db

2009-04-08 Thread saintthor

nothing is changed.

the dests[0].UserName is still nochanged after adding the codeline
dests.fetch(1000)

:(

On 4月8日, 上午4时00分, djidjadji djidja...@gmail.com wrote:
 You must first execute the query before you can access the objects
 You can use get() or fetch()

 dests = db.GqlQuery( SELECT * FROM Dj_User WHERE UserID = '4' )
 dests.fetch(1000)
 dests[0].UserName = aaa# it seems something wrong here
 db.put( dests )

 [1]http://code.google.com/appengine/docs/python/datastore/gqlqueryclass

 2009/4/7saintthorsaintt...@gmail.com:



  dests = db.GqlQuery( SELECT * FROM Dj_User WHERE UserID = '4' )
  dests[0].UserName = aaa# it seems something wrong here
  db.put( dests )

  print dests[0].UserName

  the codes prints tom, still the old value.

  What is wrong with it?

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



[google-appengine] Re: Can not update db

2009-04-08 Thread saintthor

i solved. it is so strange.

code as yours do not work till i alter it to:

dests = db.GqlQuery( SELECT * FROM Dj_User WHERE UserID = '4' )
dests.get()
d = dests[0]
d.UserName = aaa
db.put( d )

it won't work without using the d. i think it is a bug.

thank you for helping.


On 4月8日, 上午4时00分, djidjadji djidja...@gmail.com wrote:
 You must first execute the query before you can access the objects
 You can use get() or fetch()

 dests = db.GqlQuery( SELECT * FROM Dj_User WHERE UserID = '4' )
 dests.fetch(1000)
 dests[0].UserName = aaa# it seems something wrong here
 db.put( dests )

 [1]http://code.google.com/appengine/docs/python/datastore/gqlqueryclass

 2009/4/7saintthorsaintt...@gmail.com:



  dests = db.GqlQuery( SELECT * FROM Dj_User WHERE UserID = '4' )
  dests[0].UserName = aaa# it seems something wrong here
  db.put( dests )

  print dests[0].UserName

  the codes prints tom, still the old value.

  What is wrong with it?

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



[google-appengine] Re: Can not update db

2009-04-08 Thread Wooble



On Apr 8, 5:23 am, saintthor saintt...@gmail.com wrote:
 i solved. it is so strange.

 code as yours do not work till i alter it to:

 dests = db.GqlQuery( SELECT * FROM Dj_User WHERE UserID = '4' )
 dests.get()
 d = dests[0]
 d.UserName = aaa
 db.put( d )

 it won't work without using the d. i think it is a bug.

It's a bug in your earlier code.

db.put(dests) is a lot different than db.put(d) when d == dests[0];
dests != dests[0]

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



[google-appengine] Re: Can not update db

2009-04-07 Thread djidjadji

You must first execute the query before you can access the objects
You can use get() or fetch()

dests = db.GqlQuery( SELECT * FROM Dj_User WHERE UserID = '4' )
dests.fetch(1000)
dests[0].UserName = aaa# it seems something wrong here
db.put( dests )

[1] http://code.google.com/appengine/docs/python/datastore/gqlqueryclass.html

2009/4/7 saintthor saintt...@gmail.com:

 dests = db.GqlQuery( SELECT * FROM Dj_User WHERE UserID = '4' )
 dests[0].UserName = aaa        # it seems something wrong here
 db.put( dests )

 print dests[0].UserName

 the codes prints tom, still the old value.

 What is wrong with it?

 


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