views:

22

answers:

1

I'm working on a video management application where each video clip is associated with a single program-name and a single category-name, but programs and categories can be associated with multiple different videos. (This part is straight forward.)

What's different is that the choices for category-names vary on a per program basis.

For example if a program were "Science Fiction" the allowable categories could be "monster", "outer space", and "future". And if a program were "Romance" the allowable categories could be "romantic comedy", "victorian", "forbidden love".

What I'd like to do is create a model definition for the video clips, (categories?) and programs, but especially the video clips, that restricts the choices for category-name to only those that are appropriate for that program. For example, I'd be unable to choose as a category "victorian" for a clip that's labeled with the "science fiction" program.

The documentation (I've found) on Limit Choices To isn't deep enough to show me how to use it for this case. Any help will be appreciated.

+1  A: 

You should try django-smart-selects.

If it doesn't work - then just create your own field/widget based the one from there.

Vladimir Sidorenko
This looks pretty good. I'll label it at THE answer after I've had a chance to check it out. THANKS!!!
jamida