Пример #1
0
 def get_items(self, resource, context, *args):
     args = list(args)
     tags = resource.get_property('tags')
     if tags:
         args.append(OrQuery(*[PhraseQuery('tags', x) for x in tags]))
     formats = resource.get_property('feed_class_id')
     if formats:
         args.append(OrQuery(*[PhraseQuery('format', x) for x in formats]))
     return Details_View.get_items(self, resource, context, *args)
Пример #2
0
 def get_items(self, resource, context, *args):
     # Build the query
     args = list(args)
     tag = resource.name
     get_query_value = context.get_query_value
     formats = get_query_value('format', type=String(multiple=True),
                               default=[])
     query = resource.parent.get_tags_query_terms(state='public',
             tags=[tag], formats=formats)
     args.append(AndQuery(*query))
     return Details_View.get_items(self, resource, context, *args)