def get_prep_lookup(self, lookup_name, rhs):
if lookup_name == '<STR_LIT>':<EOL><INDENT>if not isinstance(rhs, Model):<EOL><INDENT>raise FilteredGenericForeignKeyFilteringException(<EOL>"<STR_LIT>")<EOL><DEDENT><DEDENT>elif lookup_name in ['<STR_LIT>', '<STR_LIT>']:<EOL><INDENT>if type(rhs) == QuerySet:<EOL><INDENT>return rhs, None<EOL><DEDENT>if not is_iterable(rhs):<EOL><INDENT>raise FilteredGenericForeignKeyFilteringException(<EOL>"<STR_LIT>")<EOL><DEDENT><DEDENT>else:<EOL><INDENT>raise FilteredGenericForeignKeyFilteringException(<EOL>"<STR_LIT>" % lookup_name)<EOL><DEDENT>return rhs, None<EOL>
Perform preliminary non-db specific lookup checks and conversions