Re: OneToOneField usage

2010-06-16 Thread bob84123
> Is there a particular reason why using a related OneToOneField raises > DoesNotExist instead of returning None? > > | class Person( Model ): > |    pass > | > | class Pet( Model ): > |    owner = OneToOneField( Person ) > | > | # Assuming "joe" exists as a Person > | >>> kitty = joe.pet > | DoesN

Re: make the traceback silent in django

2010-04-09 Thread bob84123
I think a really nice solution to this is to use a middleware. I've used something like this - it catches all exceptions, and writes each one's full django traceback to a database record. You can change the handling to use the logging module or whatever. I think this is great for a production en

Re: JOIN instead of multiple SELECT

2010-04-01 Thread bob84123
grr @ google groups for not showing me that this had already been answered... On Apr 2, 10:04 am, bob84123 wrote: > You probably want to check out > select_related:http://docs.djangoproject.com/en/dev/ref/models/querysets/#id4 > > On Apr 1, 7:00 am, Federico Capoano wrote: > &

Re: JOIN instead of multiple SELECT

2010-04-01 Thread bob84123
You probably want to check out select_related: http://docs.djangoproject.com/en/dev/ref/models/querysets/#id4 On Apr 1, 7:00 am, Federico Capoano wrote: > Hello to all, > > has been a while i've been wondering how to optimize Django's queries > to the database, for example by setting it to use JO

{% url %} in base_site.html => failing contrib.auth tests

2009-08-03 Thread bob84123
I have a customised admin/base_site.html that uses a {% url %} tag to link back to another page in my application. Now, when I run the inbuilt unit tests for django.contrib.auth, some of them override my urls.py with their own urls.py, and hence the reverse() call resulting from the {% url %} tag

Re: question about connection.cursor() and transactions

2009-01-26 Thread bob84123
Just thought I'd re-ask this question as it seems to have slipped through the cracks and I'm still very interested in the answer. Thanks. On Jan 16, 1:57 pm, bob84123 wrote: > I have an app that uses a few custom SQL calls through > connection.cursor() > as

question about connection.cursor() and transactions

2009-01-15 Thread bob84123
I have an app that uses a few custom SQL calls through connection.cursor() as described in http://docs.djangoproject.com/en/dev/topics/db/sql/#topics-db-sql. However they don't display the same transaction semantics as specified in http://docs.djangoproject.com/en/dev/topics/db/transactions/#top

Re: Black Box Testing Framework for Django

2008-07-10 Thread bob84123
I've been successfully using selenium with django for some time now; have a look at http://cms.studstudy.com/Testing_web_applications_with_Selenium__Python_and_Django/ (disclaimer: I wrote this. Also, one thing I haven't got around to mentioning is that the way I connect selenium and django

Re: problem with select_related?

2008-06-25 Thread bob84123
passed no arguments".. perhaps this could be reworded?) On Jun 26, 2:18 am, phillc <[EMAIL PROTECTED]> wrote: > yourversion of django before or after qsrf merge? > > select_related does not work well with relations that have null = True > > On Jun 24, 11:40 pm, bob84123 &

problem with select_related?

2008-06-24 Thread bob84123
I'm having a problem with select_related; I'm not sure if it's a bug or a problem with my understanding of how it's supposed to work. Here's some code: from django.db import models class Occurrence(models.Model): start_time = models.OneToOneField('TimeRepresentation', null = True, relat