I am having a very strange issue, put(), please check it out.

I am calling .put() on an object (within the class definition) as such

class UserProfile(db.Models):
.....
    def increment_state(self):
        self.state += 1
        self.put()
.....


When i put my debug statements, i see the output that i expect.

    def increment_state(self):
        # This should be zero: 0
        logging.debug("This should be zero: " + self.state )
        self.state += 1
        # This should be zero: 1
        logging.debug("This should be one: " + self.state )
        self.put()

Somewhere else  on the other hand, i have an instance of my
UserProfile, i print up.sate before and after this gets called. AND
BOOM, zero before, zero after!.

    def some_other_method_in_some_other_object(self):
        # Yes, i'm sure i have the right UP instance. I verify this by
printing other properties of this entity.
        up = UserProfile.objects.get_user_profile()
        # This should be zero: 0
        logging.debug("This should be zero: " + up.state)
        up.increment_state()
        # FAAAAAAAAAAIL
        # This should be zero: 0
        logging.debug("This should be one: " + up.state)

I am soooo very boggled!. I have been looking at this for hours, no
clue.

Any ideas?  please help.

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