Re: [Django] #9368: Clean up code for getting columns for select query

8 views
Skip to first unread message

Django

unread,
May 5, 2011, 2:44:34 PM5/5/11
to django-...@googlegroups.com
#9368: Clean up code for getting columns for select query
-------------------------------------+-------------------------------------
Reporter: adunar | Owner: mtredinnick
Type: | Status: assigned
Uncategorized | Component: Database layer
Milestone: | (models, ORM)
Version: | Severity: Normal
Resolution: | Keywords:
Triage Stage: Accepted | Has patch: 1
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 1 | Easy pickings: 0
-------------------------------------+-------------------------------------
Changes (by patchhammer):

* needs_better_patch: 0 => 1
* type: => Uncategorized
* severity: => Normal
* easy: => 0


Comment:

query_cleanup.diff fails to apply cleanly on to trunk

--
Ticket URL: <http://code.djangoproject.com/ticket/9368#comment:4>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jan 18, 2013, 1:21:11 AM1/18/13
to django-...@googlegroups.com
#9368: Clean up code for getting columns for select query
-------------------------------------+-------------------------------------
Reporter: adunar | Owner:
Type: | mtredinnick
Cleanup/optimization | Status: assigned
Component: Database layer | Version:
(models, ORM) | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: | Needs documentation: 0
Has patch: 1 | Patch needs improvement: 1
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (by akaariai):

I did some investigation some time ago for rewriting the cols output code
- the code is available from
https://github.com/akaariai/django/compare/dedupe_cols.

The original idea was to have just "col" syntax instead of
"tbl_alias"."col" syntax unless the col is duplicated in some other table.
This would result in much nicer looking SQL. However, this approach has a
fundamental problem: We don't actually know all the cols in a table, just
those the user has in the models. At the least we would need some way for
the user to tell that this table has these extra cols, even if they are
not part of the model definition. Otherwise we will break existing code
with no upgrade path at all.

After the dedupe cols experiment I hacked a bit more, and the changes
ended happening all-around. So, the branch isn't meant for inclusion.
Still, I think the code could be useful as a reference point if somebody
decides to tackle this issue.

--
Ticket URL: <https://code.djangoproject.com/ticket/9368#comment:7>

Django

unread,
Aug 6, 2015, 4:41:35 PM8/6/15
to django-...@googlegroups.com
#9368: Clean up code for getting columns for select query
-------------------------------------+-------------------------------------
Reporter: adunar | Owner:
Type: | Status: new
Cleanup/optimization |

Component: Database layer | Version:
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by timgraham):

It seems that `get_columns()` is no longer overridden in GIS after
0c7633178fa9410f102e4708cef979b873bccb76. Is it time to close this ticket
or is there more work to do?

--
Ticket URL: <https://code.djangoproject.com/ticket/9368#comment:9>

Django

unread,
Oct 27, 2015, 2:33:15 AM10/27/15
to django-...@googlegroups.com
#9368: Clean up code for getting columns for select query
-------------------------------------+-------------------------------------
Reporter: adunar | Owner:
Type: | Status: closed

Cleanup/optimization |
Component: Database layer | Version:
(models, ORM) |
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by akaariai):

* status: new => closed
* resolution: => fixed


Comment:

There is likely more we can clean in select clause generation, but the
main issue of this ticket (duplication of login) has been fixed.

--
Ticket URL: <https://code.djangoproject.com/ticket/9368#comment:10>

Reply all
Reply to author
Forward
0 new messages