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)
my
Hello alain31,
On 12 Aug., 21:41, alain31 wrote:
> [...]
> How can I use a custom QuerySet for the choices of field1 ?
I think it should work like this:
myform = MyForm(..)
myqueryset = myform.base_fields['field1'].queryset
myqueryset = myqueryset.filter_by(somefield='somevalue')
myform.b
2 matches
Mail list logo