open_db()
authors = search_authors(search_type, case_sensitive, {}, expressions,
orderBy=('surname', 'name', 'misc_name'))
- return {'authors': list(authors)}
+ return {
+ 'authors': list(authors),
+ 'search_authors': value,
+ 'search_type': search_type,
+ 'case_sensitive': case_sensitive,
+ }
currentTime=time.time
__CHEETAH_version__ = '3.1.0'
__CHEETAH_versionTuple__ = (3, 1, 0, 'final', 1)
-__CHEETAH_genTime__ = 1522958547.022135
-__CHEETAH_genTimestamp__ = 'Thu Apr 5 23:02:27 2018'
+__CHEETAH_genTime__ = 1522961823.924543
+__CHEETAH_genTimestamp__ = 'Thu Apr 5 23:57:03 2018'
__CHEETAH_src__ = 'index.tmpl'
-__CHEETAH_srcLastModified__ = 'Thu Apr 5 23:02:23 2018'
+__CHEETAH_srcLastModified__ = 'Thu Apr 5 23:54:01 2018'
__CHEETAH_docstring__ = 'Autogenerated by Cheetah: The Python-Powered Template Engine'
if __CHEETAH_versionTuple__ < RequiredCheetahVersionTuple:
write(u'''<h1>\u041f\u043e\u0438\u0441\u043a \u0430\u0432\u0442\u043e\u0440\u043e\u0432</h1>
''')
- _v = VFFSL(SL,"search_authors_form",False)() # u'$search_authors_form()' on line 8, col 1
- if _v is not None: write(_filter(_v, rawExpr=u'$search_authors_form()')) # from line 8, col 1.
+ _v = VFFSL(SL,"search_authors_form",False)(searchList=VFFSL(SL,"searchList",True)) # u'$search_authors_form(searchList=$searchList)' on line 8, col 1
+ if _v is not None: write(_filter(_v, rawExpr=u'$search_authors_form(searchList=$searchList)')) # from line 8, col 1.
write(u'''
''')
<h1>Поиск авторов</h1>
#from views.search_authors_form import search_authors_form
-$search_authors_form()
+$search_authors_form(searchList=$searchList)
#end def
currentTime=time.time
__CHEETAH_version__ = '3.1.0'
__CHEETAH_versionTuple__ = (3, 1, 0, 'final', 1)
-__CHEETAH_genTime__ = 1522953148.995817
-__CHEETAH_genTimestamp__ = 'Thu Apr 5 21:32:28 2018'
+__CHEETAH_genTime__ = 1522960530.67886
+__CHEETAH_genTimestamp__ = 'Thu Apr 5 23:35:30 2018'
__CHEETAH_src__ = 'layout.tmpl'
-__CHEETAH_srcLastModified__ = 'Thu Apr 5 21:32:27 2018'
+__CHEETAH_srcLastModified__ = 'Thu Apr 5 23:35:06 2018'
__CHEETAH_docstring__ = 'Autogenerated by Cheetah: The Python-Powered Template Engine'
if __CHEETAH_versionTuple__ < RequiredCheetahVersionTuple:
import Cheetah.ErrorCatchers as ErrorCatchers
from Cheetah.compat import unicode
from views.layout import layout
+from views.search_authors_form import search_authors_form
##################################################
## MODULE CONSTANTS
currentTime=time.time
__CHEETAH_version__ = '3.1.0'
__CHEETAH_versionTuple__ = (3, 1, 0, 'final', 1)
-__CHEETAH_genTime__ = 1522957487.491209
-__CHEETAH_genTimestamp__ = 'Thu Apr 5 22:44:47 2018'
+__CHEETAH_genTime__ = 1522961824.042332
+__CHEETAH_genTimestamp__ = 'Thu Apr 5 23:57:04 2018'
__CHEETAH_src__ = 'list_authors.tmpl'
-__CHEETAH_srcLastModified__ = 'Thu Apr 5 22:42:57 2018'
+__CHEETAH_srcLastModified__ = 'Thu Apr 5 23:54:11 2018'
__CHEETAH_docstring__ = 'Autogenerated by Cheetah: The Python-Powered Template Engine'
if __CHEETAH_versionTuple__ < RequiredCheetahVersionTuple:
########################################
## START - generated method body
- write(u'''<h1>''')
- _v = VFFSL(SL,"title",True) # u'$title' on line 5, col 5
- if _v is not None: write(_filter(_v, rawExpr=u'$title')) # from line 5, col 5.
+ write(u'''<h1>\u041f\u043e\u0438\u0441\u043a \u0430\u0432\u0442\u043e\u0440\u043e\u0432</h1>
+''')
+ _v = VFFSL(SL,"search_authors_form",False)(searchList=VFFSL(SL,"searchList",True)) # u'$search_authors_form(searchList=$searchList)' on line 7, col 1
+ if _v is not None: write(_filter(_v, rawExpr=u'$search_authors_form(searchList=$searchList)')) # from line 7, col 1.
+ write(u'''
+
+<h1>''')
+ _v = VFFSL(SL,"title",True) # u'$title' on line 9, col 5
+ if _v is not None: write(_filter(_v, rawExpr=u'$title')) # from line 9, col 5.
write(u'''</h1>
''')
- if VFFSL(SL,"authors",True): # generated from line 7, col 1
+ if VFFSL(SL,"authors",True): # generated from line 11, col 1
write(u''' <table>
''')
- for author in VFFSL(SL,"authors",True): # generated from line 9, col 3
+ for author in VFFSL(SL,"authors",True): # generated from line 13, col 3
write(u''' <tr>
<td>''')
- _v = VFFSL(SL,"author.fullname",True) # u'$author.fullname' on line 11, col 9
- if _v is not None: write(_filter(_v, rawExpr=u'$author.fullname')) # from line 11, col 9.
+ _v = VFFSL(SL,"author.fullname",True) # u'$author.fullname' on line 15, col 9
+ if _v is not None: write(_filter(_v, rawExpr=u'$author.fullname')) # from line 15, col 9.
write(u'''</td>
</tr>
''')
write(u''' </table>
''')
- else: # generated from line 15, col 1
+ else: # generated from line 19, col 1
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>
''')
#extends views.layout
#attr $title = 'Список авторов'
#def body
+<h1>Поиск авторов</h1>
+#from views.search_authors_form import search_authors_form
+$search_authors_form(searchList=$searchList)
+
<h1>$title</h1>
#if $authors
currentTime=time.time
__CHEETAH_version__ = '3.1.0'
__CHEETAH_versionTuple__ = (3, 1, 0, 'final', 1)
-__CHEETAH_genTime__ = 1522952816.408144
-__CHEETAH_genTimestamp__ = 'Thu Apr 5 21:26:56 2018'
+__CHEETAH_genTime__ = 1522961824.208664
+__CHEETAH_genTimestamp__ = 'Thu Apr 5 23:57:04 2018'
__CHEETAH_src__ = 'search_authors.tmpl'
-__CHEETAH_srcLastModified__ = 'Thu Apr 5 21:26:43 2018'
+__CHEETAH_srcLastModified__ = 'Thu Apr 5 23:54:16 2018'
__CHEETAH_docstring__ = 'Autogenerated by Cheetah: The Python-Powered Template Engine'
if __CHEETAH_versionTuple__ < RequiredCheetahVersionTuple:
write(u'''</h1>
''')
- _v = VFFSL(SL,"search_authors_form",False)() # u'$search_authors_form()' on line 8, col 1
- if _v is not None: write(_filter(_v, rawExpr=u'$search_authors_form()')) # from line 8, col 1.
+ _v = VFFSL(SL,"search_authors_form",False)(searchList=VFFSL(SL,"searchList",True)) # u'$search_authors_form(searchList=$searchList)' on line 8, col 1
+ if _v is not None: write(_filter(_v, rawExpr=u'$search_authors_form(searchList=$searchList)')) # from line 8, col 1.
write(u'''
''')
<h1>$title</h1>
#from views.search_authors_form import search_authors_form
-$search_authors_form()
+$search_authors_form(searchList=$searchList)
#end def
import Cheetah.Filters as Filters
import Cheetah.ErrorCatchers as ErrorCatchers
from Cheetah.compat import unicode
+from bottle import html_escape
##################################################
## MODULE CONSTANTS
currentTime=time.time
__CHEETAH_version__ = '3.1.0'
__CHEETAH_versionTuple__ = (3, 1, 0, 'final', 1)
-__CHEETAH_genTime__ = 1522958937.217914
-__CHEETAH_genTimestamp__ = 'Thu Apr 5 23:08:57 2018'
+__CHEETAH_genTime__ = 1522963362.420098
+__CHEETAH_genTimestamp__ = 'Fri Apr 6 00:22:42 2018'
__CHEETAH_src__ = 'search_authors_form.tmpl'
-__CHEETAH_srcLastModified__ = 'Thu Apr 5 23:08:55 2018'
+__CHEETAH_srcLastModified__ = 'Fri Apr 6 00:22:40 2018'
__CHEETAH_docstring__ = 'Autogenerated by Cheetah: The Python-Powered Template Engine'
if __CHEETAH_versionTuple__ < RequiredCheetahVersionTuple:
self._initCheetahInstance(**cheetahKWArgs)
+ def search_type_checked(self, value, **KWS):
+
+
+
+ ## CHEETAH: generated from #def $search_type_checked($value) at line 3, col 1.
+ trans = KWS.get("trans")
+ if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
+ trans = self.transaction # is None unless self.awake() was called
+ if not trans:
+ trans = DummyTransaction()
+ _dummyTrans = True
+ else: _dummyTrans = False
+ write = trans.response().write
+ SL = self._CHEETAH__searchList
+ _filter = self._CHEETAH__currentFilter
+
+ ########################################
+ ## START - generated method body
+
+ if VFFSL(SL,"getVar",False)('search_type', '') == VFFSL(SL,"value",True): # generated from line 4, col 1
+ write(u'''checked''')
+
+ ########################################
+ ## END - generated method body
+
+ return _dummyTrans and trans.response().getvalue() or ""
+
+
+ def case_sensitive_checked(self, **KWS):
+
+
+
+ ## CHEETAH: generated from #def $case_sensitive_checked at line 8, col 1.
+ trans = KWS.get("trans")
+ if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
+ trans = self.transaction # is None unless self.awake() was called
+ if not trans:
+ trans = DummyTransaction()
+ _dummyTrans = True
+ else: _dummyTrans = False
+ write = trans.response().write
+ SL = self._CHEETAH__searchList
+ _filter = self._CHEETAH__currentFilter
+
+ ########################################
+ ## START - generated method body
+
+ if VFFSL(SL,"getVar",False)('case_sensitive', None): # generated from line 9, col 1
+ write(u'''checked''')
+
+ ########################################
+ ## END - generated method body
+
+ return _dummyTrans and trans.response().getvalue() or ""
+
+
def respond(self, trans=None):
## START - generated method body
write(u'''<form action="/search_authors/" method="POST">
- <input name="search_authors" type="text" style="width: 80%">
+ <input name="search_authors" value="''')
+ _v = VFFSL(SL,"html_escape",False)(VFFSL(SL,"getVar",False)('search_authors', '')) # u"$html_escape($getVar('search_authors', ''))" on line 14, col 39
+ if _v is not None: write(_filter(_v, rawExpr=u"$html_escape($getVar('search_authors', ''))")) # from line 14, col 39.
+ write(u'''" type="text" style="width: 80%">
<br>
- <input name="search_type" value="start" type="radio">
+ <input name="search_type" value="start" ''')
+ _v = VFFSL(SL,"search_type_checked",False)('start') # u"$search_type_checked('start')" on line 16, col 43
+ if _v is not None: write(_filter(_v, rawExpr=u"$search_type_checked('start')")) # from line 16, col 43.
+ write(u''' type="radio">
\u041f\u043e\u0434\u0441\u0442\u0440\u043e\u043a\u0430 \u0432 \u043d\u0430\u0447\u0430\u043b\u0435
- <input name="search_type" value="substring" type="radio">
+ <input name="search_type" value="substring" ''')
+ _v = VFFSL(SL,"search_type_checked",False)('substring') # u"$search_type_checked('substring')" on line 18, col 47
+ if _v is not None: write(_filter(_v, rawExpr=u"$search_type_checked('substring')")) # from line 18, col 47.
+ write(u''' type="radio">
\u041f\u043e\u0434\u0441\u0442\u0440\u043e\u043a\u0430
- <input name="search_type" value="full" type="radio">
+ <input name="search_type" value="full" ''')
+ _v = VFFSL(SL,"search_type_checked",False)('full') # u"$search_type_checked('full')" on line 20, col 42
+ if _v is not None: write(_filter(_v, rawExpr=u"$search_type_checked('full')")) # from line 20, col 42.
+ write(u''' type="radio">
\u0422\u043e\u0447\u043d\u043e\u0435 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0435
<br>
- <input name="case_sensitive" type="checkbox">
+ <input name="case_sensitive" type="checkbox" ''')
+ _v = VFFSL(SL,"case_sensitive_checked",True) # u'$case_sensitive_checked' on line 23, col 48
+ if _v is not None: write(_filter(_v, rawExpr=u'$case_sensitive_checked')) # from line 23, col 48.
+ write(u'''>
\u0420\u0430\u0437\u043b\u0438\u0447\u0430\u0442\u044c \u043f\u0440\u043e\u043f\u0438\u0441\u043d\u044b\u0435/\u0441\u0442\u0440\u043e\u0447\u043d\u044b\u0435
<br>
<input name="submit" type="submit">
#encoding utf-8
+#from bottle import html_escape
+#def $search_type_checked($value)
+#if $getVar('search_type', '') == $value
+checked#slurp
+#end if
+#end def
+#def $case_sensitive_checked
+#if $getVar('case_sensitive', None)
+checked#slurp
+#end if
+#end def
<form action="/search_authors/" method="POST">
- <input name="search_authors" type="text" style="width: 80%">
+ <input name="search_authors" value="$html_escape($getVar('search_authors', ''))" type="text" style="width: 80%">
<br>
- <input name="search_type" value="start" type="radio">
+ <input name="search_type" value="start" $search_type_checked('start') type="radio">
Подстрока в начале
- <input name="search_type" value="substring" type="radio">
+ <input name="search_type" value="substring" $search_type_checked('substring') type="radio">
Подстрока
- <input name="search_type" value="full" type="radio">
+ <input name="search_type" value="full" $search_type_checked('full') type="radio">
Точное совпадение
<br>
- <input name="case_sensitive" type="checkbox">
+ <input name="case_sensitive" type="checkbox" $case_sensitive_checked>
Различать прописные/строчные
<br>
<input name="submit" type="submit">