Opened 11 years ago

Closed 11 years ago

Last modified 9 years ago

#21489 closed Cleanup/optimization (fixed)

Expose FormSet on the django.forms package.

Reported by: loic84 Owned by: nobody
Component: Forms Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Currently formsets are not importable directly from django.forms, this is especially inconvenient as they are scattered between django.forms.models and django.forms.formsets and I somehow always fail to locate them.

I propose we add the relevant entries in __all__.

PR https://github.com/django/django/pull/1961.

Change History (8)

comment:1 by Tim Graham, 11 years ago

I believe there was some discussion on IRC about this ticket, could you summarize?

Personally, I have found the fact that these have to be imported differently a bit puzzling and am happy to merge it absent strong objections.

comment:2 by loic84, 11 years ago

If I remember well, Baptiste wasn't totally convinced at first, fearing to add more bloat to an already bloated package. Anssi welcomed the change, arguing that having almost everything in django.forms but leaving just a couple of things out was confusing. Then I believe consensus was reached and the discussion shifted to whether or not we should update the docs.

The issue with updating the docs now is that it would lead to broken imports for people who follow dev docs despite using an earlier version of Django.

The consensus was to update the docs in a couple of versions and open a ticket in the meantime so it doesn't get lost (triage stage of Someday / Maybe?).

FWIW I already have a branch for the docs update https://github.com/loic/django/compare/formset_docs.

comment:3 by Tim Graham, 11 years ago

I'm fine updating the import examples as a someday/maybe item, but I think I would prefer not to make the module changes as done in your branch since it will make backporting doc changes more painful and the synopsis annotations would no longer work.

comment:4 by loic84, 11 years ago

That's a valid concern, no objections from me.

comment:5 by Baptiste Mispelon, 11 years ago

Resolution: fixed
Status: newclosed

comment:6 by Tim Graham <timograham@…>, 9 years ago

In 455034d4:

Fixed #21516 -- Updated imports paths for some formset functions/classes.

Since refs #21489, FormSet classes and factories are exposed on the
django.forms package.

comment:7 by Tim Graham <timograham@…>, 9 years ago

In 44f177b5:

[1.9.x] Fixed #21516 -- Updated imports paths for some formset functions/classes.

Since refs #21489, FormSet classes and factories are exposed on the
django.forms package.

Backport of 455034d4df048010de4ae0a9a2392b70d1463c61 from master

comment:8 by Tim Graham <timograham@…>, 9 years ago

In 42f25467:

[1.8.x] Fixed #21516 -- Updated imports paths for some formset functions/classes.

Since refs #21489, FormSet classes and factories are exposed on the
django.forms package.

Backport of 455034d4df048010de4ae0a9a2392b70d1463c61 from master

Note: See TracTickets for help on using tickets.
Back to Top