Opened 14 years ago
Closed 12 years ago
#14757 closed Bug (wontfix)
Add An Example For .extra(tables=[])
Reported by: | Mike Shultz | Owned by: | nobody |
---|---|---|---|
Component: | Documentation | Version: | 1.2 |
Severity: | Normal | Keywords: | documentation extra tables |
Cc: | shultzm@…, john@… | Triage Stage: | Accepted |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | yes |
Easy pickings: | yes | UI/UX: | no |
Description
When fiddling around trying to find a solution to one of my problems, it seems to be that .extra(tables=[]) was what I needed. I took a trip through the django documentation just to find that there were no examples, or even a description into what kind of 'string' it takes. Is it JOIN statements? Just a name of a table and/or matching columns?
Please add an example to the documentation and/or a better explanation of the string it accepts.
Attachments (2)
Change History (11)
comment:1 by , 14 years ago
Triage Stage: | Unreviewed → Accepted |
---|
by , 14 years ago
Attachment: | 14757.diff added |
---|
Add example using both tables and where in Queryset.extra()
comment:2 by , 14 years ago
Cc: | added |
---|---|
Has patch: | set |
Attached a patch to add this documentation. The example is fairly trivial (in fact, it makes more sense as a simple filter())
comment:3 by , 14 years ago
Severity: | → Normal |
---|---|
Type: | → Bug |
comment:4 by , 13 years ago
Easy pickings: | unset |
---|
The example follows the bad practice of embedding values in the where
clause rather than in params
It'd also be better if the example was hypothetically useful.
comment:5 by , 13 years ago
Easy pickings: | set |
---|---|
Patch needs improvement: | set |
by , 13 years ago
Attachment: | querysets.txt.diff added |
---|
comment:7 by , 13 years ago
Is this note necessary? I can't find any useful example of using extra(where=...)
- everything can be done with objects.filter
. I suggest to close this ticket.
comment:8 by , 12 years ago
The documentation now explains what format tables
should be in. I suspect that the only uses of this are fairly complex, and so the effort in explaining the context in documentation is going to outweigh the value of an actual example.
comment:9 by , 12 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
Agreed with the last two comments, if we can't come up with a useful example here I don't see much use in adding this.
Agreed. There is an example for
where
, but not fortables
. Adding this would be helpful.