peewee Documentation Release 1.0.0
support for special extensions like hstore [http://peewee.readthedocs.org/en/latest/peewee/playhouse.html#postgresql-extensions-hstore-ltree] and full-text search [http://peewee.readthedocs.org/en/latest/peewee/playhouse 1.2. index next | previous | peewee 1.0.0 documentation » Overview peewee is a lightweight ORM [http://en.wikipedia.org/wiki/Object-relational_mapping] written in python. Examples: # a simple query peewee 1.0.0 documentation » Example app peewee ships with an example web app that runs on the Flask [http://flask.pocoo.org/] microframework. If you already have flask and its dependencies installed you should0 码力 | 101 页 | 163.20 KB | 1 年前3peewee Documentation Release 2.10.2
hesitate to open an issue [https://github.com/coleifer/peewee/issues?state=open] on GitHub or contact me [http://charlesleifer.com/contact/]. Indices and tables Index Module Index Search Page Installing and 0-compatible drivers out there, such as pymysql or psycopg2 for MySQL and Postgres respectively. Cython [http://cython.org/]: used for various speedups. Can give a big boost to certain operations, particularly and much, much saner semantics than the standard library pysqlite. Use with APSWDatabase. pycrypto [http://pythonhosted.org/pycrypto/] is used for the AESEncryptedField. bcrypt module is used for the PasswordField0 码力 | 275 页 | 276.96 KB | 1 年前3peewee Documentation Release 3.5.0
hesitate to open an issue [https://github.com/coleifer/peewee/issues?state=open] on GitHub or contact me [http://charlesleifer.com/contact/]. Indices and tables Index Module Index Search Page Installing and 0-compatible drivers out there, such as pymysql or psycopg2 for MySQL and Postgres respectively. Cython [http://cython.org/]: used for various speedups. Can give a big boost to certain operations, particularly pysqlite. Use with APSWDatabase. gevent [http://www.gevent.org/] is an optional dependency for SqliteQueueDatabase (though it works with threading just fine). BerkeleyDB [http://www.oracle.com/technetwork/database/database-0 码力 | 347 页 | 380.80 KB | 1 年前3peewee Documentation Release 3.4.0
hesitate to open an issue [https://github.com/coleifer/peewee/issues?state=open] on GitHub or contact me [http://charlesleifer.com/contact/]. Indices and tables Index Module Index Search Page Installing and 0-compatible drivers out there, such as pymysql or psycopg2 for MySQL and Postgres respectively. Cython [http://cython.org/]: used for various speedups. Can give a big boost to certain operations, particularly pysqlite. Use with APSWDatabase. gevent [http://www.gevent.org/] is an optional dependency for SqliteQueueDatabase (though it works with threading just fine). BerkeleyDB [http://www.oracle.com/technetwork/database/database-0 码力 | 349 页 | 382.34 KB | 1 年前3peewee Documentation Release 3.6.0
hesitate to open an issue [https://github.com/coleifer/peewee/issues?state=open] on GitHub or contact me [http://charlesleifer.com/contact/]. Indices and tables Index Module Index Search Page Installing and 0-compatible drivers out there, such as pymysql or psycopg2 for MySQL and Postgres respectively. Cython [http://cython.org/]: used for various speedups. Can give a big boost to certain operations, particularly APIs. Use with APSWDatabase. gevent [http://www.gevent.org/] is an optional dependency for SqliteQueueDatabase (though it works with threading just fine). BerkeleyDB [http://www.oracle.com/technetwork/database/database-0 码力 | 377 页 | 399.12 KB | 1 年前3peewee Documentation Release 3.0.0
hesitate to open an issue [https://github.com/coleifer/peewee/issues?state=open] on GitHub or contact me [http://charlesleifer.com/contact/]. Indices and tables Index Module Index Search Page Installing and 0-compatible drivers out there, such as pymysql or psycopg2 for MySQL and Postgres respectively. Cython [http://cython.org/]: used for various speedups. Can give a big boost to certain operations, particularly provides the same functionality. gevent [http://www.gevent.org/] is an optional dependency for SqliteQueueDatabase (though it works with threading just fine). BerkeleyDB [http://www.oracle.com/technetwork/database/database-0 码力 | 319 页 | 361.50 KB | 1 年前3peewee Documentation Release 2.0.2
then, any subclasses will automatically # use the correct storage. for more information, see: # http://charlesleifer.com/docs/peewee/peewee/models.html#model-api-smells-like-django class BaseModel(Model): == self) & (Relationship.to_user == user) ).count() > 0 def gravatar_url(self, size=80): return ’http://www.gravatar.com/avatar/%s?d=identicon&s=%d’ % \ (md5(self.email.strip().lower().encode(’utf-8’)) Release 2.0.0 >>> user = User.create(username=’charlie’) >>> tweet = Tweet.create( ... message=’http://www.youtube.com/watch?v=xdhLQCYQ-nQ’, ... user=user ... ) >>> tweet.user.username ’charlie’0 码力 | 65 页 | 315.33 KB | 1 年前3peewee Documentation Release 3.1.0
hesitate to open an issue [https://github.com/coleifer/peewee/issues?state=open] on GitHub or contact me [http://charlesleifer.com/contact/]. Indices and tables Index Module Index Search Page Installing and 0-compatible drivers out there, such as pymysql or psycopg2 for MySQL and Postgres respectively. Cython [http://cython.org/]: used for various speedups. Can give a big boost to certain operations, particularly provides the same functionality. gevent [http://www.gevent.org/] is an optional dependency for SqliteQueueDatabase (though it works with threading just fine). BerkeleyDB [http://www.oracle.com/technetwork/database/database-0 码力 | 332 页 | 370.77 KB | 1 年前3peewee Documentation Release 2.10.2
and execute the run_example.py script: python run_example.py The example app will be accessible at http://localhost:5000/ 10 Chapter 1. Contents: peewee Documentation, Release 2.10.2 1.3.2 Diving into is delivered: database = SqliteDatabase('my_app.db') def before_request_handler(): database.connect() def after_request_handler(): database.close() Note: For examples of configuring connection hooks processors. db = SqliteDatabase('my_webpy_app.db') def connection_processor(handler): db.connect() try: return handler() finally: if not db.is_closed(): db.close() app.add_processor(connection_processor)0 码力 | 221 页 | 844.06 KB | 1 年前3peewee Documentation Release 1.0.0
select().where( from_user=self, to_user=user ).count() > 0 def gravatar_url(self, size=80): return ’http://www.gravatar.com/avatar/%s?d=identicon&s=%d’ % \ (md5(self.email.strip().lower().encode(’utf-8’)) pictures of animals blog’) >>> entry = Entry.create( ... headline=’maru the kitty’, ... content=’http://www.youtube.com/watch?v=xdhLQCYQ-nQ’, ... pub_date=datetime.datetime.now(), ... blog=blog 1.5 post_save class MyModel(Model): data = IntegerField() @connect(post_save, sender=MyModel) def on_save_handler(model_class, instance, created): put_data_in_cache(instance.data) The following signals are provided:0 码力 | 71 页 | 405.29 KB | 1 年前3
共 16 条
- 1
- 2