See:
http://django-autocomplete-light.readthedocs.io/en/master/tutorial.html#filtering-results-based-on-the-value-of-other-fields-in-the-form
On Friday, 20 October 2017 13:04:41 UTC+2, rajeev yadla wrote:
>
> hi have a form which have two fields. one field has a foreignkey from
> model A(in ima
On Jul 31, 7:37 pm, Malcolm Tredinnick
wrote:
> On Fri, 2009-07-31 at 16:31 -0700,mviamariwrote:
> > Hello,
>
> > I'm trying to make a form for data entry into my database that uses
> > ChoiceFields for foreign keys. Obviously, the ideal choice would be
> > ModelChoiceField, however I'm not usin
On Fri, 2009-07-31 at 16:31 -0700, mviamari wrote:
> Hello,
>
> I'm trying to make a form for data entry into my database that uses
> ChoiceFields for foreign keys. Obviously, the ideal choice would be
> ModelChoiceField, however I'm not using the django ORM, so I've
> assumed that's not going t
On Wed, 2008-11-19 at 09:42 -0800, Delta20 wrote:
> A model field may have a 'choices' option to which you assign an
> iterable object -- typically a list, but this can also be an iterable
> function. Is there a way to assign a class method/function rather than
> a module function?
No. Python di
Daniel Roseman wrote:
> On Jun 29, 2:24 pm, John Aherne <[EMAIL PROTECTED]> wrote:
>
>> OK. I did some more experimenting with ModelChoiceField and my table.
>>
>> Surprise. It worked when I thought it would not. Why did it work. By
>> luck in my model I had the __unicode__ function return the
On Jun 29, 2:24 pm, John Aherne <[EMAIL PROTECTED]> wrote:
> OK. I did some more experimenting with ModelChoiceField and my table.
>
> Surprise. It worked when I thought it would not. Why did it work. By
> luck in my model I had the __unicode__ function return the right value.
> So now I could see
John Aherne wrote:
> Daniel Roseman wrote:
>
>> On Jun 29, 11:34 am, John Aherne <[EMAIL PROTECTED]> wrote:
>>
>>
>>> I've been looking at django for a while. Been through the tutorial a few
>>> times and read 2 books several times and am still trying to find out how
>>> some things wor
Daniel Roseman wrote:
> On Jun 29, 11:34 am, John Aherne <[EMAIL PROTECTED]> wrote:
>
>> I've been looking at django for a while. Been through the tutorial a few
>> times and read 2 books several times and am still trying to find out how
>> some things work.
>>
>> Instead of an empty form on fi
On Jun 29, 11:34 am, John Aherne <[EMAIL PROTECTED]> wrote:
> I've been looking at django for a while. Been through the tutorial a few
> times and read 2 books several times and am still trying to find out how
> some things work.
>
> Instead of an empty form on first loading, I would like to be ab
2008/1/13 Alex Koshelev <[EMAIL PROTECTED]>:
> When you explicitly write list in choices it evaluates at module
> import type. To avoid this write function and pass it as 'choices'
> parameter
Or...
deck = forms.ModelChoiceField(queryset=Deck.objects.all())
--
"Bureaucrat Conrad, you are tec
Thanks. My mistake
On 13 янв, 21:39, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
> Alex Koshelev wrote:
> > When you explicitly write list in choices it evaluates at module
> > import type. To avoid this write function and pass it as 'choices'
> > parameter
>
> > def get_choices():
> > [(d.id,d.
Alex Koshelev wrote:
> When you explicitly write list in choices it evaluates at module
> import type. To avoid this write function and pass it as 'choices'
> parameter
>
> def get_choices():
> [(d.id,d.name) for d in Deck.objects.all()]
(adding a return statement might be a good idea /F)
When you explicitly write list in choices it evaluates at module
import type. To avoid this write function and pass it as 'choices'
parameter
def get_choices():
[(d.id,d.name) for d in Deck.objects.all()]
#...
deck = forms.ChoiceField(required=True,choices = get_choices )
When this function
Thanks Amit and Adrian,I think I'll do something like what Amit said or write a custom manipulator.- ChetanOn 2/8/06, Adrian Holovaty <
[EMAIL PROTECTED]> wrote:On 2/8/06, Amit Upadhyay <
[EMAIL PROTECTED]> wrote:> > What I notice is that whenever an entry is added to LDAP, it is not> reflected in
On 2/8/06, Amit Upadhyay <[EMAIL PROTECTED]> wrote:
> > What I notice is that whenever an entry is added to LDAP, it is not
> reflected in the SelectField drop-down on the create form for the model. But
> if I simply restart the Apache httpd server, the drop-down is correctly
> populated.
> >
> >
On 2/8/06, Chetan Vaity <[EMAIL PROTECTED]> wrote:
class MyModel(meta.Model):
id = meta.AutoField(primary_key = True)
name = meta.CharField(maxlength=20, unique=True)
location = meta.CharField(maxlength=100, choices=getLocationChoices())
What I notice is that whenever an entry is added
stava wrote:
> I'm having a bit of a problem with dynamic choices. I'm working on a
> simple timesheet system where I've extended the auth.users with a
> couple of fields including something I call "primary group":
>
> def getUsers(group = None):
> users = []
> if group is None:
> for u i
17 matches
Mail list logo