Skip to content

Commit

Permalink
Actual helpful comments
Browse files Browse the repository at this point in the history
  • Loading branch information
davmlaw committed Aug 28, 2024
1 parent fd6e856 commit d83a00b
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions genes/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,16 @@ def __str__(self):

class GeneSymbol(models.Model, PreviewModelMixin):
"""
If you need to perform a 'like' query on this field, you need to:
If you want to do a like on symbol and get an error:
GeneSymbol.objects.filter(symbol__startswith='GATA')
django.db.utils.NotSupportedError: nondeterministic collations are not supported for operator class "text_pattern_ops"
Instead you need to do:
GeneSymbol.get_deterministic_queryset().filter(symbol_deterministic__startswith='GATA')
"""
symbol = TextField(primary_key=True, db_collation='case_insensitive')
symbol = TextField(primary_key=True, db_collation='case_insensitive') # See note above if 'like' breaks

objects = ObjectManagerCachingRequest()

Expand Down

0 comments on commit d83a00b

Please sign in to comment.