Re: Difficulties with thread locals

2007-05-14 Thread orestis
I see. I noticed this was tricky stuff. I guess that setting the SITE_ID each time will lead to race conditions etc, right ? So it's back to the drawing board. Using sites for multilingual content was cool because it allowed me to use the built in functionality of django.contrib very easily...

Re: Difficulties with thread locals

2007-05-13 Thread Malcolm Tredinnick
On Mon, 2007-05-14 at 00:52 +, orestis wrote: > Hello, > > I'm having a weird python error, and I can't seem to find out what's > wrong. > > I wanted to extend the site framework, so I can use it for > multilingual content. The way to do this is to override the SITE_ID > with a function: >

Re: Difficulties with thread locals

2007-05-13 Thread orestis
OK, after digging around the django source, it seems that the database cursors, where the SITE_ID is read runs at a different thread. I also looked into the translation framework, it uses "currentThread" to fetch the current active translation. So what should I do ? This is tricky stuff... On May

Difficulties with thread locals

2007-05-13 Thread orestis
Hello, I'm having a weird python error, and I can't seem to find out what's wrong. I wanted to extend the site framework, so I can use it for multilingual content. The way to do this is to override the SITE_ID with a function: import threadlocals def SITE_ID(): lang = threadlocals.get_current