Ignore:
Timestamp:
Nov 10, 2011 11:58:58 AM (3 years ago)
Author:
yomguy <yomguy@…>
Branches:
master, crem, crem2, crem3, dev, dev2, diadems, dj1.6, feature/breadcrumbs, feature/ts-0.5, feature/ts-0.5.4, feature/writecache, forma, generic, instru_search, lam, lam2, mapsv3, merge, nlivemulti, prob, production, release/1.4.4, sabiod, search, security, server, social, storage, telecaster, test, video
Children:
d4c2dd3, 482c7bd
Parents:
510ed41
git-author:
yomguy <yomguy@…> (10/11/2011 11:58:58)
git-committer:
yomguy <yomguy@…> (10/11/2011 11:58:58)
Message:

order item lists of collections by code and old_code, add analytics block to base.html

File:
1 edited

Legend:

Unmodified
Added
Removed
  • telemeta/web/base.py

    r053e10f rd082877  
    344344    def collection_detail(self, request, public_id, template='telemeta/collection_detail.html'): 
    345345        collection = MediaCollection.objects.get(public_id=public_id) 
     346        items = collection.items.enriched() 
     347        items = items.order_by('code', 'old_code') 
    346348         
    347349        if collection.public_access == 'none' and not (request.user.is_staff or request.user.is_superuser): 
     
    355357                                                collection.recorded_to_year) 
    356358        playlists = get_playlists(request) 
    357         return render(request, template, {'collection': collection, 'playlists': playlists, 'public_access': public_access}) 
     359         
     360        return render(request, template, {'collection': collection, 'playlists': playlists, 'public_access': public_access, 'items': items}) 
    358361 
    359362    @method_decorator(permission_required('telemeta.change_mediacollection')) 
     
    441444        pks = [] 
    442445        items = MediaItem.objects.filter(collection=item.collection) 
     446        items = items.order_by('code', 'old_code') 
     447         
    443448        if len(items) > 1: 
    444449            for it in items: 
    445450                pks.append(it.pk) 
    446             pks.sort() 
    447451            for pk in pks: 
    448452                if pk == item.pk: 
Note: See TracChangeset for help on using the changeset viewer.