On Fri, Jan 2, 2009 at 09:56, Rajesh Dhawan <rajesh.dha...@gmail.com> wrote:
>>
>> As far as I can tell there is no reason for this data to be outdated
>> on browser refresh, I've tried looking through the documentation and
>> other places to find what could be causing this
>
> You didn't include a code snippet of how you actually retrieve data in
> your views. Perhaps include the snippet for your index view for
> example so people can see if anything there might be causing this
> problem.

Sorry for the late response, due to other issues this got pushed down
in the priority list here, but here is some code examples of how I'm
retrieving my data etc.

views.py (cropped for index):

from django.views.decorators.cache import never_cache
from django.shortcuts import render_to_response
from django.http import Http404
from Client import GetClients

@never_cache
def index(request):
        clients = GetClients()
        pend = [cl for cl in clients if len(cl.Stops()) != 0 or 
len(cl.Limits()) != 0]
        pos = [cl for cl in clients if cl.Position() != 0 or not cl.MatchPos()]
        return render_to_response(
                'Clients/index.html', {
                        'ReloadRate': 120,
                        'pending': pend,
                        'position': pos,
                }
        )

Client.py (cropped for GetClients):

from MySQLdb import connect

def GetClients():
        avail_db = 
connect(user=AVAIL_USER,db=AVAIL_DB,host=AVAIL_HOST,port=AVAIL_PORT)
        c = avail_db.cursor()
        c.execute("SELECT acct_pk FROM t_acct")
        return [Client(cl[0]) for cl in c.fetchall()]

where the Client object is a series of functions and private data that
gets pulled from the DB either on construction or on request depending
on how troublesome it is to get from the DB

now like I said before I've ran the code to get the data from the DB
outside of django and it gets the data on request fine w/o being
outdated, it's just when i use django to get html out of the data

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to