[Django] #34122: models.ForeignObject is missing documentation

12 views
Skip to first unread message

Django

unread,
Oct 26, 2022, 12:06:30 PM10/26/22
to django-...@googlegroups.com
#34122: models.ForeignObject is missing documentation
-------------------------------------+-------------------------------------
Reporter: Ömer | Owner: nobody
Faruk Abacı |
Type: | Status: new
Cleanup/optimization |
Component: | Version: 4.1
Documentation | Keywords: custom join,
Severity: Normal | multiple column join, foreignobject
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
While trying to implement a custom multiple-column join I have spent hours
to find an elegant way, at the end I have found an old issue here:

https://code.djangoproject.com/ticket/19385

Then I have realized that I can use `ForeignObject` for custom joins.
Almost all of the solutions online suggest using raw SQLs with
`Manager.raw()` or `QuerySet.extra()`, none of them mention about
`ForeignObject`. I don't know if it was on purpose or not but I thought
that it might be good to mention about the `ForeignObject` in the
following section:

https://docs.djangoproject.com/en/4.1/ref/models/relations/

What do you think?

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

Django

unread,
Oct 27, 2022, 1:53:18 AM10/27/22
to django-...@googlegroups.com
#34122: models.ForeignObject is missing documentation
-------------------------------------+-------------------------------------
Reporter: Ömer Faruk Abacı | Owner: nobody
Type: | Status: closed
Cleanup/optimization |
Component: Documentation | Version: 4.1
Severity: Normal | Resolution: wontfix
Keywords: custom join, | Triage Stage:
multiple column join, | Unreviewed
foreignobject |
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by David Sanders):

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


Comment:

ForeignObject isn't documented because it isn't earmarked for public use.
That being said there's some external documentation on it in a few places
to implement custom joins, one good one here:
https://devblog.kogan.com/blog/custom-relationships-in-django

Closing as won'tfix. If you'd like to raise this topic making
ForeignObject public please free to start a discussion on the
DevelopersMailingList.

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

Django

unread,
Oct 27, 2022, 2:42:47 AM10/27/22
to django-...@googlegroups.com
#34122: models.ForeignObject is missing documentation
-------------------------------------+-------------------------------------
Reporter: Ömer Faruk Abacı | Owner: nobody
Type: | Status: closed
Cleanup/optimization |
Component: Documentation | Version: 4.1
Severity: Normal | Resolution: wontfix
Keywords: custom join, | Triage Stage:
multiple column join, | Unreviewed
foreignobject |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Ömer Faruk Abacı):

I see your point, thank you!

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

Django

unread,
Oct 27, 2022, 6:31:05 AM10/27/22
to django-...@googlegroups.com
#34122: models.ForeignObject is missing documentation
-------------------------------------+-------------------------------------
Reporter: Ömer Faruk Abacı | Owner: nobody
Type: | Status: closed
Cleanup/optimization |
Component: Documentation | Version: 4.1
Severity: Normal | Resolution: wontfix
Keywords: custom join, | Triage Stage:
multiple column join, | Unreviewed
foreignobject |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Carlton Gibson):

* cc: Simon Charette (added)


Comment:

Simon had a proposal in his DjangoCon US 2020 keynote about documenting
some of the internals in a way that would help people learn the ORM, but
not make them public and so commit to API stability. I don't know how that
would role out, or if this would fall under it specifically, but it seems
related.

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

Django

unread,
Oct 27, 2022, 6:34:08 AM10/27/22
to django-...@googlegroups.com
#34122: models.ForeignObject is missing documentation
-------------------------------------+-------------------------------------
Reporter: Ömer Faruk Abacı | Owner: nobody
Type: | Status: closed
Cleanup/optimization |
Component: Documentation | Version: 4.1
Severity: Normal | Resolution: wontfix
Keywords: custom join, | Triage Stage:
multiple column join, | Unreviewed
foreignobject |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak):

Replying to [comment:3 Carlton Gibson]:


> Simon had a proposal in his DjangoCon US 2020 keynote about documenting
some of the internals in a way that would help people learn the ORM, but
not make them public and so commit to API stability. I don't know how that
would role out, or if this would fall under it specifically, but it seems
related.

We have a ticket for this :), see #27617.

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

Django

unread,
Oct 27, 2022, 6:40:14 AM10/27/22
to django-...@googlegroups.com
#34122: models.ForeignObject is missing documentation
-------------------------------------+-------------------------------------
Reporter: Ömer Faruk Abacı | Owner: nobody
Type: | Status: closed
Cleanup/optimization |
Component: Documentation | Version: 4.1
Severity: Normal | Resolution: wontfix
Keywords: custom join, | Triage Stage:
multiple column join, | Unreviewed
foreignobject |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Carlton Gibson):

Of course we do :D

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

Reply all
Reply to author
Forward
0 new messages