key-...
> in-a-django-modelform
>
> Altough having this stored in the model would be more elegant in your case,
> perhaps anyone else has knows more..
>
> Michael
>
>
>
>
>
>
>
> -Original Message-
> From: django-users@googlegroups.com on
I've been playing around with a reusable/declarative syntax for doing this,
as I seem to do it all of the time.
https://bitbucket.org/schinckel/django-filtered-form
You inherit from FilteredForm, and set either simple 'filters' or
'instance_filters' attributes on the form class:
class MyMo
ngo-modelform
Altough having this stored in the model would be more elegant in your case,
perhaps anyone else has knows more..
Michael
-Original Message-
From: django-users@googlegroups.com on behalf of Kevin
Sent: Wed 1/4/2012 8:07 AM
To: Django users
Subject: Limiting choices for ModelForm
Hello,
I have many models which have a foreign key to a main model. Eg:
class MainModel:
..
..
class VariousModels:
main = ForeignKey(MainModel)
..
..
Now, these VariousModels sometimes have links to each other in the
form of ForeignKey or ManyToMany. I need to limit these ForeignK
4 matches
Mail list logo