コード例 #1
0
ファイル: views.py プロジェクト: exploratour/exploratour
 def locked_collection_ids():
     lockto = get_lockto_collid()
     if lockto is None:
         return [c.title for c in Collection.objects]
     lockcoll = Collection.objects.get(lockto)
     result = [c.title for c in lockcoll.descendent_objs]
     result.append(lockcoll.title)
     return result
コード例 #2
0
ファイル: fields.py プロジェクト: exploratour/exploratour
    def search_url(self, url_fn):
        """Get the URL for a search for this field value, within the collection
        currently being viewed, if any.

        """
        p = self.search_params()
        if p is None:
            return None
        coll_id = get_lockto_collid()
        if coll_id is not None:
            p['collid'] = coll_id
        p['act'] = 'search'
        return url_fn('search', **p)