From: James Ren Subject: Re: [PATCH] Change decimal_places from 31 to 2 in frontend/tko/models.py Date: Thu, 25 Mar 2010 13:26:31 -0700 Message-ID: <32a90f551003251326n797f45b8h4a938941cfc2e166@mail.gmail.com> References: <1269250936-9550-1-git-send-email-fyang@redhat.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0621980267==" Cc: autotest@test.kernel.org, kvm@vger.kernel.org To: Feng Yang Return-path: In-Reply-To: <1269250936-9550-1-git-send-email-fyang@redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Mime-version: 1.0 Sender: autotest-bounces@test.kernel.org Errors-To: autotest-bounces@test.kernel.org List-Id: kvm.vger.kernel.org --===============0621980267== Content-Type: multipart/alternative; boundary=00504502afb0bbbc990482a5dc39 --00504502afb0bbbc990482a5dc39 Content-Type: text/plain; charset=ISO-8859-1 It looks like iteration_result.value is specified as a FLOAT field in our database. I'd prefer to replace type with dbmodels.FloatField -James On Mon, Mar 22, 2010 at 2:42 AM, Feng Yang wrote: > decimal_places must less-than-or-equal-to max_digits in > 'numeric(max_digits, decimal_places)' in mysql syntax. > max_digits is 12, so decimal_places must <= 12. Set > decimal_places to 2. > > Signed-off-by: Feng Yang > --- > frontend/tko/models.py | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/frontend/tko/models.py b/frontend/tko/models.py > index 7348b07..abf12b2 100644 > --- a/frontend/tko/models.py > +++ b/frontend/tko/models.py > @@ -231,7 +231,7 @@ class IterationResult(dbmodels.Model, > model_logic.ModelExtensions): > test = dbmodels.ForeignKey(Test, db_column='test_idx', > primary_key=True) > iteration = dbmodels.IntegerField() > attribute = dbmodels.CharField(max_length=90) > - value = dbmodels.DecimalField(null=True, max_digits=12, > decimal_places=31, > + value = dbmodels.DecimalField(null=True, max_digits=12, > decimal_places=2, > blank=True) > > objects = model_logic.ExtendedManager() > -- > 1.5.5.6 > > _______________________________________________ > Autotest mailing list > Autotest@test.kernel.org > http://test.kernel.org/cgi-bin/mailman/listinfo/autotest > --00504502afb0bbbc990482a5dc39 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable It looks like iteration_result.value is specified as a FLOAT field in our d= atabase. I'd prefer to replace type with dbmodels.FloatField

-James

On Mon, Mar 22, 2010= at 2:42 AM, Feng Yang <fyang@redhat.com> wrote:
decimal_places must less-than-or-equal-to m= ax_digits in
'numeric(max_digits, decimal_places)' in mysql syntax.
max_digits is 12, so decimal_places must <=3D 12. Set
decimal_places to 2.

Signed-off-by: Feng Yang <fyang@redh= at.com>
---
=A0frontend/tko/models.py | =A0 =A02 +-
=A01 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/frontend/tko/models.py b/frontend/tko/models.py
index 7348b07..abf12b2 100644
--- a/frontend/tko/models.py
+++ b/frontend/tko/models.py
@@ -231,7 +231,7 @@ class IterationResult(dbmodels.Model, model_logic.Model= Extensions):
=A0 =A0 test =3D dbmodels.ForeignKey(Test, db_column=3D'test_idx',= primary_key=3DTrue)
=A0 =A0 iteration =3D dbmodels.IntegerField()
=A0 =A0 attribute =3D dbmodels.CharField(max_length=3D90)
- =A0 =A0value =3D dbmodels.DecimalField(null=3DTrue, max_digits=3D12, deci= mal_places=3D31,
+ =A0 =A0value =3D dbmodels.DecimalField(null=3DTrue, max_digits=3D12, deci= mal_places=3D2,
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 blank= =3DTrue)

=A0 =A0 objects =3D model_logic.ExtendedManager()
--
1.5.5.6

_______________________________________________
Autotest mailing list
Autotest@test.kernel.org http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

--00504502afb0bbbc990482a5dc39-- --===============0621980267== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Autotest mailing list Autotest@test.kernel.org http://test.kernel.org/cgi-bin/mailman/listinfo/autotest --===============0621980267==--