Hi Mike,

On Feb 3, 4:36 pm, Mike Lindsey <mike-dja...@5dninja.net> wrote:
> I'm doing something with bidirectional ManyToManyFields, in a project
> I'm working on, that is resulting in duplicate attempts to create the
> intermediate tables.  I'm perfectly open to suggestions of "You're
> doing it wrong" if they come with advice on how to fix my problem,
> without losing the easy Admin insertion of the relationships (without
> resorting to InLines, which don't seem to play nicely at all with
> FieldSets).  Right now I'm getting around the problem by running
> syncdb, running dbshell to drop the table it complains about, and
> rerunning syncdb; repeating until syncdb finishes successfully.
>
> What would make this exceptionally easy, is if there was the option to
> set 'abstract=True' on second iteration of each of the
> ManyToManyFields, telling syncdb to not attempt to create it.

So what you're trying to do here is simply not supported. I'm guessing
you've already concluded as much. This means that, for now, there is
no good answer for you (that I'm aware of). Whatever hack or
workaround you are able to come up with is what you're gonna get.
Sorry.

That said, I think it's a reasonable feature request. But I don't
think defining the ManyToManyField on both models, with some kind of
"abstract" flag on one side, is the right feature request. There's no
reason it should have to be redundantly defined on both models.
Rather, I think it would be ideal if the admin supported including a
reverse m2m descriptor in its "fields" or "fieldsets" list, and then
could provide an m2m widget for it.

If you file a Trac issue with this feature request, I can't commit to
writing the patch to make it happen, but if you or someone else puts
together a reasonable patch for it (barring another core dev putting
forward a sensible objection to it that I'm not seeing), I'd be happy
to review and commit it (we're talking about post-1.3 at this point,
of course).

Carl

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

Reply via email to