6
##################################################
12
import builtins as builtin
14
import __builtin__ as builtin
15
from os.path import getmtime, exists
18
from Cheetah.Version import MinCompatibleVersion as RequiredCheetahVersion
19
from Cheetah.Version import MinCompatibleVersionTuple as RequiredCheetahVersionTuple
20
from Cheetah.Template import Template
21
from Cheetah.DummyTransaction import *
22
from Cheetah.NameMapper import NotFound, valueForName, valueFromSearchList, valueFromFrameOrSearchList
23
from Cheetah.CacheRegion import CacheRegion
24
import Cheetah.Filters as Filters
25
import Cheetah.ErrorCatchers as ErrorCatchers
26
from campopener.templates.Site import Site
28
##################################################
30
VFFSL=valueFromFrameOrSearchList
31
VFSL=valueFromSearchList
34
__CHEETAH_version__ = '2.4.3'
35
__CHEETAH_versionTuple__ = (2, 4, 3, 'development', 0)
36
__CHEETAH_genTime__ = 1289113167.6919999
37
__CHEETAH_genTimestamp__ = 'Sun Nov 07 17:59:27 2010'
38
__CHEETAH_src__ = 'campopener\\templates\\camp\\ListCamps.tmpl'
39
__CHEETAH_srcLastModified__ = 'Sun Nov 07 17:37:41 2010'
40
__CHEETAH_docstring__ = 'Autogenerated by Cheetah: The Python-Powered Template Engine'
42
if __CHEETAH_versionTuple__ < RequiredCheetahVersionTuple:
44
'This template was compiled with Cheetah version'
45
' %s. Templates compiled before version %s must be recompiled.'%(
46
__CHEETAH_version__, RequiredCheetahVersion))
48
##################################################
51
class ListCamps(Site):
53
##################################################
54
## CHEETAH GENERATED METHODS
57
def __init__(self, *args, **KWs):
59
super(ListCamps, self).__init__(*args, **KWs)
60
if not self._CHEETAH__instanceInitialized:
62
allowedKWs = 'searchList namespaces filter filtersLib errorCatcher'.split()
63
for k,v in KWs.items():
64
if k in allowedKWs: cheetahKWArgs[k] = v
65
self._initCheetahInstance(**cheetahKWArgs)
68
def body(self, **KWS):
72
## CHEETAH: generated from #def body at line 4, col 1.
73
trans = KWS.get("trans")
74
if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
75
trans = self.transaction # is None unless self.awake() was called
77
trans = DummyTransaction()
79
else: _dummyTrans = False
80
write = trans.response().write
81
SL = self._CHEETAH__searchList
82
_filter = self._CHEETAH__currentFilter
84
########################################
85
## START - generated method body
87
write(u'''<div id="content">
88
<h1>List all Camps</h1>
92
for camp in VFSL([locals()]+SL+[globals(), builtin],"camps",True): # generated from line 9, col 1
95
<div id="camp" class="mini">
98
_v = VFSL([locals()]+SL+[globals(), builtin],"camp.Year",True) # u'$camp.Year' on line 14, col 21
99
if _v is not None: write(_filter(_v, rawExpr=u'$camp.Year')) # from line 14, col 21.
101
_v = VFSL([locals()]+SL+[globals(), builtin],"camp.Name",True) # u'$camp.Name' on line 14, col 34
102
if _v is not None: write(_filter(_v, rawExpr=u'$camp.Name')) # from line 14, col 34.
106
_v = VFSL([locals()]+SL+[globals(), builtin],"url",False)(controller='camps',action='list', camp=VFSL([locals()]+SL+[globals(), builtin],"camp.Id",True)) # u"$url(controller='camps',action='list', camp=$camp.Id)" on line 16, col 26
107
if _v is not None: write(_filter(_v, rawExpr=u"$url(controller='camps',action='list', camp=$camp.Id)")) # from line 16, col 26.
116
########################################
117
## END - generated method body
119
return _dummyTrans and trans.response().getvalue() or ""
122
def writeBody(self, **KWS):
126
## CHEETAH: main method generated for this template
127
trans = KWS.get("trans")
128
if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
129
trans = self.transaction # is None unless self.awake() was called
131
trans = DummyTransaction()
133
else: _dummyTrans = False
134
write = trans.response().write
135
SL = self._CHEETAH__searchList
136
_filter = self._CHEETAH__currentFilter
138
########################################
139
## START - generated method body
144
########################################
145
## END - generated method body
147
return _dummyTrans and trans.response().getvalue() or ""
149
##################################################
150
## CHEETAH GENERATED ATTRIBUTES
153
_CHEETAH__instanceInitialized = False
155
_CHEETAH_version = __CHEETAH_version__
157
_CHEETAH_versionTuple = __CHEETAH_versionTuple__
159
_CHEETAH_genTime = __CHEETAH_genTime__
161
_CHEETAH_genTimestamp = __CHEETAH_genTimestamp__
163
_CHEETAH_src = __CHEETAH_src__
165
_CHEETAH_srcLastModified = __CHEETAH_srcLastModified__
167
_mainCheetahMethod_for_ListCamps= 'writeBody'
169
## END CLASS DEFINITION
171
if not hasattr(ListCamps, '_initCheetahAttributes'):
172
templateAPIClass = getattr(ListCamps, '_CHEETAH_templateClass', Template)
173
templateAPIClass._addCheetahPlumbingCodeToClass(ListCamps)
176
# CHEETAH was developed by Tavis Rudd and Mike Orr
177
# with code, advice and input from many other volunteers.
178
# For more information visit http://www.CheetahTemplate.org/
180
##################################################
181
## if run from command line:
182
if __name__ == '__main__':
183
from Cheetah.TemplateCmdLineIface import CmdLineIface
184
CmdLineIface(templateObj=ListCamps()).run()