

def _generate(self):
    if self.instance.rel.limit_choices_to:
        queryset = self.instance.rel.to.objects.filter(**self.instance.rel.limit_choices_to)
    else:
        queryset = self.instance.rel.to.objects.all()
    return self.sd.db_object_from_queryset(queryset)

dataset/ETHPy150Open kaleidos/django-sampledatahelper/sampledatahelper/handlers.py ForeignKeyHandler._generate/original