raisoblast / bottle-pgsql Goto Github PK
View Code? Open in Web Editor NEWPostgreSQL Plugin for Bottle.py
PostgreSQL Plugin for Bottle.py
After a bit of research have found that
cur = con.cursor(cursor_factory=psycopg2.extras.DictCursor)
should be
cur = con.cursor(cursor_factory=psycopg2.extras.RealDictCursor)
https://github.com/raisoblast/bottle-pgsql/blob/master/bottle_pgsql.py#L92
Stackoverflow answer
http://stackoverflow.com/questions/6739355/dictcursor-doesnt-seem-to-work-under-psycopg2
Similar to bottlepy/bottle-sqlite#10, bottle
now complains when loading the plugin:
/usr/lib/python2.7/dist-packages/bottle.py:527: DeprecationWarning: Switch to Plugin API v2 and access the Route object directly.
context = self if api > 1 else self._context
See bottlepy/bottle-redis#3 for the way bottle-redis fixed the issue.
The check for duplicate plugins tries to raise an undefined exception:
NameError: global name 'PluginError' is not defined
@app.route('/show/<item>')
@view('index')
def show(item, db):
# some code
this code will got an error that show
need 2 parameters
Using python 3.10.4
import bottle_pgsql
File ~/Projects/samgt/.direnv/python-3.10.4/lib/python3.10/site-packages/bottle_pgsql.py:95
except HTTPResponse, e:
^
SyntaxError: multiple exception types must be parenthesized
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.