/[hyperestraier_wrappers]/trunk/examples/subway/controller/__init__.py
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /trunk/examples/subway/controller/__init__.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2 - (show annotations)
Sat Sep 3 18:04:41 2005 UTC (18 years, 7 months ago) by dpavlin
File MIME type: text/x-python
File size: 737 byte(s)
make working copy
1 from subway.view import views
2 from subway import controller, util
3 from cherrypy import cpg
4
5 from HyperEstraier import *
6
7 views = views
8
9 class Root(controller.Controller):
10 def index(self):
11 return views.index()
12 index.exposed = True
13
14 def search(self, keyword=""):
15 cond = Condition()
16 cond.set_phrase(keyword)
17 cond.set_order('@mdate STRD')
18 numbers = self.db.search(cond, 0)
19 return views.search(db = self.db, numbers=numbers)
20 search.exposed = True
21
22 def mail(self, id=""):
23 return views.mail(doc=self.db.get_doc(int(id), 0))
24 mail.exposed = True
25
26 def __init__(self):
27 self.db = Database()
28 if not self.db.open('/tmp/casket', Database.DBREADER):
29 raise "cannot open db"
30
31 controller = Root()

  ViewVC Help
Powered by ViewVC 1.1.26