Hi guys,

I'm trying to figure out if what is going on with the pages i'm
building and how to fix it.

I have an object of User which I put into the sessions:

class User:

 def _get_points(self):
    return UserModel.point.current_value

 def _set_points(self, value):
    pass

 points = property(_get_points, _set_points)

These are the models which I have defined:

class UserModel(models.Model):
    uid        = models.CharField(max_length=255, unique=True)

class Points(models.Model)
    user = models.ForeignKey(UserModel)
    current_value = models.IntegerField()


In my views, I do:

user = User()
user.points

to get the current value of points for a certain user. However, after
a certain page has been loaded and shown the current value, if I
manually change the value in the db (MySQL) and reload the page, I
still get the old value, before the db change. I've ruled out page
caching as different parts of the page has changes. These other
changes on the page was executed via the user object in the sessions
(not manually through the db) and works fine.

These are the middlewares that I have in:
sessionsMiddleware
commonMiddleware

and SESSION_SAVE_EVERY_REQUEST = True
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" 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/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to