Changeset bf87cda
- Timestamp:
- 03/21/12 14:44:33 (14 months ago)
- Branches:
- master, crem, crem2, dev, diadems, generic, instru_search, lam, nlivemulti, release/1.4.4, security, social, storage, test
- Children:
- 30741ae
- Parents:
- 86f7310 (diff), fabced9 (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/21/12 14:44:33)
- git-committer:
- yomguy <yomguy@…> (03/21/12 14:44:33)
- Files:
-
- 15 added
- 10 edited
-
setup.py (modified) (1 diff)
-
telemeta/admin.py (modified) (1 diff)
-
telemeta/htdocs/js/playlist.js (modified) (7 diffs)
-
telemeta/models/media.py (modified) (1 diff)
-
telemeta/templates/postman/archives.html (added)
-
telemeta/templates/postman/base.html (added)
-
telemeta/templates/postman/base_folder.html (added)
-
telemeta/templates/postman/base_write.html (added)
-
telemeta/templates/postman/email_user.txt (added)
-
telemeta/templates/postman/email_user_subject.txt (added)
-
telemeta/templates/postman/email_visitor.txt (added)
-
telemeta/templates/postman/email_visitor_subject.txt (added)
-
telemeta/templates/postman/inbox.html (added)
-
telemeta/templates/postman/inc_subject_ex.html (added)
-
telemeta/templates/postman/reply.html (added)
-
telemeta/templates/postman/sent.html (added)
-
telemeta/templates/postman/trash.html (added)
-
telemeta/templates/postman/view.html (added)
-
telemeta/templates/postman/write.html (added)
-
telemeta/templates/telemeta/base.html (modified) (5 diffs)
-
telemeta/templatetags/telemeta_utils.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
-
setup.py
r49a9b01 ra62ff5a 20 20 'timeside', 21 21 'south', 22 'django-pagination', 23 'django-postman', 24 'django-socialregistration', 22 25 ], 23 26 platforms=['OS Independent'], -
telemeta/admin.py
r7ed402e rfabced9 6 6 from telemeta.models.system import * 7 7 from django.contrib import admin 8 from django.forms import CheckboxSelectMultiple9 8 10 9 class MediaFondsAdmin(admin.ModelAdmin): 11 10 search_fields = ['title', 'code'] 12 11 ordering = ['code'] 12 filter_horizontal = ['children'] 13 13 14 14 class MediaCorpusAdmin(admin.ModelAdmin): 15 15 search_fields = ['title', 'code'] 16 16 ordering = ['code'] 17 formfield_overrides = { 18 models.ManyToManyField: {'widget': CheckboxSelectMultiple} 19 } 20 17 filter_horizontal = ['children'] 18 21 19 class MediaCollectionAdmin(admin.ModelAdmin): 22 20 search_fields = ['title', 'code'] -
telemeta/htdocs/js/playlist.js
r461ebfc r2329add 93 93 return new String(d.getTime() + '' + Math.floor(Math.random() * 1000000)).substr(0, 18); 94 94 }, 95 95 96 add : function(dictionary){ 96 97 97 98 if(dictionary.public_id===undefined){ 98 dictionary.public_id = this.uniqid(); //defined in application.js99 dictionary.public_id = this.uniqid(); 99 100 } 100 101 if(dictionary.user===undefined){ … … 106 107 }); 107 108 }, 108 109 109 110 remove: function(id){ 110 111 json([id],'telemeta.del_playlist',function(){ … … 131 132 var dd = {}; 132 133 var playlist = this; 133 134 134 135 var playlists = this.playlists; 135 136 for (var i=0; i< playlists.length; i++){ … … 139 140 } 140 141 } 141 142 142 143 new PopupDiv({ 143 144 'content':dd, … … 157 158 }).show(); 158 159 }, 159 160 160 161 /*shows the popup for adding a resource to a playlist*/ 161 162 showAddResourceToPlaylist: function(anchorElement, resourceType, objectId, optionalOkMessage){ … … 166 167 } 167 168 var pl = this; 168 169 169 170 if(!ar.length){ 170 171 pl.showAdd(anchorElement); 171 172 } 172 173 173 174 //var addFcn = this.addResourceToPlaylist; 174 175 new PopupDiv({ … … 178 179 var val = data.selIndex; 179 180 var callbackok = undefined; 180 181 181 182 if(optionalOkMessage){ 182 183 callbackok = function(){ -
telemeta/models/media.py
rc9f9871 rbf87cda 88 88 89 89 class MediaBaseResource(MediaResource): 90 "Describe a base resource"90 "Describe a media base resource" 91 91 92 92 title = CharField(_('title'), required=True) -
telemeta/templates/telemeta/base.html
rcc86e27 rfabced9 20 20 <![endif]--> 21 21 {% endblock %} 22 23 {% block extra_stylesheets %}{% endblock %} 22 24 23 25 {% block javascript %} … … 92 94 <li><a href="{% url telemeta-home %}" class="blue">{% trans "Home" %}</a></li> 93 95 {% endif %} 96 97 {% block archives %} 94 98 <li><a href="#archives#" class="green">{% trans "Archives" %}</a> 95 99 <ul> … … 101 105 <div class="clear"></div> 102 106 </li> 107 {% endblock archives %} 108 109 {% block geonav %} 103 110 <li><a href="{% url telemeta-geo-continents %}" class="yellow">{% trans "Geo Navigator" %}</a></li> 111 {% endblock geonav %} 112 104 113 <li><a href="{% url telemeta-search-criteria %}" class="orange">{% trans "Advanced search" %}</a></li> 105 114 {% if user.is_authenticated %} … … 124 133 {% endblock header %} 125 134 135 {% block postman_menu %} 136 {% endblock postman_menu %} 137 126 138 <div id="content"> 127 139 <table id="content_header"><tr> … … 133 145 {% block delete %}{% endblock %} 134 146 </div> 147 148 {% block body %} 149 {% endblock body %} 135 150 136 151 {% block footer %} -
telemeta/templatetags/telemeta_utils.py
r396801e r0073410 398 398 return 'Audio' 399 399 400 @register.filter 401 def installed(app): 402 return app in settings.INSTALLED_APPS -
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.
