Thanks, I guess this is exactly what I need, I'look at that =) PS: The Company form was just an example, I've some cases of this at my code.
On Tue, May 3, 2011 at 2:25 PM, Bryan <bryan.h...@gmail.com> wrote: > "Maybe what I need is something like OneToMany relationship" > You need a ManyToMany field: multiple people may have worked for the > same company previously, correct? > > As for your original question, I would make a ModelForm for your > Person model (or whatever it is) and another one for your Company > model and then use a formset to allow them to enter the companies > they've worked for. This should get part of the way there: > > http://docs.djangoproject.com/en/1.3/topics/forms/formsets/#using-more-than-one-formset-in-a-view > > Hope that helps. > > On May 2, 6:37 pm, Daniel França <daniel.fra...@gmail.com> wrote: > > anyone? > > Maybe what I need is something like OneToMany relationship, i guess, but > > there's no such thing in django > > > > 2011/5/2 Daniel França <daniel.fra...@gmail.com>> Hi all, > > > I'm trying to create a form from a model with ManyToManyField, > > > I want something like this: You fill some fields from the referenced > table > > > and you click at 'Add' and this appears at a table below the fields, so > when > > > I click > > > "Save" all the added items save (includind the new manytomany items) > > > > > Example: > > > > > *Name [ ]* > > > *Email [ ]* > > > > > *Add Companys you've Worked for:* > > > *Company [ ] Telephone [ > > > ] (ADD Button)* > > > * > > > > --------------------------------------------------------------------------- > ------------------------------------------------------------- > > > * > > > *Company Telephone* > > > *Company XYZ 555 0123* > > > *Company ABC 123 4567* > > > * > > > * > > > *(Save Form Button)* > > > * > > > * > > > > > I hope you can understand this... there's some easy way to implement > this > > > using Django? > > > > > Best Regards, > > > Daniel França > > -- > 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. > > -- 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.