<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def formfield_for_manytomany(self, db_field, request, **kwargs):
 """ Filter the disposable authors. """

        if db_field.name == 'authors':
            kwargs['queryset'] = Author.objects.filter(
                Q(is_staff=True) | Q(entries__isnull=False)
                ).distinct()

        return super(EntryAdmin, self).formfield_for_manytomany(
            db_field, request, **kwargs)