Re: Modulo not working in query using extra() to define specific where

2009-11-30 Thread Craig Kimerer
No guarantees that this will fix the issue, but have you tried escaping the '%'? Try `Semestre.objects.extra(where=['num %% 2 = 0'])` and this may give you your desired result. Looks like an issue with python string formatting. Alternatively, you could try `print Semestre.objects.extra(where=['n

Re: [1.1] Problem with unmanaged models and unit testing

2009-11-13 Thread Craig Kimerer
Probably a constraint problem on the tables being created. Logging into to your MySQL server via command line and running either 'show myisam status' or 'show innodb status' (depending on what type of tables you are making) should provide you with more useful information. Craig On Fri, Nov 13, 2

Re: How to handle this race condition?

2009-11-10 Thread Craig Kimerer
elect for update method. Also, this way you will avoid the need to > retry failed transactions because of concurrent updates. > > On Nov 10, 9:55 pm, Craig Kimerer wrote: > > On Mon, Nov 9, 2009 at 10:56 PM, Tamas Szabo wrote: > > > Would something like > > > >

Re: How to handle this race condition?

2009-11-10 Thread Craig Kimerer
On Mon, Nov 9, 2009 at 10:56 PM, Tamas Szabo wrote: > Would something like > > UPDATE bid = new_bid WHERE id = id and bid < new_bid > > work for you? > > It is a more optimistic approach (it assumes that the case you describe is > an exception rather than what usually happens) and I think it is s

Re: Django ORM exhibiting caching like behavior in a non web based daemon script

2009-06-25 Thread Craig Kimerer
Which backend are you using? If you happen to be using MySQL with InnoDB, and you haven't altered the default settings you are probably using an isolation level of REPEATABLE-READ. You can read more about that setting here http://dev.mysql.com/doc/refman/5.0/en/set-transaction.html#isolevel_repea

Re: PREPEND_WWW

2008-12-15 Thread Craig Kimerer
(I'm probably blind ;) > > APPEND_SLASH is not modified (so it is default True) > > I changed PREPEND_WWW to True but it did not seem to have any > effect... > > I can try the patch if it is a post 1.0 ... haven't had time to go > chase into the django code to com

Re: PREPEND_WWW

2008-12-15 Thread Craig Kimerer
Which version of Django are you using? Do you also have APPEND_SLASH set to true? There was a ticket about this a while back that was fixed ( http://code.djangoproject.com/ticket/9199). Hope that helps. Craig On Mon, Dec 15, 2008 at 11:23 AM, jmat wrote: > > Just curious, has anyone else eve