#28879: Widget NumberInput becomes text if you change size
-------------------------------------+-------------------------------------
Reporter: Chris Davies- | Owner: nobody
Barnard |
Type: Uncategorized | Status: closed
Component: Uncategorized | Version: 1.11
Severity: Normal | Resolution: needsinfo
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):
* status: new => closed
* resolution: => needsinfo
Old description:
> I'm adjusting the width of some form fields because small integers such
> as qty and price don't need to be 20 long and the following code results
> in them becoming type = 'text' regardless.
>
> models.DecimalField: {'widget': TextInput(attrs={'size':'7'})},
> models.IntegerField: {'widget': NumberInput(attrs={'size':'3'})},
>
> breaking other aspects. Sorry don't know if I need to add more detail
> etc...
New description:
I'm adjusting the width of some form fields because small integers such as
qty and price don't need to be 20 long and the following code results in
them becoming type = 'text' regardless.
{{{
models.DecimalField: {'widget': TextInput(attrs={'size':'7'})},
models.IntegerField: {'widget': NumberInput(attrs={'size':'3'})},
}}
breaking other aspects. Sorry don't know if I need to add more detail
etc...
--
Comment:
I guess you're putting those lines in a `ModelAdmin.formfield_overrides`?
I tried this and couldn't reproduce the problem. Please reopen if you can
provide a sample project or a test case that demonstrates the problem.
--
Ticket URL: <https://code.djangoproject.com/ticket/28879#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/072.e9e1429482e209a9759b4223a65c5ee2%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.