Re: [Django] #9475: add(), create(), etc. should be supported by intermediate ManyToMany model with extra attributes if extra fields can be calculated

55 views
Skip to first unread message

Django

unread,
Jan 19, 2016, 3:27:17 PM1/19/16
to django-...@googlegroups.com
#9475: add(), create(), etc. should be supported by intermediate ManyToMany model
with extra attributes if extra fields can be calculated
-------------------------------------+-------------------------------------
Reporter: omat@… | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Fak3):

* cc: someuniquename@… (added)


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

Django

unread,
Mar 27, 2016, 6:10:21 AM3/27/16
to django-...@googlegroups.com
#9475: add(), create(), etc. should be supported by intermediate ManyToMany model
with extra attributes if extra fields can be calculated
-------------------------------------+-------------------------------------
Reporter: omat@… | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by freshquiz):

* cc: piethon@… (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/9475#comment:19>

Django

unread,
May 10, 2016, 1:31:02 PM5/10/16
to django-...@googlegroups.com
#9475: add(), create(), etc. should be supported by intermediate ManyToMany model
with extra attributes if extra fields can be calculated
-------------------------------------+-------------------------------------
Reporter: omat@… | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by ad-m):

* cc: naczelnik-djangoproject@… (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/9475#comment:20>

Django

unread,
Mar 9, 2017, 3:11:23 PM3/9/17
to django-...@googlegroups.com
#9475: add(), create(), etc. should be supported by intermediate ManyToMany model
with extra attributes if extra fields can be calculated
-------------------------------------+-------------------------------------
Reporter: omat@… | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Dylan Young):

I'm a little confused as to why we don't just add an extra optional kwarg
to these methods to support custom through models (i.e. defaults for
add/create/set and lookups for remove).

Can someone clarify?

--
Ticket URL: <https://code.djangoproject.com/ticket/9475#comment:21>

Django

unread,
Mar 20, 2017, 8:53:32 PM3/20/17
to django-...@googlegroups.com
#9475: add(), create(), etc. should be supported by intermediate ManyToMany model
with extra attributes if extra fields can be calculated
-------------------------------------+-------------------------------------
Reporter: omat@… | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Collin Anderson):

proof of concept:
https://github.com/django/django/compare/master...collinanderson:ticket9475

--
Ticket URL: <https://code.djangoproject.com/ticket/9475#comment:22>

Django

unread,
Apr 10, 2017, 2:12:09 PM4/10/17
to django-...@googlegroups.com
#9475: add(), create(), etc. should be supported by intermediate ManyToMany model
with extra attributes if extra fields can be calculated
-------------------------------------+-------------------------------------
Reporter: omat@… | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Victor Porton):

Also by the course of fixing this bug we should eliminate error messages
for `ModelForm`s like:

> AttributeError: Cannot set values on a ManyToManyField which specifies
an intermediary model. Use post_app.PostInTimeline's Manager instead.

--
Ticket URL: <https://code.djangoproject.com/ticket/9475#comment:23>

Django

unread,
Aug 26, 2017, 11:14:56 AM8/26/17
to django-...@googlegroups.com
#9475: add(), create(), etc. should be supported by intermediate ManyToMany model
with extra attributes if extra fields can be calculated
-------------------------------------+-------------------------------------
Reporter: omat@… | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Collin Anderson):

* cc: Collin Anderson (added)


Comment:

Pull Request: https://github.com/django/django/pull/8981

--
Ticket URL: <https://code.djangoproject.com/ticket/9475#comment:24>

Django

unread,
Sep 7, 2017, 12:08:55 AM9/7/17
to django-...@googlegroups.com
#9475: add(), create(), etc. should be supported by intermediate ManyToMany model
with extra attributes if extra fields can be calculated
-------------------------------------+-------------------------------------
Reporter: omat@… | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

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

* needs_docs: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/9475#comment:25>

Django

unread,
Jan 18, 2018, 12:34:11 AM1/18/18
to django-...@googlegroups.com
#9475: add(), create(), etc. should be supported by intermediate ManyToMany model
with extra attributes if extra fields can be calculated
-------------------------------------+-------------------------------------
Reporter: omat@… | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

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

* cc: astandley (added)
* needs_tests: 0 => 1


Comment:

https://github.com/django/django/pull/8981 lacks tests for successful
add(), create(), etc for ManyToManyFields where extra fields are required
on the through model.
The required_through field is only tested for failure.

--
Ticket URL: <https://code.djangoproject.com/ticket/9475#comment:26>

Django

unread,
Oct 12, 2018, 12:06:25 PM10/12/18
to django-...@googlegroups.com
#9475: add(), create(), etc. should be supported by intermediate ManyToMany model
with extra attributes if extra fields can be calculated
-------------------------------------+-------------------------------------
Reporter: omat@… | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Rich Rauenzahn):

* cc: Rich Rauenzahn (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/9475#comment:27>

Django

unread,
Oct 31, 2018, 3:40:50 PM10/31/18
to django-...@googlegroups.com
#9475: add(), create(), etc. should be supported by intermediate ManyToMany model
with extra attributes if extra fields can be calculated
-------------------------------------+-------------------------------------
Reporter: omat@… | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Zach):

* cc: Zach (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/9475#comment:28>

Django

unread,
Jan 9, 2019, 2:38:05 PM1/9/19
to django-...@googlegroups.com
#9475: add(), create(), etc. should be supported by intermediate ManyToMany model
with extra attributes if extra fields can be calculated
-------------------------------------+-------------------------------------
Reporter: omat@… | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

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

* needs_tests: 1 => 0


Comment:

I just rebased this patch, updated version numbers, and added fail and
success tests for add, create, set, get_or_create, and update_or_create.
https://github.com/django/django/pull/8981

--
Ticket URL: <https://code.djangoproject.com/ticket/9475#comment:29>

Django

unread,
Jan 15, 2019, 11:40:53 AM1/15/19
to django-...@googlegroups.com
#9475: add(), create(), etc. should be supported by intermediate ManyToMany model
with extra attributes if extra fields can be calculated
-------------------------------------+-------------------------------------
Reporter: omat@… | Owner: nobody
Type: New feature | Status: closed

Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

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


Comment:

In [changeset:"769355c76531749d0bc0abad279402e361eaec4e" 769355c7]:
{{{
#!CommitTicketReference repository=""
revision="769355c76531749d0bc0abad279402e361eaec4e"
Fixed #9475 -- Allowed RelatedManager.add(), create(), etc. for m2m with a
through model.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/9475#comment:30>

Django

unread,
Jan 15, 2019, 1:04:04 PM1/15/19
to django-...@googlegroups.com
#9475: add(), create(), etc. should be supported by intermediate ManyToMany model
with extra attributes if extra fields can be calculated
-------------------------------------+-------------------------------------
Reporter: omat@… | Owner: nobody
Type: New feature | Status: closed
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"d212bc03bac1bce074207074a45032bb6bfdf3ec" d212bc0]:
{{{
#!CommitTicketReference repository=""
revision="d212bc03bac1bce074207074a45032bb6bfdf3ec"
Refs #9475 -- Fixed typo, used unpacking generalization, and made
through_defaults kwarg-only.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/9475#comment:31>

Django

unread,
Jan 16, 2019, 9:23:18 AM1/16/19
to django-...@googlegroups.com
#9475: add(), create(), etc. should be supported by intermediate ManyToMany model
with extra attributes if extra fields can be calculated
-------------------------------------+-------------------------------------
Reporter: omat@… | Owner: nobody
Type: New feature | Status: closed
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"dbcf2ffa77af24642c035c58199e6058d91d8e35" dbcf2ff]:
{{{
#!CommitTicketReference repository=""
revision="dbcf2ffa77af24642c035c58199e6058d91d8e35"
Refs #9475 -- Simplified dictionary unpacking.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/9475#comment:32>

Django

unread,
Oct 22, 2020, 4:09:01 AM10/22/20
to django-...@googlegroups.com
#9475: add(), create(), etc. should be supported by intermediate ManyToMany model
with extra attributes if extra fields can be calculated
-------------------------------------+-------------------------------------
Reporter: omat@… | Owner: nobody
Type: New feature | Status: closed
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by GitHub <noreply@…>):

In [changeset:"284bde3fbe07485d64289e28014a4eada68aef91" 284bde3f]:
{{{
#!CommitTicketReference repository=""
revision="284bde3fbe07485d64289e28014a4eada68aef91"
Refs #9475 -- Linked through_default docs to related managers methods.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/9475#comment:33>

Django

unread,
Oct 22, 2020, 4:10:34 AM10/22/20
to django-...@googlegroups.com
#9475: add(), create(), etc. should be supported by intermediate ManyToMany model
with extra attributes if extra fields can be calculated
-------------------------------------+-------------------------------------
Reporter: omat@… | Owner: nobody
Type: New feature | Status: closed
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"8aedad6909becf0a8f62428eb208ad45bd2d363f" 8aedad69]:
{{{
#!CommitTicketReference repository=""
revision="8aedad6909becf0a8f62428eb208ad45bd2d363f"
[3.1.x] Refs #9475 -- Linked through_default docs to related managers
methods.

Backport of 284bde3fbe07485d64289e28014a4eada68aef91 from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/9475#comment:34>

Reply all
Reply to author
Forward
0 new messages