Message from discussion
unsupported operand type(s) for *: 'Decimal' and 'Decimal'
Received: by 10.36.127.17 with SMTP id z17mr666924nzc.1190285028234;
Thu, 20 Sep 2007 03:43:48 -0700 (PDT)
Return-Path: <landlord1...@gmail.com>
Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.176])
by mx.google.com with ESMTP id v28si975375nzb.2007.09.20.03.43.47;
Thu, 20 Sep 2007 03:43:48 -0700 (PDT)
Received-SPF: pass (google.com: domain of landlord1...@gmail.com designates 64.233.166.176 as permitted sender) client-ip=64.233.166.176;
Authentication-Results: mx.google.com; spf=pass (google.com: domain of landlord1...@gmail.com designates 64.233.166.176 as permitted sender) smtp.mail=landlord1...@gmail.com; dkim=pass (test mode) header...@gmail.com
Received: by py-out-1112.google.com with SMTP id p76so886961pyb
for <django-users@googlegroups.com>; Thu, 20 Sep 2007 03:43:47 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=beta;
h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references;
bh=eHb2LKQtILZbjQ213W2DaA95VjDMWQ+j34TbBBIt68w=;
b=EZtDe0/bdj85BWWrVz7ZYXLpg/40RuM5qVNN6Lds5qV8zvBXq39JTcimOQSaYrZuylhUnGIND6lHS7gl/GrD+IY7r8fJ9sBFOjVZrQT3GfeeMgnP7ieIBn1lxwuwoKaO+3LaLZDy3uhQSX36A3nhOw4r/f80Kss6wvphTL5hyXk=
DomainKey-Signature: a=rsa-sha1; c=nofws;
d=gmail.com; s=beta;
h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references;
b=IhwOeUT2HjGlKaKHG+7NsxhCYZYL4THccPyY3Az4OHbQX/1n880CS4+wrUgCEnPtcNELE0fe8wzNU7nndbDe/iRdP9f3yVZ2Iz70IZ6VAHc6/W/7OGBApvTUECmwMAP79NbrG6/HEsD+faSLm5DrKtheNFXu8hno7I82oyKbpPM=
Received: by 10.35.12.10 with SMTP id p10mr1956523pyi.1190285027414;
Thu, 20 Sep 2007 03:43:47 -0700 (PDT)
Received: by 10.35.40.11 with HTTP; Thu, 20 Sep 2007 03:43:47 -0700 (PDT)
Message-ID: <985dad3a0709200343w5ff327c8n6cb4d0674bb75797@mail.gmail.com>
Date: Thu, 20 Sep 2007 13:43:47 +0300
From: "Landlord Bulfleet" <landlord1...@gmail.com>
To: django-users@googlegroups.com
Subject: Re: unsupported operand type(s) for *: 'Decimal' and 'Decimal'
In-Reply-To: <2545a92c0709191418j18fe559et6ce88fccb2a88...@mail.gmail.com>
Mime-Version: 1.0
Content-Type: multipart/alternative;
boundary="----=_Part_27104_30389149.1190285027404"
References: <985dad3a0709190541q1d4136b7r2408fd9e52a35...@mail.gmail.com>
<2545a92c0709191418j18fe559et6ce88fccb2a88...@mail.gmail.com>
------=_Part_27104_30389149.1190285027404
Content-Type: text/plain; charset=ISO-8859-1
Thanks :)
Looks like this is the solution to our problem. We haven't tested it yet but
will try soon.
Thanks again
On 9/20/07, Jeremy Dunck <jdu...@gmail.com> wrote:
>
> On 9/19/07, Landlord Bulfleet <landlord1...@gmail.com> wrote:
> ...
> >
> > sum is property of a model object in our database
> > (models.DecimalField(max_digits=7, decimal_places=2)) & f_c.rate is a
> > Decimal constructed using Decimal(string) construction (Decimal is
> imported
> > with "from decimal import Decimal")
> >
> > We have some doubts that this may be a result of the django's python 2.3
> > _decimal compatibility.
>
> You're using PsycoPG with multiple interpreters. :)
>
> http://www.initd.org/tracker/psycopg/ticket/192
>
> http://groups.google.com/group/django-developers/browse_thread/thread/63046b2fca27673c/898dbf8da327ce71
>
> Anyway, I did run into this using psycopg1, but switched to psycopg2
> and patched it since 1) it's being maintained and 2) it was easier to
> fix that way.
>
> I emailed the psycopg list a couple weeks ago with a patch but never
> heard back from them. I don't have rights to add the patch to their
> ticket tracker, or I'd do that, too.
>
> I'm attaching a patch against psycopg2's source code here. This is
> for r896 on the 2.0.x branch.
>
> Alternatively, you could run separate apache processes for each needed
> interpreter or switch to mod_wsgi.
>
> I wasn't prepared to swtich to mod_wsgi in a hurry, so patched
> psycopg2 instead.
>
> Apparently not that many people are using multiple interpreters and
> decimal fields with psycopg...
>
> >
>
>
------=_Part_27104_30389149.1190285027404
Content-Type: text/html; charset=ISO-8859-1
Thanks :)<br><br>Looks like this is the solution to our problem. We haven't tested it yet but will try soon.<br><br>Thanks again<br><br><div><span class="gmail_quote">On 9/20/07, <b class="gmail_sendername">Jeremy Dunck
</b> <<a href="mailto:jdu...@gmail.com">jdu...@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">On 9/19/07, Landlord Bulfleet <
<a href="mailto:landlord1...@gmail.com">landlord1...@gmail.com</a>> wrote:<br>...<br>><br>> sum is property of a model object in our database<br>> (models.DecimalField(max_digits=7, decimal_places=2)) & f_c.rate is a
<br>> Decimal constructed using Decimal(string) construction (Decimal is imported<br>> with "from decimal import Decimal")<br>><br>> We have some doubts that this may be a result of the django's python
2.3<br>> _decimal compatibility.<br><br>You're using PsycoPG with multiple interpreters. :)<br><br><a href="http://www.initd.org/tracker/psycopg/ticket/192">http://www.initd.org/tracker/psycopg/ticket/192</a><br><a href="http://groups.google.com/group/django-developers/browse_thread/thread/63046b2fca27673c/898dbf8da327ce71">
http://groups.google.com/group/django-developers/browse_thread/thread/63046b2fca27673c/898dbf8da327ce71</a><br><br>Anyway, I did run into this using psycopg1, but switched to psycopg2<br>and patched it since 1) it's being maintained and 2) it was easier to
<br>fix that way.<br><br>I emailed the psycopg list a couple weeks ago with a patch but never<br>heard back from them. I don't have rights to add the patch to their<br>ticket tracker, or I'd do that, too.<br><br>
I'm attaching a patch against psycopg2's source code here. This is<br>for r896 on the 2.0.x branch.<br><br>Alternatively, you could run separate apache processes for each needed<br>interpreter or switch to mod_wsgi.
<br><br>I wasn't prepared to swtich to mod_wsgi in a hurry, so patched<br>psycopg2 instead.<br><br>Apparently not that many people are using multiple interpreters and<br>decimal fields with psycopg...<br><br>
------=_Part_27104_30389149.1190285027404--