authen 2 anos atrás
pai
commit
7dbb23f895
5 arquivos alterados com 90 adições e 3 exclusões
  1. 87 0
      .gitignore
  2. BIN
      authen/.DS_Store
  3. BIN
      authen/util/.DS_Store
  4. 2 2
      authen/util/pagination.py
  5. 1 1
      setup.py

+ 87 - 0
.gitignore

@@ -0,0 +1,87 @@
+# ---> Python
+# Byte-compiled / optimized / DLL files
+__pycache__/
+*.py[cod]
+*$py.class
+
+# C extensions
+*.so
+
+# Distribution / packaging
+.Python
+env/
+build/
+develop-eggs/
+dist/
+downloads/
+eggs/
+.eggs/
+lib/
+lib64/
+parts/
+sdist/
+var/
+*.egg-info/
+.installed.cfg
+*.egg
+
+# PyInstaller
+#  Usually these files are written by a python script from a template
+#  before PyInstaller builds the exe, so as to inject date/other infos into it.
+*.manifest
+*.spec
+
+# Installer logs
+pip-log.txt
+pip-delete-this-directory.txt
+
+# Unit test / coverage reports
+htmlcov/
+.tox/
+.coverage
+.coverage.*
+.cache
+nosetests.xml
+coverage.xml
+*,cover
+
+# Translations
+*.mo
+*.pot
+
+# Django stuff:
+*.log
+
+# Sphinx documentation
+docs/_build/
+
+# PyBuilder
+target/
+
+# ---> macOS
+.DS_Store
+.AppleDoubl
+.LSOverrid
+
+# Icon must end with two \r
+Icon
+
+
+# Thumbnails
+._*
+
+# Files that might appear in the root of a volume
+.DocumentRevisions-V100
+.fseventsd
+.Spotlight-V100
+.TemporaryItems
+.Trashes
+.VolumeIcon.icns
+
+# Directories potentially created on remote AFP share
+.AppleDB
+.AppleDesktop
+Network Trash Folder
+Temporary Items
+.apdisk
+.*

BIN
authen/.DS_Store


BIN
authen/util/.DS_Store


+ 2 - 2
authen/util/pagination.py

@@ -96,11 +96,11 @@ class SqlPages(BasePages):
             rv.append(row_dict)
         return rv
 
-    def items(self):
+    def items(self, offset=0):
         query_sql = "%s limit %s offset %s;" % (
             self.Query,
             self.per_page,
-            (self.page-1)*self.per_page
+            (self.page-1)*self.per_page + offset
         )
         cursor = self.db.session.execute(text(query_sql), self.query_args)
         records = cursor.fetchall()

+ 1 - 1
setup.py

@@ -4,7 +4,7 @@ from setuptools import setup, find_packages
 
 setup(
     name='authen.util',
-    version=0.22,
+    version=0.23,
     url='http://git.trops-global.com/authen/trops_utils.git',
     license='GPL',
     author='authen',