[Django] #25069: Make _unregister_lookup be public API

18 views
Skip to first unread message

Django

unread,
Jul 6, 2015, 12:11:38 PM7/6/15
to django-...@googlegroups.com
#25069: Make _unregister_lookup be public API
----------------------------------------------+----------------------
Reporter: coldmind | Owner: coldmind
Type: New feature | Status: new
Component: Database layer (models, ORM) | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
----------------------------------------------+----------------------
(as a follow-up for discussion from
https://github.com/django/django/pull/4948)

Django allows users to register a custom lookups, but there are no public
way to unregister it.
I don't see a reason to keep `_unregister_lookup` as a private API, so I'm
proposing to make it be public and add documentation for it.

--
Ticket URL: <https://code.djangoproject.com/ticket/25069>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jul 6, 2015, 12:24:10 PM7/6/15
to django-...@googlegroups.com
#25069: Make _unregister_lookup be public API
-------------------------------------+-------------------------------------

Reporter: coldmind | Owner: coldmind
Type: New feature | Status: new
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):

* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0


Comment:

Do you have a use case in mind?

--
Ticket URL: <https://code.djangoproject.com/ticket/25069#comment:1>

Django

unread,
Jul 6, 2015, 12:30:01 PM7/6/15
to django-...@googlegroups.com
#25069: Make _unregister_lookup be public API
-------------------------------------+-------------------------------------

Reporter: coldmind | Owner: coldmind
Type: New feature | Status: new
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by coldmind):

Well, my vision (in abstract) is if there is a public API to produce some
changes (for this case to add new entity to existing collection) there
should be a way to revert this change (for this case to remove entity from
collection).

--
Ticket URL: <https://code.djangoproject.com/ticket/25069#comment:2>

Django

unread,
Jul 6, 2015, 12:51:16 PM7/6/15
to django-...@googlegroups.com
#25069: Make _unregister_lookup be public API
-------------------------------------+-------------------------------------

Reporter: coldmind | Owner: coldmind
Type: New feature | Status: new
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by timgraham):

We can wait for Anssi to say if there's any more explanation for making it
private other than the existing comment, "Meant to be used in tests only,"
but I don't see much advantage to making a public method that doesn't have
a concrete use case.

--
Ticket URL: <https://code.djangoproject.com/ticket/25069#comment:3>

Django

unread,
Jul 6, 2015, 1:06:48 PM7/6/15
to django-...@googlegroups.com
#25069: Make _unregister_lookup be public API
-------------------------------------+-------------------------------------

Reporter: coldmind | Owner: coldmind
Type: New feature | Status: new
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by coldmind):

Well, I prefer to remove it at all :) I don't see a reason to have method
in codebase, which is used only in tests. We can avoid it as I described
it in comment of my PR.
Simon's opinion is that this method is needed.
So, I think if we will leave it, it should be made public.

--
Ticket URL: <https://code.djangoproject.com/ticket/25069#comment:4>

Django

unread,
Jul 6, 2015, 3:21:05 PM7/6/15
to django-...@googlegroups.com
#25069: Make _unregister_lookup be public API
-------------------------------------+-------------------------------------

Reporter: coldmind | Owner: coldmind
Type: New feature | Status: new
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by charettes):

My point is that I'd rather have a method (private or public) that deals
with the implementation details of lookup unregistration than moving this
logic in the tests by directly assigning to `class_looukps`.

--
Ticket URL: <https://code.djangoproject.com/ticket/25069#comment:5>

Django

unread,
Jul 14, 2015, 7:48:15 AM7/14/15
to django-...@googlegroups.com
#25069: Make _unregister_lookup be public API
-------------------------------------+-------------------------------------

Reporter: coldmind | Owner: coldmind
Type: New feature | Status: new
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):

* cc: akaariai (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/25069#comment:6>

Django

unread,
Jul 29, 2015, 3:25:31 PM7/29/15
to django-...@googlegroups.com
#25069: Make _unregister_lookup be public API
-------------------------------------+-------------------------------------
Reporter: coldmind | Owner: coldmind
Type: New feature | Status: closed

Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution: wontfix
Keywords: | Triage Stage:
| Unreviewed

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):

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


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

Reply all
Reply to author
Forward
0 new messages