Ignore:
Timestamp:
Feb 22, 2012 3:04:42 PM (3 years ago)
Author:
yomguy <yomguy@…>
Branches:
master, crem, crem2, dev, dev2, diadems, dj1.6, feature/breadcrumbs, feature/ts-0.5, feature/ts-0.5.4, feature/writecache, generic, instru_search, lam, lam2, mapsv3, merge, nlivemulti, release/1.4.4, sabiod, security, server, social, storage, telecaster, test
Children:
3c13a83
Parents:
b3287a8
git-author:
yomguy <yomguy@…> (22/02/2012 15:04:42)
git-committer:
yomguy <yomguy@…> (22/02/2012 15:04:42)
Message:

try instrument filter

File:
1 edited

Legend:

Unmodified
Added
Removed
  • telemeta/models/media.py

    rea5ec32 rc9f9871  
    408408            title += ' ' + self.track 
    409409        return title 
     410 
     411    @property 
     412    def instruments(self): 
     413        "Return the instruments of the item" 
     414        instruments = [] 
     415        performances = MediaItemPerformance.objects.filter(media_item=self) 
     416        for performance in performances: 
     417            instrument = performance.instrument 
     418            alias = performance.alias 
     419            if not instrument in instruments: 
     420                instruments.append(instrument) 
     421            if not alias in instruments: 
     422                instruments.append(alias) 
     423 
     424        instruments.sort(self.__name_cmp) 
     425        return instruments 
     426 
     427        instruments.verbose_name = _("instruments") 
    410428 
    411429 
Note: See TracChangeset for help on using the changeset viewer.