Changeset bb5e0f5


Ignore:
Timestamp:
May 22, 2007 4:25:40 PM (8 years ago)
Author:
olivier <>
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:
ccf0587
Parents:
b0c4a7a
git-author:
olivier <> (22/05/2007 16:25:40)
git-committer:
olivier <> (22/05/2007 16:25:40)
Message:

add method to retrieve items that do not belong to any collection

File:
1 edited

Legend:

Unmodified
Added
Removed
  • telemeta/models.py

    r1950442 rbb5e0f5  
    1717from telemeta.core import * 
    1818from telemeta import dublincore as dc 
    19 from xml.dom import getDOMImplementation 
     19from xml.dom.minidom import getDOMImplementation 
    2020 
    2121# Regular (sub) expression for matching/validating media objects IDs 
     
    206206        ) 
    207207 
     208    def without_collection(self):         
     209        "Find items which do not belong to any collection" 
     210        qs = super(MediaItemManager, self).get_query_set() 
     211        return qs.extra( 
     212            where = ["collection_id NOT IN (SELECT id FROM telemeta_collection)"]); 
     213 
    208214class MediaItem(models.Model, MediaCore): 
    209215    "Describe a item with metadata"  
Note: See TracChangeset for help on using the changeset viewer.