Changeset 86f7310
- Timestamp:
- 03/05/12 13:17:31 (16 months ago)
- Branches:
- master, crem, crem2, dev, dev2, diadems, generic, instru_search, lam, nlivemulti, release/1.4.4, security, social, storage, test
- Children:
- bf87cda
- Parents:
- 3c13a83 (diff), dd763818 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - git-author:
- yomguy <yomguy@…> (03/05/12 13:17:31)
- git-committer:
- yomguy <yomguy@…> (03/05/12 13:17:31)
- Files:
-
- 6 edited
-
README.rst (modified) (2 diffs)
-
telemeta/models/media.py (modified) (1 diff)
-
telemeta/models/query.py (modified) (5 diffs)
-
telemeta/templates/telemeta/search_criteria.html (modified) (1 diff)
-
telemeta/templates/telemeta/search_results.html (modified) (1 diff)
-
telemeta/views/base.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
README.rst
r90b13fd rdd763818 4 4 5 5 For personal or collaborative media archiving projects, 6 research laboratories and digital humanities ,6 research laboratories and digital humanities. 7 7 8 based on Django, Python, full DHTML, CSS and JavaScript.8 Based on Django, Python, full DHTML, CSS and JavaScript. 9 9 10 10 … … 14 14 Telemeta is a free and open source web audio archiving software which introduces useful and secure methods to backup, index, transcode, analyse and publish any digitalized audio file with its metadata. It is dedicated to professionnals who wants to easily organize, backup and publish documented sound collections of audio files, CDs, digitalized vinyls and magnetic tapes over a strong database, in accordance with open web standards. 15 15 16 Here are the main features of Telemeta:16 Main features: 17 17 18 18 * Secure archiving, editing and publishing of audio files over internet. -
telemeta/models/media.py
rea5ec32 rc9f9871 408 408 title += ' ' + self.track 409 409 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") 410 428 411 429 -
telemeta/models/query.py
r2f57f0e rc9f9871 201 201 return self.filter(file__contains='/') 202 202 203 def by_instrument(self, instrument): 204 "Find items by instrument" 205 return self.filter(instruments__in=instrument) 206 203 207 204 208 class MediaItemManager(CoreManager): … … 244 248 return self.get_query_set().sound(*args, **kwargs) 245 249 sound.__doc__ = MediaItemQuerySet.sound.__doc__ 250 251 def by_instrument(self, *args, **kwargs): 252 return self.get_query_set().by_instrument(*args, **kwargs) 253 by_instrument.__doc__ = MediaItemQuerySet.by_instrument.__doc__ 246 254 247 255 … … 332 340 return self.filter(items__file__contains='/').distinct() 333 341 342 def by_instrument(self, instrument): 343 "Find collections by instrument" 344 return self.filter(items__instruments__in=instrument).distinct() 345 334 346 335 347 class MediaCollectionManager(CoreManager): … … 375 387 return self.get_query_set().sound(*args, **kwargs) 376 388 sound.__doc__ = MediaCollectionQuerySet.sound.__doc__ 389 390 def by_instrument(self, *args, **kwargs): 391 return self.get_query_set().by_instrument(*args, **kwargs) 392 by_instrument.__doc__ = MediaCollectionQuerySet.by_instrument.__doc__ 377 393 378 394 … … 478 494 return self.get_query_set().quick_search(*args, **kwargs) 479 495 quick_search.__doc__ = MediaFondsQuerySet.quick_search.__doc__ 496 497 498 class InstrumentQuerySet(CoreQuerySet): 499 "Base class for all media instrument query sets" 500 501 def quick_search(self, pattern): 502 "Perform a quick search on text and char fields" 503 from telemeta.models.instrument import Instrument 504 mod = Instrument() 505 pattern = pattern.strip() 506 q = Q(code__contains=pattern) 507 fields = mod.to_dict() 508 keys = fields.keys() 509 for field in keys: 510 field_str = str(mod._meta.get_field(field)) 511 if 'CharField' in field_str or 'TextField' in field_str: 512 q = q | word_search_q(field, pattern) 513 return self.filter(q) 514 515 516 class InstrumentManager(CoreManager): 517 "Manage instrument queries" 518 519 def get_query_set(self): 520 "Return instrument query sets" 521 return InstrumentQuerySet(self.model) 522 523 def quick_search(self, *args, **kwargs): 524 return self.get_query_set().quick_search(*args, **kwargs) 525 quick_search.__doc__ = InstrumentQuerySet.quick_search.__doc__ -
telemeta/templates/telemeta/search_criteria.html
r566f17d rc9f9871 63 63 <label for="location">{% field_label "Location" %}</label> 64 64 <input type="text" name="location" id="location" value="{{ criteria.location }}" /> 65 </p> 66 67 <p> 68 <label for="instrument">{% field_label "Instrument" %}</label> 69 <input type="text" name="instrument" id="instrument" /> 65 70 </p> 66 71 -
telemeta/templates/telemeta/search_results.html
r7baa3c8 rc9f9871 28 28 {% if criteria.location %} 29 29 <li><b>{% field_label "Location" %}:</b> {{criteria.location}}</li> 30 {% endif %} 31 {% if criteria.instrument %} 32 <li><b>{% field_label "Instrument" %}:</b> {{criteria.instrument}}</li> 30 33 {% endif %} 31 34 {% if criteria.ethnic_group %} -
telemeta/views/base.py
r0d2f73e r3c13a83 339 339 collections.sound(), 340 340 items.sound()), 341 'instrument': lambda value: ( 342 collections.by_instrument(value), 343 items.by_instrument(value)), 341 344 } 342 345
Note: See TracChangeset
for help on using the changeset viewer.
