peewee Documentation Release 3.5.0
BerkeleyDB [http://www.oracle.com/technetwork/database/database- technologies/berkeleydb/downloads/index.html] can be compiled with a SQLite frontend, which works with Peewee. Compiling can be tricky so here Postgres: psycopg2 [http://initd.org/psycopg/docs/module.html#psycopg2.connect] MySQL: MySQLdb [http://mysql-python.sourceforge.net/MySQLdb.html#some-mysql-examples] MySQL: pymysql [https://github.com 96/pymysql/co nnections.py#L494-L513] SQLite: sqlite3 [https://docs.python.org/2/library/sqlite3.html#sqlite3.connect] Using Postgresql To connect to a Postgresql database, we will use PostgresqlDatabase0 码力 | 347 页 | 380.80 KB | 1 年前3peewee Documentation Release 3.6.0
BerkeleyDB [http://www.oracle.com/technetwork/database/database- technologies/berkeleydb/downloads/index.html] can be compiled with a SQLite frontend, which works with Peewee. Compiling can be tricky so here Postgres: psycopg2 [http://initd.org/psycopg/docs/module.html#psycopg2.connect] MySQL: MySQLdb [http://mysql-python.sourceforge.net/MySQLdb.html#some-mysql-examples] MySQL: pymysql [https://github.com 96/pymysql/co nnections.py#L494-L513] SQLite: sqlite3 [https://docs.python.org/2/library/sqlite3.html#sqlite3.connect] Using Postgresql To connect to a Postgresql database, we will use PostgresqlDatabase0 码力 | 377 页 | 399.12 KB | 1 年前3peewee Documentation Release 2.10.2
BerkeleyDB [http://www.oracle.com/technetwork/database/database- technologies/berkeleydb/downloads/index.html] can be compiled with a SQLite frontend, which works with Peewee. Compiling can be tricky so here Postgres: psycopg2 [http://initd.org/psycopg/docs/module.html#psycopg2.connect] MySQL: MySQLdb [http://mysql-python.sourceforge.net/MySQLdb.html#some-mysql-examples] MySQL: pymysql [https://github.com 96/pymysql/co nnections.py#L494-L513] SQLite: sqlite3 [https://docs.python.org/2/library/sqlite3.html#sqlite3.connect] Using Postgresql To connect to a Postgresql database, we will use PostgresqlDatabase0 码力 | 275 页 | 276.96 KB | 1 年前3peewee Documentation Release 3.0.0
BerkeleyDB [http://www.oracle.com/technetwork/database/database- technologies/berkeleydb/downloads/index.html] can be compiled with a SQLite frontend, which works with Peewee. Compiling can be tricky so here sample data-set can be found on the getting started page [https://pgexercises.com/gettingstarted.html]. Here is a visual representation of the schema used in these examples: Model Definitions To begin Postgres: psycopg2 [http://initd.org/psycopg/docs/module.html#psycopg2.connect] MySQL: MySQLdb [http://mysql-python.sourceforge.net/MySQLdb.html#some-mysql-examples] MySQL: pymysql [https://github.com0 码力 | 319 页 | 361.50 KB | 1 年前3peewee Documentation Release 3.4.0
BerkeleyDB [http://www.oracle.com/technetwork/database/database- technologies/berkeleydb/downloads/index.html] can be compiled with a SQLite frontend, which works with Peewee. Compiling can be tricky so here sample data-set can be found on the getting started page [https://pgexercises.com/gettingstarted.html]. Here is a visual representation of the schema used in these examples: Model Definitions To begin Postgres: psycopg2 [http://initd.org/psycopg/docs/module.html#psycopg2.connect] MySQL: MySQLdb [http://mysql-python.sourceforge.net/MySQLdb.html#some-mysql-examples] MySQL: pymysql [https://github.com0 码力 | 349 页 | 382.34 KB | 1 年前3peewee Documentation Release 3.1.0
BerkeleyDB [http://www.oracle.com/technetwork/database/database- technologies/berkeleydb/downloads/index.html] can be compiled with a SQLite frontend, which works with Peewee. Compiling can be tricky so here sample data-set can be found on the getting started page [https://pgexercises.com/gettingstarted.html]. Here is a visual representation of the schema used in these examples: Model Definitions To begin Postgres: psycopg2 [http://initd.org/psycopg/docs/module.html#psycopg2.connect] MySQL: MySQLdb [http://mysql-python.sourceforge.net/MySQLdb.html#some-mysql-examples] MySQL: pymysql [https://github.com0 码力 | 332 页 | 370.77 KB | 1 年前3peewee Documentation Release 1.0.0
readthedocs.org/en/latest/peewee/playhouse.html#postgresql-extensions-hstore-ltree] and full-text search [http://peewee.readthedocs.org/en/latest/peewee/playhouse.html#full-text-search] For flask integration differences between apsw and pysqlite, check the apsw docs [http://apidoc.apsw.googlecode.com/hg/pysqlite.html]. Example usage from apsw_ext import * db = APSWDatabase(':memory:') class BaseModel(Model): information, see the documentation on virtual tables [http://apidoc.apsw.googlecode.com/hg/vtable.html]. Parameters: mod_name (string) – name to use for module mod_inst (object) – an object implementing0 码力 | 101 页 | 163.20 KB | 1 年前3peewee Documentation Release 3.5.0
their meaning and accepted values can be found in the SQLite documentation: http://sqlite.org/pragma.html User-defined functions SQLite can be extended with user-defined Python code. The SqliteDatabase True) post = get_object_or_404(public_posts, (Post.slug == slug)) return render_template('post_detail.html', post=post) 1.11. Playhouse, extensions to Peewee 231 peewee Documentation, Release 3.5.0 obj where(Post.published == True) .order_by(Post.timestamp.desc())) return object_list( 'post_index.html', query=public_posts, context_variable='post_list', paginate_by=10) The template will have the following0 码力 | 282 页 | 1.02 MB | 1 年前3peewee Documentation Release 3.6.0
their meaning and accepted values can be found in the SQLite documentation: http://sqlite.org/pragma.html Recommended Settings The following settings are what I use with SQLite for a typical web application True) post = get_object_or_404(public_posts, (Post.slug == slug)) return render_template('post_detail.html', post=post) object_list(template_name, query[, context_variable=’object_list’[, paginate_by=20[ where(Post.published == True) .order_by(Post.timestamp.desc())) return object_list( 'post_index.html', query=public_posts, context_variable='post_list', paginate_by=10) The template will have the following0 码力 | 302 页 | 1.02 MB | 1 年前3peewee Documentation Release 2.10.2
True) post = get_object_or_404(public_posts, (Post.slug == slug)) return render_template('post_detail.html', post=post) object_list(template_name, query[, context_variable=’object_list’[, paginate_by=20[ where(Post.published == True) .order_by(Post.timestamp.desc())) return object_list( 'post_index.html', query=public_posts, context_variable='post_list', paginate_by=10) The template will have the following0 码力 | 221 页 | 844.06 KB | 1 年前3
共 14 条
- 1
- 2