'get_formset has to return a class, but we need to make the class that we return
know about the related_field that we\'ll use. Returning the class itself rather than
a proxy isn\'t threadsafe, since it\'d be the base class and would change if multiple
people used the admin at the same time'

def get_formset(self, request, obj=None, **kwargs):

    formset = super(TagInline, self).get_formset(request, obj, **kwargs)
    class ProxyFormset(formset, ):
        pass
    ProxyFormset.related_field = self.related_field
    return ProxyFormset
