Ah, and google does help or at least django_snippets.
I found the solution here:
http://www.djangosnippets.org/snippets/1295

The trick is to create a column in both models and in one with the option to
not syncdb.
Its really simple, just 6 lines at all.


Greetings and a nice Weekend
Sven

On Fri, Aug 28, 2009 at 5:18 PM, Sven Richter <sver...@googlemail.com>wrote:

> But i wonder how this would help me further.
> In the End it doesnt matter for me on which model i define the M2M
> relation.
> But i need to access the M2M Table from both models, at least in the view
> or in the template if not in the admin interface.
>
> I am having a hard time finding out how to achieve that.
>
> Any Ideas?
>
>
> Greetings
> Sven
>
>
> On Fri, Aug 28, 2009 at 3:04 PM, Sven Richter <sver...@googlemail.com>wrote:
>
>> I've opened a bug/feature request at:
>> http://code.djangoproject.com/ticket/11795#comment:2
>> if someone is interested.
>>
>>
>> Greetings
>> Sven
>>
>>
>> On Fri, Aug 28, 2009 at 6:59 AM, Craig McClanahan <craig...@gmail.com>wrote:
>>
>>>
>>> On Thu, Aug 27, 2009 at 10:00 AM, Sven Richter<sver...@googlemail.com>
>>> wrote:
>>> > I found this thread:
>>> >
>>> http://stackoverflow.com/questions/660260/django-admin-form-for-many-to-many-relationship
>>> > on Stackoverflow, but when i try the suggested TabularInline thing i
>>> get the
>>> > error:
>>> >
>>> > <class 'politlog.eventchain.models.EventChain'> has no ForeignKey to
>>> <class
>>> > 'politlog.entry.models.Entries'>
>>> >
>>>
>>> At least with Django 1.0.x, the admin interface does not support
>>> many-to-many relationships on inlines -- it will always return an
>>> error like the one you got above.  Indeed, the message is technically
>>> accurate, because m2m relationships get implemented as a separate
>>> table, so there is no direct relationship between the two.
>>> InlineModelAdmin works great for one-to-many but not for many-to-many.
>>>
>>> I'd also be interested in solutions to this, not having found anything
>>> in a bunch of Google searches.  The alternative I'm planning on is
>>> having to hand-code some views, forms, and templates that let me do
>>> the right thing -- not a huge amount of work, but having admin do it
>>> for us would be way cool.
>>>
>>> Craig
>>>
>>>
>>> > Greetings
>>> > Sven
>>>
>>> >>>
>>>
>>
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to