Chained combobox problem

21 views
Skip to first unread message

Mladen Uzelac

unread,
Oct 3, 2014, 12:20:46 PM10/3/14
to django-s...@googlegroups.com
hi,

I have a form with three comboxes that are chained. 
Models are chained via intermediary table.

model goes like this

class A(models.Model):
    id
    name

class B(models.Model):
    id
    name

class B(models.Model):
    id
    name

class Choice(models.Model):
   a = models.ForeignKey(A)
   b = models.ForeignKey(B)
   c = models.ForeignKey(C)


Choice is some combination of A,B,C that are related in some way.
This structure is required by the "Business model" .

I would like to:

1. choose value from A, filter B, 
2. choose value from B, filter C
3. choose C

And then take those values to further processing.

I did lookups for choosing those values in the form, but I don't know how to gradual filtering.

Kind regards, Mladen.

Mark Lavin

unread,
Oct 4, 2014, 11:48:54 AM10/4/14
to django-s...@googlegroups.com
There is an example of doing this in the docs: http://django-selectable.readthedocs.org/en/v0.8.X/advanced.html#chained-selection What have you tried that isn't working?

--
You received this message because you are subscribed to the Google Groups "django-selectable" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-selecta...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mladen Uzelac

unread,
Oct 8, 2014, 10:18:33 AM10/8/14
to django-s...@googlegroups.com
I have succeeded what I wanted to. :D

A little playing with filters came handy.
Since I am novice in Django, at first I could not do what I wanted.
Reply all
Reply to author
Forward
0 new messages