peewee Documentation Release 2.10.2Non-integer Primary Keys, Composite Keys and other Tricks Self-referential foreign keys Circular foreign key dependencies Querying Creating a new record Bulk inserts Updating existing records Atomic updates backend Postgresql Extensions DataSet Django Integration Fields Generic foreign keys Hybrid Attributes Key/Value Store Shortcuts Signal support pwiz, a model generator Schema Migrations Reflection Database relationships between models using foreign keys (wikipedia) [http://en.wikipedia.org/wiki/Foreign_key]. This is easy to do with peewee: class Pet(Model): owner = ForeignKeyField(Person, related_name='pets')0 码力 | 275 页 | 276.96 KB | 1 年前3
peewee Documentation
Release 2.10.2our data. This will create the tables with the appropriate columns, indexes, sequences, and foreign key constraints: >>> db.create_tables([Person, Pet]) 1.2.2 Storing data Let’s begin by populating the Message model stores the text content of the tweet, when it was created, and who posted it (foreign key to User). If you like UML, these are the tables and relationships: In order to create these models ) # a dead simple one-to-many relationship: one user has 0..n messages, exposed by # the foreign key. because we didn't specify, a users messages will be accessible # as a special attribute, User.message_set0 码力 | 221 页 | 844.06 KB | 1 年前3
peewee Documentation Release 3.6.0Non-integer Primary Keys, Composite Keys and other Tricks Self-referential foreign keys Circular foreign key dependencies Querying Creating a new record Bulk inserts Updating existing records Atomic updates sqlite driver Sqlcipher backend Postgresql Extensions MySQL Extensions DataSet Fields Hybrid Attributes Key/Value Store Shortcuts Signal support pwiz, a model generator Schema Migrations Reflection Database having to worry. Things get interesting when we set up relationships between models using foreign key relationships. This is simple with peewee: class Pet(Model): owner = ForeignKeyField(Person, backref='pets')0 码力 | 377 页 | 399.12 KB | 1 年前3
peewee Documentation
Release 3.6.0having to worry. Things get interesting when we set up relationships between models using foreign key relationships. This is simple with peewee: class Pet(Model): owner = ForeignKeyField(Person, backref='pets') our data. This will create the tables with the appropriate columns, indexes, sequences, and foreign key constraints: db.create_tables([Person, Pet]) 1.2.2 Storing data Let’s begin by populating the database Message model stores the text content of the tweet, when it was created, and who posted it (foreign key to User). If you like UML, these are the tables and relationships: In order to create these models0 码力 | 302 页 | 1.02 MB | 1 年前3
peewee Documentation Release 3.0.0Non-integer Primary Keys, Composite Keys and other Tricks Self-referential foreign keys Circular foreign key dependencies Querying Creating a new record Bulk inserts Updating existing records Atomic updates relationships between models using foreign keys (wikipedia) [http://en.wikipedia.org/wiki/Foreign_key]. This is easy to do with peewee: class Pet(Model): owner = ForeignKeyField(Person, backref='pets') our data. This will create the tables with the appropriate columns, indexes, sequences, and foreign key constraints: db.create_tables([Person, Pet]) Storing data Let’s begin by populating the database0 码力 | 319 页 | 361.50 KB | 1 年前3
peewee Documentation Release 3.4.0Non-integer Primary Keys, Composite Keys and other Tricks Self-referential foreign keys Circular foreign key dependencies Querying Creating a new record Bulk inserts Updating existing records Atomic updates sqlite driver Sqlcipher backend Postgresql Extensions MySQL Extensions DataSet Fields Hybrid Attributes Key/Value Store Shortcuts Signal support pwiz, a model generator Schema Migrations Reflection Database relationships between models using foreign keys (wikipedia) [http://en.wikipedia.org/wiki/Foreign_key]. This is easy to do with peewee: class Pet(Model): owner = ForeignKeyField(Person, backref='pets')0 码力 | 349 页 | 382.34 KB | 1 年前3
peewee Documentation
Release 3.4.0our data. This will create the tables with the appropriate columns, indexes, sequences, and foreign key constraints: db.create_tables([Person, Pet]) 1.2.2 Storing data Let’s begin by populating the database Message model stores the text content of the tweet, when it was created, and who posted it (foreign key to User). If you like UML, these are the tables and relationships: 12 Chapter 1. Contents: peewee ) # a dead simple one-to-many relationship: one user has 0..n messages, exposed by # the foreign key. because we didn't specify, a users messages will be accessible # as a special attribute, User.messages0 码力 | 284 页 | 1.03 MB | 1 年前3
peewee Documentation
Release 3.3.0our data. This will create the tables with the appropriate columns, indexes, sequences, and foreign key constraints: db.create_tables([Person, Pet]) 1.2.2 Storing data Let’s begin by populating the database Message model stores the text content of the tweet, when it was created, and who posted it (foreign key to User). If you like UML, these are the tables and relationships: 12 Chapter 1. Contents: peewee ) # a dead simple one-to-many relationship: one user has 0..n messages, exposed by # the foreign key. because we didn't specify, a users messages will be accessible # as a special attribute, User.messages0 码力 | 280 页 | 1.02 MB | 1 年前3
peewee Documentation
Release 3.5.0Non-integer Primary Keys, Composite Keys and other Tricks Self-referential foreign keys Circular foreign key dependencies Querying Creating a new record Bulk inserts Updating existing records Atomic updates sqlite driver Sqlcipher backend Postgresql Extensions MySQL Extensions DataSet Fields Hybrid Attributes Key/Value Store Shortcuts Signal support pwiz, a model generator Schema Migrations Reflection Database relationships between models using foreign keys (wikipedia) [http://en.wikipedia.org/wiki/Foreign_key]. This is easy to do with peewee: class Pet(Model): owner = ForeignKeyField(Person, backref='pets')0 码力 | 347 页 | 380.80 KB | 1 年前3
peewee Documentation
Release 3.5.0our data. This will create the tables with the appropriate columns, indexes, sequences, and foreign key constraints: db.create_tables([Person, Pet]) 1.2.2 Storing data Let’s begin by populating the database Message model stores the text content of the tweet, when it was created, and who posted it (foreign key to User). If you like UML, these are the tables and relationships: 12 Chapter 1. Contents: peewee ) # a dead simple one-to-many relationship: one user has 0..n messages, exposed by # the foreign key. because we didn't specify, a users messages will be accessible # as a special attribute, User.messages0 码力 | 282 页 | 1.02 MB | 1 年前3
共 537 条
- 1
- 2
- 3
- 4
- 5
- 6
- 54













