I misspoke earlier. I said you could specify a Select widget for a CharField to get that output. I don't know if that will actually work (you could try it)
field3 = CharField(widget=Select(choices=<tuple of choices>)) but I'm not sure what it will do since I've never tried it and don't have access to a Python interpreter at the moment. The "proper" way to do this would be with a ChoiceField That would be: field3 = ChoiceField(choices=<tuple of choices>) They may be functionally equivalent, again I'm not sure. Does anyone else have thoughts about a FloatField? On Jan 24, 1:37 pm, "ak" <[EMAIL PROTECTED]> wrote: > > field1 = CharField(max_length=10, widget=HiddenInput)Thanks :) > I've also found another way, but it seems dirty: > MyForm.fields['some_field'].widget.input_type = 'hidden' > > > As for the FloatField, I can't think of any way to get a float value > > out of the default clean() method, but you can override it with > > clean_<fieldname>() in your form class definition. For example:I think you > > misunderstood me a bit > The question was not 'how to do it', the question meant 'why it's not > done' > > > I personally am all for a FloatField, and would be happy to write that > > code if other feel it would be useful and proper in newforms.As for me, I > > think it is useful. > > Also what do you think about the last part of my first message ? I > meant about CharField(choices=(...)) should be shown as <input > type="select" ...> as it does for oldforms instead of current behavior > <input type="text" ...> --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---