]> git.phdru.name Git - m_librarian.git/blob - m_librarian/web/views/index.py
Feat(web:books): Поиск по названиям книг
[m_librarian.git] / m_librarian / web / views / index.py
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3
4
5
6
7 ##################################################
8 ## DEPENDENCIES
9 import sys
10 import os
11 import os.path
12 try:
13     import builtins as builtin
14 except ImportError:
15     import __builtin__ as builtin
16 from os.path import getmtime, exists
17 import time
18 import types
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
28 from views.layout import layout
29 from views.search_authors_form import search_authors_form
30 from views.search_books_form import search_books_form
31
32 ##################################################
33 ## MODULE CONSTANTS
34 VFFSL=valueFromFrameOrSearchList
35 VFSL=valueFromSearchList
36 VFN=valueForName
37 currentTime=time.time
38 __CHEETAH_version__ = '3.1.0'
39 __CHEETAH_versionTuple__ = (3, 1, 0, 'final', 1)
40 __CHEETAH_genTime__ = 1527354191.441549
41 __CHEETAH_genTimestamp__ = 'Sat May 26 20:03:11 2018'
42 __CHEETAH_src__ = 'index.tmpl'
43 __CHEETAH_srcLastModified__ = 'Sat May 26 20:03:09 2018'
44 __CHEETAH_docstring__ = 'Autogenerated by Cheetah: The Python-Powered Template Engine'
45
46 if __CHEETAH_versionTuple__ < RequiredCheetahVersionTuple:
47     raise AssertionError(
48       'This template was compiled with Cheetah version'
49       ' %s. Templates compiled before version %s must be recompiled.'%(
50          __CHEETAH_version__, RequiredCheetahVersion))
51
52 ##################################################
53 ## CLASSES
54
55 class index(layout):
56
57     ##################################################
58     ## CHEETAH GENERATED METHODS
59
60
61     def __init__(self, *args, **KWs):
62
63         super(index, self).__init__(*args, **KWs)
64         if not self._CHEETAH__instanceInitialized:
65             cheetahKWArgs = {}
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)
70         
71
72     def body(self, **KWS):
73
74
75
76         ## CHEETAH: generated from #def body at line 4, 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
80         if not trans:
81             trans = DummyTransaction()
82             _dummyTrans = True
83         else: _dummyTrans = False
84         write = trans.response().write
85         SL = self._CHEETAH__searchList
86         _filter = self._CHEETAH__currentFilter
87         
88         ########################################
89         ## START - generated method body
90         
91         write(u'''<h1>\u041f\u043e\u0438\u0441\u043a \u0430\u0432\u0442\u043e\u0440\u043e\u0432</h1>
92
93 ''')
94         _v = VFFSL(SL,"search_authors_form",False)(searchList=VFFSL(SL,"searchList",True)) # u'$search_authors_form(searchList=$searchList)' on line 8, col 1
95         if _v is not None: write(_filter(_v, rawExpr=u'$search_authors_form(searchList=$searchList)')) # from line 8, col 1.
96         write(u'''
97
98 <h1>\u041f\u043e\u0438\u0441\u043a \u043a\u043d\u0438\u0433</h1>
99
100 ''')
101         _v = VFFSL(SL,"search_books_form",False)(searchList=VFFSL(SL,"searchList",True)) # u'$search_books_form(searchList=$searchList)' on line 13, col 1
102         if _v is not None: write(_filter(_v, rawExpr=u'$search_books_form(searchList=$searchList)')) # from line 13, col 1.
103         write(u'''
104 ''')
105         
106         ########################################
107         ## END - generated method body
108         
109         return _dummyTrans and trans.response().getvalue() or ""
110         
111
112     def writeBody(self, **KWS):
113
114
115
116         ## CHEETAH: main method generated for this template
117         trans = KWS.get("trans")
118         if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
119             trans = self.transaction # is None unless self.awake() was called
120         if not trans:
121             trans = DummyTransaction()
122             _dummyTrans = True
123         else: _dummyTrans = False
124         write = trans.response().write
125         SL = self._CHEETAH__searchList
126         _filter = self._CHEETAH__currentFilter
127         
128         ########################################
129         ## START - generated method body
130         
131         
132         ########################################
133         ## END - generated method body
134         
135         return _dummyTrans and trans.response().getvalue() or ""
136         
137     ##################################################
138     ## CHEETAH GENERATED ATTRIBUTES
139
140
141     _CHEETAH__instanceInitialized = False
142
143     _CHEETAH_version = __CHEETAH_version__
144
145     _CHEETAH_versionTuple = __CHEETAH_versionTuple__
146
147     _CHEETAH_genTime = __CHEETAH_genTime__
148
149     _CHEETAH_genTimestamp = __CHEETAH_genTimestamp__
150
151     _CHEETAH_src = __CHEETAH_src__
152
153     _CHEETAH_srcLastModified = __CHEETAH_srcLastModified__
154
155     title = 'Поиск'
156
157     _mainCheetahMethod_for_index = 'writeBody'
158
159 ## END CLASS DEFINITION
160
161 if not hasattr(index, '_initCheetahAttributes'):
162     templateAPIClass = getattr(index,
163                                '_CHEETAH_templateClass',
164                                Template)
165     templateAPIClass._addCheetahPlumbingCodeToClass(index)
166
167
168 # CHEETAH was developed by Tavis Rudd and Mike Orr
169 # with code, advice and input from many other volunteers.
170 # For more information visit http://cheetahtemplate.org/
171
172 ##################################################
173 ## if run from command line:
174 if __name__ == '__main__':
175     from Cheetah.TemplateCmdLineIface import CmdLineIface
176     CmdLineIface(templateObj=index()).run()
177
178