> 1) This sounds like it could be a bug. If your model defines 2 decimal
> places, my initial reaction is that the form should show 2 decimal
> places by default.

Well, I figured that with currency being such a common use, if it were
a bug it would already have been found and squashed.  But maybe what
I'm doing is unusual -- I'm feeding the field an initial value of
25.00, and the form is displaying "25.0"

> 2) You can override an individual element using the formfield_callback
> on form_for_model. The idea here is to provide a function that returns
> the form field when provided with a model field. The default
> implementation calls the formfield() method on the model field; If you
> want to use a different widget for just one field, you can provide an
> implementation for formfield_callback that overrides just one field.

Ah, OK, I think I'm starting to understand how this newforms stuff
works now -- thanks!

So I just overrode the field with a callback (it's working, since the
label override is working) and did a few more tests of initial data
values:

value: 25.0
displayed: 25.0

value: 25.01
displayed: 25.01

value: 25
displayed: 25

value: 25.001
displayed: 25.001

value: 25.000
displayed: 25.0

Is that info any use?


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

Reply via email to