Re: Querysets returns wrong result when using threading.

2010-01-17 Thread Kieran Brownlees
Fantastic, thank you :) On Jan 16, 9:02 pm, Tomasz Zieliński wrote: > On 16 Sty, 06:15, Kieran Brownlees wrote: > > > Firstly thank you, secondly, how to get around it? I assume I need to > > force a commit for the transaction my thread is using, but querysets > >

Re: Querysets returns wrong result when using threading.

2010-01-15 Thread Kieran Brownlees
t wrote: > > > On Thu, Jan 14, 2010 at 10:26 PM, Kieran Brownlees > > wrote: > > > Basic example of format: > > > Main Thread: print objects.all() > > > Spawned Thread: print objects.all() -- same as main thread > > > Main Thread: objects.create(newObj)

Querysets returns wrong result when using threading.

2010-01-14 Thread Kieran Brownlees
Hello All, Using Django 1.1.1. Today I found some very strange behaviour when trying to use theading, from what I understand it is different from the notes on trac of querysets not being thread safe. Basic issue trying to execute queries while in a thread always returns an original query. Probabl

Re: super() argument 1 must be type, not None

2009-12-21 Thread Kieran Brownlees
Have you restarted your server lately? I find that bug turns up from time to time when the auto reloader doesn't reload properly. Kieran On Dec 22, 12:17 pm, TiNo wrote: > Hi, > > I am overriding a save function of a model with the following code: > >     def save(self, *args, **kwargs): >      

Re: Best way to handle class attribute as a space separated string?

2009-12-21 Thread Kieran Brownlees
Not very practical but fun to make and good for wtf moments when reading old code :) self.attrs['class'] = ' '.join([x for x in self.attr.get('class') and self.attr['class'].split(' ') or []] + [self.pastClass]) Could make it a little shorter with two lines: e, a, p = self.attrs.get('class'), sel

Re: Root url returning 302 FOUND

2009-12-20 Thread Kieran Brownlees
I probably should of tried it first. Your url setup works fine for me. Kieran On Dec 21, 5:10 pm, Kieran Brownlees wrote: > My guess would be the root url never ends without a '/' - ie to match > the root url you need a '/' somewhere. > > Try making the home_vie

Re: Root url returning 302 FOUND

2009-12-20 Thread Kieran Brownlees
My guess would be the root url never ends without a '/' - ie to match the root url you need a '/' somewhere. Try making the home_view regex r'^/$' Kieran On Dec 21, 5:05 pm, Kegan Gan wrote: > Anyone can shed some light to the matter? > > * Bring this post to the front. > > On Dec 18, 1:21 am,

"OneToOneField doesn't allow assignment of None"

2009-12-20 Thread Kieran Brownlees
Hello All, In http://code.djangoproject.com/browser/django/trunk/django/forms/models.py line 53 it states: 53 # OneToOneField doesn't allow assignment of None. Guard against that 54 # instead of allowing it and throwing an error. 55 if isinstance(f, models.O