List Info

Thread: Using Two Combo Boxes and moving items between them




Using Two Combo Boxes and moving items between them
user name
2006-03-31 21:38:39
Hi,

I'm currently a senior university student using Django for
a web
project. So far, I'm really enjoying using it, and plan on
utilizing it
for a few of my side projects, thanks for all the great
work. 

Right now, I have a question on if something is possible,
and if so,
ideas on how to do it.

I want to create a form that has a section with two combo
boxes, the
first combo box is a list of items. The user can then use
buttons to
move an item from one combobox to the other. The items in
the second
combobox I want to read in and set in the database/object.
Any thoughts
on this?

Thank you,

Chris


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at http://gr
oups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Using Two Combo Boxes and moving items between them
user name
2006-03-31 21:49:56
On 3/31/06, indirecthitgmail.com <indirecthitgmail.com> wrote:
> I want to create a form that has a section with two
combo boxes, the
> first combo box is a list of items. The user can then
use buttons to
> move an item from one combobox to the other. The items
in the second
> combobox I want to read in and set in the
database/object. Any thoughts
> on this?

Unless I'm completely misunderstanding you, look at how the
admin
application handles many-to-many relationships with the
"filter_interface" property. It's generated by
these JavaScript files:

http://code.djangoproject.com/browser/django/branches/magi
c-removal/django/contrib/admin/media/js/SelectFilter2.js
(the actual code that generates it)

ht
tp://code.djangoproject.com/browser/django/branches/magic-re
moval/django/contrib/admin/media/js/SelectBox.js
(support functions)
http://
code.djangoproject.com/browser/django/branches/magic-removal
/django/contrib/admin/media/js/core.js
(support functions)

--
"May the forces of evil become confused on the way to
your house."
  -- George Carlin

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at http://gr
oups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Using Two Combo Boxes and moving items between them
user name
2006-03-31 21:48:21
On 3/31/06, indirecthitgmail.com <indirecthitgmail.com> wrote:
>
> I want to create a form that has a section with two
combo boxes, the
> first combo box is a list of items. The user can then
use buttons to
> move an item from one combobox to the other. The items
in the second
> combobox I want to read in and set in the
database/object. Any thoughts
> on this?

Check out ManyToManyField's
filter_interface=meta.HORIZONTAL option.
It's in the model docs.

http://www.djangoproject.com/doc
umentation/model_api/#many-to-many-relationships

Joseph

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at http://gr
oups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )