#11795: Allow use of inlines for many-to-many fields
------------------------------------+---------------------------------------
Reporter: sveri | Owner: nobody
Status: reopened | Milestone:
Component: Uncategorized | Version: 1.1
Resolution: | Keywords: manytomanyfield inline
Stage: Unreviewed | Has_patch: 0
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 0 |
------------------------------------+---------------------------------------
Changes (by russellm):
* status: closed => reopened
* resolution: invalid =>
* summary: inline for many-to-many colmuns not working => Allow use of
inlines for many-to-many fields
Old description:
> When i try to create an inline field in admin.py for a manytomanyfield i
> always get the following error:
> <class 'politlog.app.models.Class'> has no ForeignKey to <class
> 'politlog.otherapp.models.OtherClass'>
>
> It seems like django doesnt support inlines for ManyToManyFields whereas
> the documentation says otherwise:
>
http://docs.djangoproject.com/en/dev/ref/contrib/admin/#working-with-
> many-to-many-intermediary-models
>
> I've described my problem also here:
>
http://groups.google.de/group/django-
> users/browse_thread/thread/4586689cbbc07a28/2a1efa4882fcfc67?lnk=gst&q=many+to+many#2a1efa4882fcfc67
New description:
When you try to create an inline field in admin.py for a manytomanyfield
you always get the following error:
<class 'MyClass'> has no ForeignKey to <class 'OtherClass'>
It would be nice to be able to use inlines for many to many relations.
Comment:
I'm not aware of any plans to add this feature. I've modified this ticket
to reflect the feature request.
You may get your wish through a back channel. The changes required by
#10109 will probably make this feature possible with no extra effort, as
that ticket will require introducing a dummy model representation of m2m
fields, and this dummy model may be compatible use in inlines. I plan to
commit a fix for #10109 in the near future as a precursor to multiple-
database and non-SQL backend support. I'll try to keep this ticket in mind
before I commit.
--
Ticket URL: <
http://code.djangoproject.com/ticket/11795#comment:3>