2 # -*- coding: utf-8 -*-
7 ##################################################
13 import builtins as builtin
15 import __builtin__ as builtin
16 from os.path import getmtime, exists
19 from Cheetah.Version import MinCompatibleVersion as RequiredCheetahVersion
20 from Cheetah.Version import MinCompatibleVersionTuple as RequiredCheetahVersionTuple
21 from Cheetah.Template import Template
22 from Cheetah.DummyTransaction import *
23 from Cheetah.NameMapper import NotFound, valueForName, valueFromSearchList, valueFromFrameOrSearchList
24 from Cheetah.CacheRegion import CacheRegion
25 import Cheetah.Filters as Filters
26 import Cheetah.ErrorCatchers as ErrorCatchers
27 from Cheetah.compat import unicode
29 from views.layout import layout
30 from views.search_authors_form import search_authors_form
32 ##################################################
34 VFFSL=valueFromFrameOrSearchList
35 VFSL=valueFromSearchList
38 __CHEETAH_version__ = '3.1.0'
39 __CHEETAH_versionTuple__ = (3, 1, 0, 'final', 1)
40 __CHEETAH_genTime__ = 1528670903.492958
41 __CHEETAH_genTimestamp__ = 'Mon Jun 11 01:48:23 2018'
42 __CHEETAH_src__ = 'list_authors.tmpl'
43 __CHEETAH_srcLastModified__ = 'Mon Jun 11 01:48:21 2018'
44 __CHEETAH_docstring__ = 'Autogenerated by Cheetah: The Python-Powered Template Engine'
46 if __CHEETAH_versionTuple__ < RequiredCheetahVersionTuple:
48 'This template was compiled with Cheetah version'
49 ' %s. Templates compiled before version %s must be recompiled.'%(
50 __CHEETAH_version__, RequiredCheetahVersion))
52 ##################################################
55 class list_authors(layout):
57 ##################################################
58 ## CHEETAH GENERATED METHODS
61 def __init__(self, *args, **KWs):
63 super(list_authors, self).__init__(*args, **KWs)
64 if not self._CHEETAH__instanceInitialized:
66 allowedKWs = 'searchList namespaces filter filtersLib errorCatcher'.split()
67 for k,v in KWs.items():
68 if k in allowedKWs: cheetahKWArgs[k] = v
69 self._initCheetahInstance(**cheetahKWArgs)
72 def body(self, **KWS):
76 ## CHEETAH: generated from #def body at line 5, col 1.
77 trans = KWS.get("trans")
78 if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
79 trans = self.transaction # is None unless self.awake() was called
81 trans = DummyTransaction()
83 else: _dummyTrans = False
84 write = trans.response().write
85 SL = self._CHEETAH__searchList
86 _filter = self._CHEETAH__currentFilter
88 ########################################
89 ## START - generated method body
91 write(u'''<h1>\u041f\u043e\u0438\u0441\u043a \u0430\u0432\u0442\u043e\u0440\u043e\u0432</h1>
93 _v = VFFSL(SL,"search_authors_form",False)(searchList=VFFSL(SL,"searchList",True)) # u'$search_authors_form(searchList=$searchList)' on line 8, col 1
94 if _v is not None: write(_filter(_v, rawExpr=u'$search_authors_form(searchList=$searchList)')) # from line 8, col 1.
98 _v = VFFSL(SL,"title",True) # u'$title' on line 10, col 5
99 if _v is not None: write(_filter(_v, rawExpr=u'$title')) # from line 10, col 5.
103 if VFFSL(SL,"authors",True): # generated from line 12, col 1
106 for author in VFFSL(SL,"authors",True): # generated from line 14, col 3
109 for column in VFFSL(SL,"columns",True): # generated from line 16, col 3
110 write(u''' <td><a href="/books-by-author/''')
111 _v = VFFSL(SL,"author.id",True) # u'$author.id' on line 17, col 35
112 if _v is not None: write(_filter(_v, rawExpr=u'$author.id')) # from line 17, col 35.
115 _v = VFN(VFFSL(SL,"cgi",True),"escape",False)(unicode(VFFSL(SL,"getattr",False)(VFFSL(SL,"author",True), VFFSL(SL,"column",True)) or '')) # u"$cgi.escape(unicode($getattr($author, $column) or ''))" on line 18, col 5
116 if _v is not None: write(_filter(_v, rawExpr=u"$cgi.escape(unicode($getattr($author, $column) or ''))")) # from line 18, col 5.
124 else: # generated from line 24, col 1
125 write(u''' <p>\u041d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u043e \u043d\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u0430\u0432\u0442\u043e\u0440\u0430!</p>
128 ########################################
129 ## END - generated method body
131 return _dummyTrans and trans.response().getvalue() or ""
134 def writeBody(self, **KWS):
138 ## CHEETAH: main method generated for this template
139 trans = KWS.get("trans")
140 if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
141 trans = self.transaction # is None unless self.awake() was called
143 trans = DummyTransaction()
145 else: _dummyTrans = False
146 write = trans.response().write
147 SL = self._CHEETAH__searchList
148 _filter = self._CHEETAH__currentFilter
150 ########################################
151 ## START - generated method body
154 ########################################
155 ## END - generated method body
157 return _dummyTrans and trans.response().getvalue() or ""
159 ##################################################
160 ## CHEETAH GENERATED ATTRIBUTES
163 _CHEETAH__instanceInitialized = False
165 _CHEETAH_version = __CHEETAH_version__
167 _CHEETAH_versionTuple = __CHEETAH_versionTuple__
169 _CHEETAH_genTime = __CHEETAH_genTime__
171 _CHEETAH_genTimestamp = __CHEETAH_genTimestamp__
173 _CHEETAH_src = __CHEETAH_src__
175 _CHEETAH_srcLastModified = __CHEETAH_srcLastModified__
177 title = 'Список авторов'
179 _mainCheetahMethod_for_list_authors = 'writeBody'
181 ## END CLASS DEFINITION
183 if not hasattr(list_authors, '_initCheetahAttributes'):
184 templateAPIClass = getattr(list_authors,
185 '_CHEETAH_templateClass',
187 templateAPIClass._addCheetahPlumbingCodeToClass(list_authors)
190 # CHEETAH was developed by Tavis Rudd and Mike Orr
191 # with code, advice and input from many other volunteers.
192 # For more information visit http://cheetahtemplate.org/
194 ##################################################
195 ## if run from command line:
196 if __name__ == '__main__':
197 from Cheetah.TemplateCmdLineIface import CmdLineIface
198 CmdLineIface(templateObj=list_authors()).run()