Skip to content

Instantly share code, notes, and snippets.

@fruver
fruver / admin.py
Last active August 29, 2015 14:21 — forked from dokterbob/admin.py
class LimitedAdminInlineMixin(object):
"""
InlineAdmin mixin limiting the selection of related items according to
criteria which can depend on the current parent object being edited.
A typical use case would be selecting a subset of related items from
other inlines, ie. images, to have some relation to other inlines.
Use as follows::