Hi,
sorry for the first duplicate and incomplete posts (eepc keyboard ...)
My problem actually was to pass an dynamic argument to define queryset
'somevalue' (because ModelForm uses class atributes...).
I solved it writing a function:

def getModel(somevalue)
   class MyForm(ModelForm)
         myqueryset = ... using somevalue ...
         field1 = forms.ModelMultipleChoiceField(queryset=myqueryset)
         class Meta:
         model = ...
  return MyForm()

Thanks

>
> myform = MyForm(......)
> myqueryset = myform.base_fields['field1'].queryset
> myqueryset = myqueryset.filter_by(somefield='somevalue')
> myform.base_fields['field1'].queryset = myqueryset
>
> Regards,
> -Stephan
--~--~---------~--~----~------------~-------~--~----~
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