9 messages in com.googlegroups.google-appengine[google-appengine] Re: Problem with d...| From | Sent On | Attachments |
|---|---|---|
| Alessandro Arrichiello | 30 Jul 2008 09:07 | |
| Alessandro Arrichiello | 30 Jul 2008 15:18 | |
| Calvin Spealman | 30 Jul 2008 15:31 | |
| Alessandro Arrichiello | 30 Jul 2008 15:45 | |
| Calvin Spealman | 31 Jul 2008 07:52 | |
| blep | 03 Aug 2008 06:39 | |
| Alessandro Arrichiello | 04 Aug 2008 02:28 | |
| Alessandro Arrichiello | 04 Aug 2008 02:46 | |
| Calvin Spealman | 04 Aug 2008 09:35 |
| Subject: | [google-appengine] Re: Problem with datastore, .put() function seems to not update the entity edited![]() |
|---|---|
| From: | Calvin Spealman (iron...@gmail.com) |
| Date: | 07/30/2008 03:31:28 PM |
| List: | com.googlegroups.google-appengine |
user = db.GqlQuery("SELECT * FROM Users WHERE account = :1", account).get() # Notice we add the call to get() here user.url = referrer user.put()
On Wed, Jul 30, 2008 at 6:18 PM, Alessandro Arrichiello <Alez...@gmail.com> wrote:
Please, can you make me an example?
Thanks,
On Jul 31, 12:11 am, "Calvin Spealman" <iron...@gmail.com> wrote:
Something you are saying isnt correct, because subscripting on the GqlQuery instance isn't even supported. You call get(), but don't actually keep the returned entity, which is what you should change the properties on and call the put() method of.
On Wed, Jul 30, 2008 at 12:07 PM, Alessandro Arrichiello
<Alez...@gmail.com> wrote:
Hello there, I've problem with datastore on google AppEngine, .put() function seems to not update the entity previously edited:
I wish to perform a method to insert a new object in datastore and edit it if it already exist.
I've this Class:
class Users(db.Model): account = db.StringProperty(required=True) url = db.StringProperty(required=True)
and this code somewhere in the main: suppose: account="something" and referer="http://somewhere", they are two strings
user=db.GqlQuery("SELECT * FROM Users WHERE account = :1", account) if (user.get()): user[0].url=referer user[0].put() else: p1=Users(account=account, url=referer) p1.put()
All works OK except: re-sending to datastore with: user[0].put() I've also tried: db.put(user) but same results!
Datastore keep the old value!
Hope that someone could help me,
regards,
Alessandro.
--
Read my blog! I depend on your acceptance of my opinion! I am
interesting!http://ironfroggy-code.blogspot.com/
-- Read my blog! I depend on your acceptance of my opinion! I am interesting! http://ironfroggy-code.blogspot.com/
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To post to this group, send email to goog...@googlegroups.com
To unsubscribe from this group, send email to
google-appengine+unsu...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---




