from django.db.models import Q
qstring = '%s|%s' % (probe_id, genotype)
subjects = Subject.objects.filter(Q(probe_results__pg_c_genotypes__contains
    =',%s,' % qstring) | Q(probe_results__pg_c_genotypes__startswith='%s,' %
    qstring) | Q(probe_results__pg_c_genotypes__endswith=',%s' % qstring))
Using Django with MySQL for storing and looking up Large DNA Microarray Results