I have a page that needs to get a few values via the aggregate
function of querysets. There are about 15 of them, and they all look
like this:
SELECT SUM(some_column_name) FROM ...
and they each take a few hundred milliseconds each. That makes the
page take a lot longer to render than I'd like. I
Thanks Karen.
I removed the custom form from admin.py and added a constructor to the
model:
def __init__(self, *args, **kwargs):
super(BannerImage, self).__init__(*args, **kwargs)
self._meta.get_field('url')._choices = get_urls()
It seems to work now.
Keith
On Dec 9, 2:52 pm, "Karen Trace
On Tue, Dec 9, 2008 at 1:58 PM, lingrlongr <[EMAIL PROTECTED]> wrote:
>
> I have a function called get_urls that returns a list of absolute_urls
> for various models in the same project. This function is used for
> another model in a way so that when a particular model appears on the
> site, I ca
I have a function called get_urls that returns a list of absolute_urls
for various models in the same project. This function is used for
another model in a way so that when a particular model appears on the
site, I can choose which part of the site this model links to.
# utils.py
def get_urls():
Is there a way to disable QuerySet caching? Thanks.
-Brandon
--~--~-~--~~~---~--~~
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 fr
On 11/1/07, Joe <[EMAIL PROTECTED]> wrote:
> Correct me if I'm wrong, but wouldn't this place more load on the
> server to to this, as an anonymous user visiting the site for the
> first time would start a new session, and therefore bypass the cache?
Sessions aren't created unless you modify a v
Sorry, meant to NOT vary on the value of the cookie header.
On Nov 1, 11:39 am, Joe <[EMAIL PROTECTED]> wrote:
> Correct me if I'm wrong, but wouldn't this place more load on the
> server to to this, as an anonymous user visiting the site for the
> first time would start a new session, and theref
Sorry for the mistake. This should read:
Correct me if I'm wrong, but wouldn't this place more load on the
server to to this, as an anonymous user visiting the site for the
first time would start a new session, and therefore bypass the cache?
Is there a way I could hack the middleware to look at
Correct me if I'm wrong, but wouldn't this place more load on the
server to to this, as an anonymous user visiting the site for the
first time would start a new session, and therefore bypass the cache?
Is there a way I could hack the middleware to look at something
besides the HTTP headers to det
On Tue, 2007-10-30 at 05:43 -0700, Joe wrote:
> I am running into a performace problem with Django and scaling.
>
> I have enabled the caching middleware, but had to set
> CACHE_MIDDLEWARE_ANONYMOUS_ONLY=True so I could continue to use the
> admin interface.
>
> Now, authenticated users are begi
Joe napisał(a):
> I tried to look at caching querysets, but this won't work because they
> are lazy.
Do a list() on query set and cache the resulting list.
> If I use fragment caching, would that save hits on the database
> because of the lazy querysets?
Entire fragments
implement caching on my normal views for authenticated
users? I can't just use the decorator because I have a "Hello,
Username" message on the page.
I tried to look at caching querysets, but this won't work because they
are lazy.
If I use fragment caching, would that save
You may want to take a look here:
http://groups.google.com/group/django-users/browse_thread/thread/e4e1e0c017655ad/
On 7/8/07, ejot <[EMAIL PROTECTED]> wrote:
>
> And continuing this monologue :) ... the separate thread ofcourse
> didnt quite work as I intended. I see now that a new connecti
And continuing this monologue :) ... the separate thread ofcourse
didnt quite work as I intended. I see now that a new connection is
created for each thread/polling I create.
This brings me back to the original question... how can I force a
query to evaluate? Or is there some alternative to solve
Hmm, Im guessing this might also have something to do with local() for
threads?
Made my app work by using an extra and from my point of view
uneccesary worker thread that does the polling on the database.. .
anyone willing to offer some insight on this? I see people are trying
to do external (fro
Im really banging my head against a wall trying to get my threaded
application to play nice with djangos ORM...
this is what my thread does for each iteration..
def run(self):
while self.keepRunning:
print repr(Topic.objects.get(id=1).content_set.order_by("-
id")[0])
16 matches
Mail list logo