Re: Extending the ManyToMany relation, maybe a bad idea

2011-07-28 Thread Joshua Russo
Ya, sorry, I was just getting frustrated because I was taking longer than I wanted to implement this. The formset is what I ended up with. The tricky part is still that I want a defined list of options in the formset, so I can't just make it a model formset. I haven't worked in Django in a while

Re: Extending the ManyToMany relation, maybe a bad idea

2011-07-28 Thread Tom Evans
On Thu, Jul 28, 2011 at 3:37 AM, Joshua Russo wrote: > I keep thinking I'm doing something wrong here. From the lack of responses I > feel like there is no real good way to handle a group of options with > additional relational data. Or alternatively, no-one understood what you were trying to do

Re: Extending the ManyToMany relation, maybe a bad idea

2011-07-27 Thread Joshua Russo
Ok, so I can retrieve this extra data in the __init__ of the model form, but it seems like I will need to skip all of the cleaning and automatic validation of the form; because the data, to be displayed with the associated checkbox will have to be included with the items field in the Organizati

Re: Extending the ManyToMany relation, maybe a bad idea

2011-07-27 Thread Joshua Russo
My problem is that I have multiple values and I need to associate the list of extra fields with selected relations for the ManyToMany relation. Below is a simplified version of what my setup is. I want to create an edit form for Organization, but I'm struggling with how best to save (and re-re

Re: Extending the ManyToMany relation, maybe a bad idea

2011-07-27 Thread Shawn Milochik
You can override the ModelForm. Add the fields to the ModelForm. Set the initial values by overriding __init__, and save them by overriding the save() method. Should be pretty simple. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to

Re: Extending the ManyToMany relation, maybe a bad idea

2011-07-27 Thread Joshua Russo
Someone tell me where I'm going wrong conceptually here, I feel like I'm making this too hard. -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/T5m8OIVMyusJ

Re: Extending the ManyToMany relation, maybe a bad idea

2011-07-27 Thread Joshua Russo
I am using the through keyword. I'm just trying to figure out the most efficient way to create a form field and widget to update the data. What I'm struggling with is how a ManyToMany field with an intermediate table containing extra fields fits into the ModelForm saving. I'm just not sure wher

Re: Extending the ManyToMany relation, maybe a bad idea

2011-07-25 Thread Shawn Milochik
Have you looked into creating your own connector table for your ManyToMany using the 'through' keyword? https://docs.djangoproject.com/en/1.3/topics/db/models/#many-to-many-relationships -- You received this message because you are subscribed to the Google Groups "Django users" group. To post

Extending the ManyToMany relation, maybe a bad idea

2011-07-24 Thread Joshua Russo
Ok, so I've created a structure of selectable properties, that for the most part is a straight forward many-to-many relationship. What I've added is a character field in the relationship table that should conditionally display based on the setup of the property being selected. What I wanted to