peewee Documentation Release 3.6.0the "people.db" database. Note Note that we named our model Person instead of People. This is a convention you should follow – even though the table will contain multiple people, we always name the class Note When you call save(), the number of rows modified is returned. You can also add a person by calling the create() method, which returns a model instance: grandma = Person.create(name='Grandma', birthday=date(1935 was already open. To close a connection, use the Database.close() method: >>> db.close() True Calling close() on an already-closed connection will not result in an exception, but will return False:0 码力 | 377 页 | 399.12 KB | 1 年前3
peewee Documentation
Release 3.6.0the "people.db" database. Note: Note that we named our model Person instead of People. This is a convention you should follow – even though the table will contain multiple people, we always name the class Note: When you call save(), the number of rows modified is returned. You can also add a person by calling the create() method, which returns a model instance: grandma = Person.create(name='Grandma', birthday=date(1935 was already open. To close a connection, use the Database.close() method: >>> db.close() True Calling close() on an already-closed connection will not result in an exception, but will return False:0 码力 | 302 页 | 1.02 MB | 1 年前3
peewee Documentation Release 3.0.0the "people.db" database. Note Note that we named our model Person instead of People. This is a convention you should follow – even though the table will contain multiple people, we always name the class Note When you call save(), the number of rows modified is returned. You can also add a person by calling the create() method, which returns a model instance: grandma = Person.create(name='Grandma', birthday=date(1935 order_by(fn.SUM(Booking.slots).desc()) .limit(1)) # Retrieve multiple scalar values by calling scalar() with as_tuple=True. facid, nslots = query.scalar(as_tuple=True) List the total slots booked0 码力 | 319 页 | 361.50 KB | 1 年前3
peewee Documentation Release 3.4.0the "people.db" database. Note Note that we named our model Person instead of People. This is a convention you should follow – even though the table will contain multiple people, we always name the class Note When you call save(), the number of rows modified is returned. You can also add a person by calling the create() method, which returns a model instance: grandma = Person.create(name='Grandma', birthday=date(1935 order_by(fn.SUM(Booking.slots).desc()) .limit(1)) # Retrieve multiple scalar values by calling scalar() with as_tuple=True. facid, nslots = query.scalar(as_tuple=True) List the total slots booked0 码力 | 349 页 | 382.34 KB | 1 年前3
peewee Documentation Release 3.1.0the "people.db" database. Note Note that we named our model Person instead of People. This is a convention you should follow – even though the table will contain multiple people, we always name the class Note When you call save(), the number of rows modified is returned. You can also add a person by calling the create() method, which returns a model instance: grandma = Person.create(name='Grandma', birthday=date(1935 order_by(fn.SUM(Booking.slots).desc()) .limit(1)) # Retrieve multiple scalar values by calling scalar() with as_tuple=True. facid, nslots = query.scalar(as_tuple=True) List the total slots booked0 码力 | 332 页 | 370.77 KB | 1 年前3
peewee Documentation
Release 3.3.0the "people.db" database. Note: Note that we named our model Person instead of People. This is a convention you should follow – even though the table will contain multiple people, we always name the class Note: When you call save(), the number of rows modified is returned. You can also add a person by calling the create() method, which returns a model instance: grandma = Person.create(name='Grandma', birthday=date(1935 facility) .order_by(fn.SUM(Booking.slots).desc()) .limit(1)) # Retrieve multiple scalar values by calling scalar() with as_tuple=True. facid, nslots = query.scalar(as_tuple=True) List the total slots booked0 码力 | 280 页 | 1.02 MB | 1 年前3
peewee Documentation
Release 3.4.0the "people.db" database. Note: Note that we named our model Person instead of People. This is a convention you should follow – even though the table will contain multiple people, we always name the class Note: When you call save(), the number of rows modified is returned. You can also add a person by calling the create() method, which returns a model instance: grandma = Person.create(name='Grandma', birthday=date(1935 facility) .order_by(fn.SUM(Booking.slots).desc()) .limit(1)) # Retrieve multiple scalar values by calling scalar() with as_tuple=True. facid, nslots = query.scalar(as_tuple=True) List the total slots booked0 码力 | 284 页 | 1.03 MB | 1 年前3
peewee Documentation
Release 3.5.0the "people.db" database. Note Note that we named our model Person instead of People. This is a convention you should follow – even though the table will contain multiple people, we always name the class Note When you call save(), the number of rows modified is returned. You can also add a person by calling the create() method, which returns a model instance: grandma = Person.create(name='Grandma', birthday=date(1935 was already open. To close a connection, use the Database.close() method: >>> db.close() True Calling close() on an already-closed connection will not result in an exception, but will return False:0 码力 | 347 页 | 380.80 KB | 1 年前3
peewee Documentation
Release 3.5.0the "people.db" database. Note: Note that we named our model Person instead of People. This is a convention you should follow – even though the table will contain multiple people, we always name the class Note: When you call save(), the number of rows modified is returned. You can also add a person by calling the create() method, which returns a model instance: grandma = Person.create(name='Grandma', birthday=date(1935 was already open. To close a connection, use the Database.close() method: >>> db.close() True Calling close() on an already-closed connection will not result in an exception, but will return False:0 码力 | 282 页 | 1.02 MB | 1 年前3
peewee Documentation Release 0.9.7documentation for details on this optimization. stats_query = Stat.select().naive() # note we are calling "naive()" stats_qr = stats_query.execute() for stat in stats_qr.iterator(): serializer.serialize_object(stat) database = db Model configuration is kept namespaced in a special class called Meta – this convention is borrowed from Django, which does the same thing. Meta configuration is passed on to subclasses model namespace, model-specific configuration is placed in a special class called Meta, which is a convention borrowed from the django framework: from peewee import * custom_db = SqliteDatabase('custom.db')0 码力 | 78 页 | 143.68 KB | 1 年前3
共 16 条
- 1
- 2













