source: main/waeup.sirp/trunk/src/waeup/sirp/hostels/catalog.py @ 7022

Last change on this file since 7022 was 7006, checked in by Henrik Bettermann, 13 years ago

Add missing handler.

  • Property svn:keywords set to Id
File size: 1.1 KB
Line 
1"""Cataloging and searching components for hostels.
2"""
3import grok
4from grok import index
5from hurry.query import Eq, Text
6from hurry.query.query import Query
7from zope.catalog.interfaces import ICatalog
8from zope.component import queryUtility
9from waeup.sirp.interfaces import IUniversity, IQueryResultItem
10from waeup.sirp.hostels.interfaces import IBed
11
12class BedIndexes(grok.Indexes):
13    """A catalog for beds.
14    """
15    grok.site(IUniversity)
16    grok.name('beds_catalog')
17    grok.context(IBed)
18
19    #bed_id = index.Field(attribute='bed_id')
20    #bed_number = index.Field(attribute='bed_number')
21    bed_type = index.Field(attribute='bed_type')
22    owner = index.Field(attribute='owner')
23
24class BedQueryResultItem(object):
25    grok.implements(IQueryResultItem)
26
27    title = u'Bed Query Item'
28    description = u'Some bed found in a search'
29
30    def __init__(self, context, view):
31        self.context = context
32        self.url = view.url(context)
33        self.bed_id = context.bed_id
34        self.bed_type = context.bed_type
35        self.bed_number = context.bed_number
Note: See TracBrowser for help on using the repository browser.