On 17-8-2012 0:05, houmie wrote:
> DealType class has a many to many relationship to sales_item. Therefore
> using inline formsets wouldn't be possible. I have tried it and inlines
> need foreign key.
You *can* use the reverse bit of a ManyToManyField with inline formsets.
The information on
+1 on "Roll your own" solution. Complicated M2Ms and Django Forms aren't
always the cleanest pair of features to work with when combined.
On Fri, Aug 17, 2012 at 9:36 AM, houmie wrote:
> Thanks Melvyn,
>
> To be honest I would be willing to purchase a widget if there was one.
Thanks Melvyn,
To be honest I would be willing to purchase a widget if there was one.
iw ill look into the list you have sent me.
On another note, Simone mentioned to extend the Formset in order to run
my own dropdown solution.
I was just looking at the modelformset_factory class and -
On 17-8-2012 15:00, houmie wrote:
> Yes, I know about overriding a widget. I could override a Charfield with
> a TextArea. For simple stuff it makes sense.
> Against which widget do I override the existing M2M widget though?
If the one that Tomas linked doesn't work for you, you'll need to
Thanks Melvyn,
Yes, I know about overriding a widget. I could override a Charfield with
a TextArea. For simple stuff it makes sense.
Against which widget do I override the existing M2M widget though?
On 17/08/12 01:01, Melvyn Sopacua wrote:
On 17-8-2012 1:05, Houman wrote:
What I am
Thanks Thomas.
Just trying to apply the DropDownMultiple Widget that you have
suggested. I have followed the instruction:
|class MyForm(forms.ModelForm):
categories = forms.Field(widget=DropDownMultiple)
def __init__(self, *args, **kwargs):
On 16/ago/2012, at 23:35, Houmie wrote:
> The question might seem too simplistic, but it seems formsets can only work
> with forms that have simple type fields such as charfield.
> But has anyone tried to use a form with a dropdown and use that form to
> instantiate a
DropDownMultiple widget
http://djangosnippets.org/snippets/747/
--
"The whole of Japan is pure invention. There is no such country, there
are no such people" --Oscar Wilde
|_|0|_|
|_|_|0|
|0|0|0|
(\__/)
(='.'=)This is Bunny. Copy and paste bunny
(")_(") to help him gain world domination.
--
On 17-8-2012 1:05, Houman wrote:
> What I am trying to achieve would be deal type having a m2m
> relationship to sales items. I don't like the m2m widget,
So change it. All ModelForm derivatives have a widgets argument that is
a dictionary of fieldname => widget instance:
Hi xavier,
Apologies for the confusion.
What I am trying to achieve would be deal type having a m2m relationship to
sales items. I don't like the m2m widget, so I thought I use formsets with
dropdowns in them. The idea is good, somce the user would choose how many
dropdowns he wants and
Hi Houman
Le 17 août 2012 à 00:05, houmie a écrit :
> DealType class has a many to many relationship to sales_item. Therefore
> using inline formsets wouldn't be possible. I have tried it and inlines need
> foreign key.
DealType has a ForeignKey to Company which is what
Hi Xavier,
This wasn't the whole story.
I actually have a DealType class:
|class DealType(models.Model):
deal_name= models.CharField(max_length=40)
sales_item= models.ManyToManyField(SalesItem)
price= models.DecimalField(decimal_places=2)
|
DealType class has a
Hi,
I'm not sure I understood what you're trying to do.
If you want to display all the SaleItem linked to a company in a formset, then
inlines are what you're looking for.
You'll find the documentation about them there:
The question might seem too simplistic, but it seems formsets can only work
with forms that have simple type fields such as charfield.
But has anyone tried to use a form with a dropdown and use that form to
instantiate a formset?
Let me give you an example why this fails:
*Model:*
class
14 matches
Mail list logo