This demonstrates creating a mixin for inlines along with a custom ModelAdmin to inject the instance into the inline for further processing.
One use case is for when you need to override get_field_queryset to filter available options in a dropdown field to limit selection to only those items associated with the parent.
class InstanceAwareInlineMixin(object):
"""
Create a mixin that supports setting an instance.
"""
def __init__(self, *args, **kwargs):