Beispiel #1
0
 def get_item_value(self, resource, context, item, column):
     item_brain, item_resource = item
     #if column == 'description':
     #    return item_resource.get_property('description')
     if column == 'review':
         return item_resource.get_title(), context.get_link(item_resource)
     elif column == 'product':
         product = item_resource.parent.parent
         return product.get_title(), context.get_link(product)
     elif column == 'author':
         author = item_resource.get_property('author')
         if author:
             user = context.root.get_resource('/users/%s' % author)
             return user.get_title(), context.get_link(user)
         return MSG(u'Anonymous'), None
     elif column == 'remote_ip':
         return item_resource.get_property('remote_ip')
     elif column == 'note':
         return item_resource.get_property('note')
     elif column == 'ctime':
         ctime = item_resource.get_property('ctime')
         accept = context.accept_language
         return format_datetime(ctime, accept)
     #elif column == 'images':
     #    namespace = {'images': item_resource.get_images(context)}
     #    events = XMLParser("""
     #        <a href="${image/src}/;download" target="_blank" stl:repeat="image images"
     #          rel="fancybox">
     #          <img src="${image/src}/;thumb?width=50&amp;height=50"/>
     #        </a>
     #        """, stl_namespaces)
     #    return stl(events=events, namespace=namespace)
     return SearchTableFolder_View.get_item_value(self, resource, context, item, column)
Beispiel #2
0
 def get_item_value(self, resource, context, item, column):
     item_brain, item_resource = item
     #if column == 'description':
     #    return item_resource.get_property('description')
     if column == 'review':
         return item_resource.get_title(), context.get_link(item_resource)
     elif column == 'product':
         product = item_resource.parent.parent
         return product.get_title(), context.get_link(product)
     elif column == 'author':
         author = item_resource.get_property('author')
         if author:
             user = context.root.get_resource('/users/%s' % author)
             return user.get_title(), context.get_link(user)
         return MSG(u'Anonymous'), None
     elif column == 'remote_ip':
         return item_resource.get_property('remote_ip')
     elif column == 'note':
         return item_resource.get_property('note')
     elif column == 'ctime':
         ctime = item_resource.get_property('ctime')
         accept = context.accept_language
         return format_datetime(ctime, accept)
     #elif column == 'images':
     #    namespace = {'images': item_resource.get_images(context)}
     #    events = XMLParser("""
     #        <a href="${image/src}/;download" target="_blank" stl:repeat="image images"
     #          rel="fancybox">
     #          <img src="${image/src}/;thumb?width=50&amp;height=50"/>
     #        </a>
     #        """, stl_namespaces)
     #    return stl(events=events, namespace=namespace)
     return SearchTableFolder_View.get_item_value(self, resource, context,
                                                  item, column)
Beispiel #3
0
 def get_item_value(self, resource, context, item, column):
     item_brain, item_resource = item
     if column == 'review':
         review = item_resource.parent
         return review.name, context.get_link(review)
     elif column == 'description':
         return item_resource.get_property('description')
     return SearchTableFolder_View.get_item_value(self, resource, context, item, column)
Beispiel #4
0
 def get_item_value(self, resource, context, item, column):
     item_brain, item_resource = item
     if column == 'review':
         review = item_resource.parent
         return review.name, context.get_link(review)
     elif column == 'description':
         return item_resource.get_property('description')
     return SearchTableFolder_View.get_item_value(self, resource, context,
                                                  item, column)
Beispiel #5
0
 def get_items(self, resource, context, *args):
     abspath = str(resource.get_canonical_path())
     query = [
         PhraseQuery('parent_path', abspath),
         PhraseQuery('format', 'order')
     ]
     return SearchTableFolder_View.get_items(self,
                                             resource,
                                             context,
                                             query=query)
Beispiel #6
0
 def get_items(self, resource, context, *args):
     abspath = str(resource.get_canonical_path())
     query = [PhraseQuery('parent_path', abspath),
              PhraseQuery('format', 'order')]
     return SearchTableFolder_View.get_items(self, resource, context, query=query)
Beispiel #7
0
 def get_items(self, resource, context, query=[]):
     query = [PhraseQuery('format', 'shop_module_a_review')]
     return SearchTableFolder_View.get_items(self, resource, context, query)
Beispiel #8
0
 def get_items(self, resource, context, query=[]):
     query = [PhraseQuery('format', 'product')]
     # Super
     return SearchTableFolder_View.get_items(self, resource, context, query)
Beispiel #9
0
 def get_query_schema(self):
     return merge_dicts(SearchTableFolder_View.get_query_schema(self),
                        batch_size=Integer(default=50),
                        sort_by=String(default='mtime'))
Beispiel #10
0
 def get_query_schema(self):
     return merge_dicts(SearchTableFolder_View.get_query_schema(self),
                        reverse=Boolean(default=False),
                        sort_by=String(default='reference')) # XXX
Beispiel #11
0
 def get_items(self, resource, context, query=[]):
     query = [OrQuery(
                   PhraseQuery('format', 'product'),
                   PhraseQuery('format', 'product-declination'))]
     return SearchTableFolder_View.get_items(self, resource, context, query)
Beispiel #12
0
 def get_query_schema(self):
     return merge_dicts(SearchTableFolder_View.get_query_schema(self),
                        reverse=Boolean(default=False),
                        sort_by=String(default='reference'))  # XXX
Beispiel #13
0
 def get_items(self, resource, context, query=[]):
     query = [
         OrQuery(PhraseQuery('format', 'product'),
                 PhraseQuery('format', 'product-declination'))
     ]
     return SearchTableFolder_View.get_items(self, resource, context, query)
Beispiel #14
0
 def get_items(self, resource, context, query=[]):
     query = [PhraseQuery('format', 'shop_module_a_review')]
     return SearchTableFolder_View.get_items(self, resource, context, query)