def GET(self): params = web.input(start=config.start, limit=config.limit) limit = int(params.limit) start = int(params.start) params = entryService.search(entryService.types.index, config.index_url, '', start, limit) return render.index(params)
def GET(self, url): params = web.input(type=entryService.types.query, value='', \ start=config.start, limit=config.limit) limit = int(params.limit) start = int(params.start) url = '%s/?type=%s&value=%s&start=%d&limit=%d' % (config.search_url, params.type, params.value, start, limit) params = entryService.search(params.type, url, params.value, start, limit) if not params.entries == None: return render.search(params) raise web.notfound(render.error(params))
def Entry(url): if not url in ['', '/']: url = config.entry_url + url params = entryService.find_by_url(entryService.types.entry, url) if params.entry == None: return template('error', params=params, config=config) else: return template('entry', params=params, config=config) params = entryService.search(entryService.types.index, url) return template('index', params=params, config=config)
def GET(self, url): if not url in ['', '/']: url = config.entry_url + url params = entryService.find_by_url(entryService.types.entry, url) if params.entry == None: raise web.notfound(render.error(params)) else: return render.entry(params) params = entryService.search(entryService.types.index, url) return render.index(params)
def GET(self, url): params = web.input(type=entryService.types.query, value='',\ start=config.start, limit=config.limit) limit = int(params.limit) start = int(params.start) url = '%s/?type=%s&value=%s&start=%d&limit=%d' % (config.search_url, params.type, params.value, start, limit) params = entryService.search(params.type, url, params.value, start, limit) if not params.entries == None: return render.search(params) raise web.notfound(render.error(params))
def Search(): type = request.GET.get('type', entryService.types.query) value = request.GET.get('value', '') limit = int(request.GET.get('limit', config.limit)) start = int(request.GET.get('start', config.start)) url = '%s/?type=%s&value=%s&start=%d&limit=%d' % (config.search_url, type, value, start, limit) params = entryService.search(type, url, value, start, limit) if not params.entries == None: return template('search', params=params, config=config) return template('error', params=params, config=config)
def Search(url): print url.split("/") type,value,startStr,limitStr = url.split("/") limit = int(limitStr) start = int(startStr) url = '%s/?type=%s&value=%s&start=%d&limit=%d' % (config.search_url, type, value, start, limit) params = entryService.search(type, url, value, start, limit) if not params.entries == None: return template('search', params=params, config=config) return template('error', params=params, config=config)
def Search(url): print url.split("/") type, value, startStr, limitStr = url.split("/") limit = int(limitStr) start = int(startStr) url = '%s/?type=%s&value=%s&start=%d&limit=%d' % (config.search_url, type, value, start, limit) params = entryService.search(type, url, value, start, limit) if not params.entries == None: return template('search', params=params, config=config) return template('error', params=params, config=config)
def sitemap(): params = entryService.search(entryService.types.index, config.subscribe_url, limit=10000) response.headers['Content-Type'] = 'text/xml' return template('sitemap.html', params=params, config=config)
def GET(self): params = entryService.search(entryService.types.index, config.subscribe_url) web.header('Content-Type', 'text/xml') return render.atom(params)
def Index(): limit = int(request.GET.get('limit', 10)) start = int(request.GET.get('start', 1)) params = entryService.search(entryService.types.index, config.index_url, '', start, limit) return template('index', params=params, config=config)
def Subscribe(): params = entryService.search(entryService.types.index, config.subscribe_url) response.headers['Content-Type'] = 'text/xml' return template('atom', params=params, config=config)