修訂 | 8841f48d6b5312184fac9cea3fc8555458705eea (tree) |
---|---|
時間 | 2018-12-20 22:08:14 |
作者 | kainushi sanuki (マーシー) <yamat0jp@yaho...> |
Commiter | kainushi sanuki (マーシー) |
master とか temp collection とか
@@ -427,7 +427,8 @@ class MasterHandler(BaseHandler): | ||
427 | 427 | def get(self): |
428 | 428 | if self.current_user == b'admin': |
429 | 429 | com = self.application.db['master'].find() |
430 | - self.render('master.htm',com=com) | |
430 | + sum = self.application.db['temp'].find().count() | |
431 | + self.render('master.htm',com=com,sum=sum) | |
431 | 432 | else: |
432 | 433 | raise web.HTTPError(404) |
433 | 434 |
@@ -470,16 +471,18 @@ class CleanHandler(web.RequestHandler): | ||
470 | 471 | table = self.application.db['master'] |
471 | 472 | if bool == 'true': |
472 | 473 | table.remove() |
474 | + self.application.db['temp'].remove() | |
473 | 475 | elif bool == 'false': |
474 | 476 | for x in list(table.find()): |
475 | 477 | if not 'number' in x.keys(): |
476 | 478 | table.remove({'_id':x['_id']}) |
477 | 479 | else: |
478 | 480 | item = self.application.db[x['db']].find_one({'number':int(x['num'])}) |
479 | - if not item or item['raw'] == '': | |
481 | + if (not item)or(item['raw'] == ''): | |
480 | 482 | table.remove({'_id':x['_id']}) |
481 | 483 | com = self.application.db['master'].find() |
482 | - self.render('master.htm', com=com) | |
484 | + sum = self.application.db['temp'].find().count() | |
485 | + self.render('master.htm', com=com, sum=sum) | |
483 | 486 | |
484 | 487 | class FooterModule(web.UIModule): |
485 | 488 | def render(self,number,url,link): |
@@ -16,4 +16,5 @@ | ||
16 | 16 | <form action=/clean?all=true method=post> |
17 | 17 | {% module xsrf_form_html() %} |
18 | 18 | <p>全ての報告を<input type=submit value=削除></form> |
19 | +<p>(temp count {{sum}})</p> | |
19 | 20 | </body></html> |
\ No newline at end of file |