]> git.parisson.com Git - telemeta.git/commitdiff
case insensitive for instrument queries
authorGuillaume Pellerin <yomguy@parisson.com>
Tue, 16 Apr 2013 11:01:58 +0000 (13:01 +0200)
committerGuillaume Pellerin <yomguy@parisson.com>
Tue, 16 Apr 2013 11:01:58 +0000 (13:01 +0200)
telemeta/models/query.py

index 4372302b2149efc17ba8f37a8aab03b2fe296bae..07fb1f16697cef20befc5af77824be42732b8ca6 100644 (file)
@@ -207,7 +207,7 @@ class MediaItemQuerySet(CoreQuerySet):
         "Find items by instrument"
         from telemeta.models.instrument import Instrument
         from telemeta.models.media import MediaItemPerformance
-        instruments = Instrument.objects.filter(name__contains=name)
+        instruments = Instrument.objects.filter(name__icontains=name)
         perf = []
         if instruments:
             performances = MediaItemPerformance.objects.filter(instrument__in=instruments)
@@ -352,7 +352,7 @@ class MediaCollectionQuerySet(CoreQuerySet):
     def by_instrument(self, name):
         "Find collections by instrument"
         from telemeta.models.instrument import Instrument
-        instruments = Instrument.objects.filter(name__contains=name)
+        instruments = Instrument.objects.filter(name__icontains=name)
         items = []
         for instrument in instruments:
             performances = instrument.performances.all()