Opened 17 years ago
Closed 17 years ago
#6875 closed (wontfix)
Allow for easier QuerySet customization.
Reported by: | floguy | Owned by: | floguy |
---|---|---|---|
Component: | Uncategorized | Version: | queryset-refactor |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Unreviewed | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | yes | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
The impetus for this patch is that it will be difficult for the built-in QuerySet implementation to satisfy everyone's needs (as evidenced by some vehement disagreements about aggregate functionality on django-dev).
Currently the only way to really deal with this is to fork Django and keep a local copy up to date.
This patch allows for the specification of a default QuerySet class (which can be located anywhere on the PythonPath) which will be used in all query operations. To add group_by functionality, for example, one could subclass django.db.models.query.BaseQuerySet and add a group_by function. Then, specify DEFAULT_QUERYSET_CLASS to be the path to your custom subclass. Now group_by would be available in all filters, managers, etc. without ever having forked Django.
In fact, there could now be a whole host of externally-hosted QuerySet subclasses, and therefore new ideas could be more easily experimented with.
Thoughts? Ideas? Should I bring this up on django-dev?
Attachments (1)
Change History (6)
by , 17 years ago
Attachment: | custom_queryset_setting.diff added |
---|
comment:1 by , 17 years ago
Needs tests: | set |
---|
comment:3 by , 17 years ago
dcramer: I'm not sure exactly what that was supposed to mean. An accidental submit?
comment:4 by , 17 years ago
Sorry, should have been on two lines, but you can import the settings in such a manner to reconfigure most settings "on the fly" as you put it.
comment:5 by , 17 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
wontfix -- see the discussion on django-dev.
By the way, I'm completely at a loss for how to test this, as settings don't seem to be able to be reconfigured on-the-fly.