Opened 19 years ago
Closed 18 years ago
#4090 closed (wontfix)
Allow django.newforms.extras be included at django.newforms
| Reported by: | Owned by: | nobody | |
|---|---|---|---|
| Component: | Forms | Version: | dev | 
| Severity: | Keywords: | ||
| Cc: | Triage Stage: | Design decision needed | |
| Has patch: | yes | Needs documentation: | no | 
| Needs tests: | no | Patch needs improvement: | no | 
| Easy pickings: | no | UI/UX: | no | 
Description
I use the following code to get access to newforms code.
import django.newforms as forms
class MyForm(forms.Form)
    mydate = forms.DateField()
All works well, but following the same convention and wanting to use the django.newforms.extras.SelectDateWidget will result in extras not being found.
import django.newforms as forms
class MyForm(forms.Form)
    mydate = forms.DateField(widget=forms.extras.SelectDateWidget())
I have attached the one liner needed in django/newforms/init.py to allow for this.  I don't see it as causing any problems.
Attachments (1)
Change History (3)
by , 19 years ago
| Attachment: | newforms_import_extras.diff added | 
|---|
comment:1 by , 19 years ago
| Triage Stage: | Unreviewed → Design decision needed | 
|---|
Adrian, was this intentional?
comment:2 by , 18 years ago
| Resolution: | → wontfix | 
|---|---|
| Status: | new → closed | 
I'm -1 on this. One of the reasons behind the extras module is to separate uncommonly used fields/widgets so that they're not loaded if they're not needed. This patch makes it so that they're always loaded, which goes against the whole point of having an extras module.
One Liner to fix #4090