Hi,

I've returned to the problem and noticed, that recipe described in the
docs is a kind of wrong: intermediary model is just a kind of M2M (I
mean multiselection) since you have select widgets for inline model
and to make real m2m editing have to add more inlines.

Custom model can help, but this hack is ugly too:

==========================================================================================================
class Groups(ModelForm):
    users = forms.ModelMultipleChoiceField(queryset=Users.objects.all
(),required=False)
 
widget=admin.widgets.FilteredSelectMultiple(_("Users"), False))
    class Meta:
        model = Groups
==========================================================================================================

Now you have to add custom saving! It's wrong IMHO.
I think it would be much better to specify both M2M fields with the
same table name.

On Jan 16, 7:26 pm, "Evgeniy Ivanov (powerfox)"
<lolkaanti...@gmail.com> wrote:
> On Jan 16, 12:47 pm, Malcolm Tredinnick <malc...@pointy-stick.com>
> wrote:
>
>
>
> > On Fri, 2009-01-16 at 01:33 -0800, Evgeniy Ivanov (powerfox) wrote:
>
> > > On Jan 16, 5:16 am, Malcolm Tredinnick <malc...@pointy-stick.com>
> > > wrote:
>
> > [...]
>
> > > > You need to go back and look at your original problem. You wantedforms
> > > > with multiselect fields forbothforms. So the real question is "how do
> > > > you do that". I suspect the answer is that you have to manually
> > > > construct one of theforms(which you can write a helper function to do
> > > > if you need this in a lot of projects, or, if this only happens for one
> > > > model, just write a single form class).
>
> > > Thanks, will try. Current sollution (create table manually and specify
> > > name/columns) is neither right or cute.
>
> > I think part of the conceptual problem here is that you're trying to
> > solve your problem by working on the model definition. But the problem
> > is a form issue. It's about presentation, not data storage. So approach
> > it from that end.
>
> Malcolm, thanks for your help.
> Today I was reading docs for some another things (filtering, etc) and
> found clear explanation of the thing we 
> discuss:http://docs.djangoproject.com/en/dev/ref/contrib/admin/#working-with-...
--~--~---------~--~----~------------~-------~--~----~
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