I am also looking for an answer to this. I've been looking at creating a separate widget for this but it would be nicer to do it in the ModelAdmin
/f On 21 Juli, 15:18, kaosbunny <kaosbu...@gmail.com> wrote: > Hello! > > I'm fairly new to Python and Django and have mostly focused on theadminsystem > so far, but I am a programmer with fairly deep html/css/ > javascript knowledge. > > I was wondering if it's possible to filter the list generated inadmin > forms for aManyToManyfield in a model. > > Ideally I would like a ForeignKey field (also a property of the model) > affect what choices are visible. > For example: If I in the ForeignKey-dropdown select an office name, > theManyToManyfield would get populated with only the branches from > that specific office instead of all branches in the database. > > Is this best done via template changes (adding javascript)? Or through > creating my own Widget? Or is it even possible to do it natively in > the model oradmindefinitions? > > /KB --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---