class YPAutocompleteLookup(AutocompleteLookup):
    """ patch grappelli's autocomplete to let us control the queryset 
    by creating a autocomplete_queryset function on the model """

def get_queryset(self):
    if hasattr(self.model, 'autocomplete_queryset'):
        pass
How to filter autocompletion results in django grappelli?