OSDN Git Service

できるかな
authoryamat0jp <terukohietori@gmail.com>
Sat, 1 Feb 2020 09:43:06 +0000 (18:43 +0900)
committeryamat0jp <terukohietori@gmail.com>
Sat, 1 Feb 2020 09:43:06 +0000 (18:43 +0900)
pybbs.py

index 87fb294..b6210e4 100644 (file)
--- a/pybbs.py
+++ b/pybbs.py
@@ -1,4 +1,4 @@
-# -*- coding:utf-8 -*-
+# -*- coding:utf-8 -*-
 import os,re,glob
 from tornado import escape,web,ioloop,httpserver,httpclient
 import pymongo, urllib
@@ -760,7 +760,7 @@ class Application(web.Application):
         if pos <= 0:
             pos = 0
         elif (pos-1)*params['count'] >= self.db[dbname].count():
-            pos = 0
+            pos = self.db[dbname].count() // params['count'] + 1
         return pos
 
     def page(self,dbname,number):