On 5/8/07, Brandon Low <[EMAIL PROTECTED]> wrote:
>
> Still not sure what's going on myself -- I've had one more occurence of
> the error, and have now confirmed that autocommit is on in the
> production application (by printing the result of select @@autocommit).
>
> It sounds quite possible that
Still not sure what's going on myself -- I've had one more occurence of
the error, and have now confirmed that autocommit is on in the
production application (by printing the result of select @@autocommit).
It sounds quite possible that it's the immediate foreign key constraint
check that's causi
Not sure what is happening there. Django is not setting autocommit,
and MySQLdb disables autocommit by default. Have you actually verified
that autocommit is on when running your application?
It may also be due to the fact that MySQL (5.0 and earlier at least)
does not defer foreign key checks in
Ugh, why would autocommit be set to 1 in the site but 0 in the shell???
--Brandon
On 2007-05-01 (Tue) at 18:13:55 -0500, Brandon Low wrote:
>
> So initially, when you said that, I thought to myself, "Of course, how
> could I be so dumb" but then I did:
>
> >>> from django.db import connection;
So initially, when you said that, I thought to myself, "Of course, how
could I be so dumb" but then I did:
>>> from django.db import connection;
>>> cursor = connection.cursor()
>>> cursor.execute("select @@autocommit;")
1L
>>> row=cursor.fetchone()
>>> row
(0L,)
at the shell and it looks like a
On 5/1/07, Brandon Low <[EMAIL PROTECTED]> wrote:
>
> my model is very simple:
>
> class Referrer(models.Model):
> url = models.CharField(maxlength=255, unique=True)
>
> here is the relevent view code:
>
> referrer = request.META.get('HTTP_REFERER','-')
> r, r_new = Referrer.objects.ge
my model is very simple:
class Referrer(models.Model):
url = models.CharField(maxlength=255, unique=True)
here is the relevent view code:
referrer = request.META.get('HTTP_REFERER','-')
r, r_new = Referrer.objects.get_or_create(url=referrer)
thanks for your replies!
--Brandon
On
On 5/1/07, Brandon Low <[EMAIL PROTECTED]> wrote:
>
> How can a get_or_create cause an integrity constraint error?
Also... It's hard to see exactly what's going on because the code in
the traceback is using **kwargs. If you use get() or get_or_create(),
it's looking for a match on all the paramet
On 5/1/07, Brandon Low <[EMAIL PROTECTED]> wrote:
>
> How can a get_or_create cause an integrity constraint error?
The error is on key 2, which is an additional unique index you
presumably have in your model. get_or_create should not cause
integrity errors on the primary key, but that's not what'
9 matches
Mail list logo