List Info

Thread: Django admin error?




Django admin error?
user name
2008-02-23 08:42:10
When trying to add 46.229253 to a floatfield
I get displayed error:

Please enter a valid decimal number with a whole part of at
most -19
digits

Any ideas?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Django admin error?
user name
2008-02-24 09:10:05
> On Sat, 2008-02-23 at 06:42 -0800, PB wrote:
> > When trying to add 46.229253 to a floatfield
> > I get displayed error:
>
> > Please enter a valid decimal number with a whole part of at most -19
> > digits
>
> > Any ideas?

On Sun, Feb 24, 2008 at 9:04 AM, PB < PeterBraden1googlemail.com">PeterBraden1googlemail.com> wrote:

Hi,

I'm using Django 0.96. The model has the lines:

latitude = models.FloatField(null=True, max_digits=12,
decimal_places=31, blank=True)
longitude = models.FloatField(null=True, max_digits=12,
decimal_places=31, blank=True)

Then when trying to use the admin tool it throws the above error.

Well, 12-31 is -19.   I'm guessing (without checking the doc) that max_digits is supposed to include decimal_places, thus always be greater than or equal to it, and yours are not.  If you want a whole part max of 12, decimal part max of 31, make your max_digits 12+31, not 12.

Karen

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Django users"; group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to django-users-unsubscribegooglegroups.com
For more options, visit this group at http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: Django admin error?
user name
2008-02-23 16:57:34

On Sat, 2008-02-23 at 06:42 -0800, PB wrote:
> When trying to add 46.229253 to a floatfield
> I get displayed error:
> 
> Please enter a valid decimal number with a whole part
of at most -19
> digits
> 
> Any ideas?

What happens when you do enter a float with negative
nineteen (or fewer)
digits? Does it work then?

Perhaps a few more clues are necessary here: what version of
Django are
you using (since FloatField has changed within the last 12
months)? What
does your model look like? What happens if you reduce it to
a small
example containing just that field?

Regards,
Malcolm

-- 
On the other hand, you have different fingers. 
http://www.pointy-s
tick.com/blog/


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Django admin error?
user name
2008-02-24 08:04:40
Hi,

I'm using Django 0.96. The model has the lines:

latitude = models.FloatField(null=True, max_digits=12,
decimal_places=31, blank=True)
longitude = models.FloatField(null=True, max_digits=12,
decimal_places=31, blank=True)

Then when trying to use the admin tool it throws the above
error.




On Feb 23, 10:57 pm, Malcolm Tredinnick <malc...pointy-stick.com>
wrote:
> On Sat, 2008-02-23 at 06:42 -0800, PB wrote:
> > When trying to add 46.229253 to a floatfield
> > I get displayed error:
>
> > Please enter a valid decimal number with a whole
part of at most -19
> > digits
>
> > Any ideas?
>
> What happens when you do enter a float with negative
nineteen (or fewer)
> digits? Does it work then?
>
> Perhaps a few more clues are necessary here: what
version of Django are
> you using (since FloatField has changed within the last
12 months)? What
> does your model look like? What happens if you reduce
it to a small
> example containing just that field?
>
> Regards,
> Malcolm
>
> --
> On the other hand, you have different fingers.http://www.pointy-s
tick.com/blog/
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---


[1-4]

about | contact  Other archives ( Real Estate discussion Medical topics )