peewee Documentation Release 3.6.0
otherwise) Integers, floats, and Decimal numbers. Boolean values Dates, times and datetimes None (NULL) Binary data Creating tables In order to start using the models, its necessary to create the tables initialization arguments Parameters accepted by all field types and their default values: null = False – allow null values index = False – create an index on this column unique = False – create a unique index for fields when objects are created. For example to have an IntegerField default to zero rather than NULL, you could declare the field with a default value: class Message(Model): context = TextField()0 码力 | 377 页 | 399.12 KB | 1 年前3peewee Documentation Release 3.6.0
• Integers, floats, and Decimal numbers. • Boolean values • Dates, times and datetimes • None (NULL) • Binary data Creating tables In order to start using the models, its necessary to create the initialization arguments Parameters accepted by all field types and their default values: • null = False – allow null values • index = False – create an index on this column • unique = False – create a unique for fields when objects are created. For example to have an IntegerField default to zero rather than NULL, you could declare the field with a default value: class Message(Model): context = TextField() read_count0 码力 | 302 页 | 1.02 MB | 1 年前3peewee Documentation Release 2.10.2
otherwise) Integers, floats, and Decimal numbers. Boolean values Dates, times and datetimes None (NULL) Binary data Creating tables In order to start using the models, its necessary to create the tables migrator = SqliteMigrator(my_db) title_field = CharField(default='') status_field = IntegerField(null=True) with my_db.transaction(): migrate( migrator.add_column('some_table', 'title', title_field) arguments Parameters accepted by all field types and their default values: null = False – boolean indicating whether null values are allowed to be stored index = False – boolean indicating whether to0 码力 | 275 页 | 276.96 KB | 1 年前3peewee Documentation Release 2.10.2
• Integers, floats, and Decimal numbers. • Boolean values • Dates, times and datetimes • None (NULL) • Binary data Creating tables In order to start using the models, its necessary to create the migrator = SqliteMigrator(my_db) title_field = CharField(default='') status_field = IntegerField(null=True) with my_db.transaction(): migrate( migrator.add_column('some_table', 'title', title_field) arguments Parameters accepted by all field types and their default values: • null = False – boolean indicating whether null values are allowed to be stored • index = False – boolean indicating whether0 码力 | 221 页 | 844.06 KB | 1 年前3peewee Documentation Release 3.5.0
otherwise) Integers, floats, and Decimal numbers. Boolean values Dates, times and datetimes None (NULL) Binary data Creating tables In order to start using the models, its necessary to create the tables initialization arguments Parameters accepted by all field types and their default values: null = False – allow null values index = False – create an index on this column unique = False – create a unique index for fields when objects are created. For example to have an IntegerField default to zero rather than NULL, you could declare the field with a default value: class Message(Model): context = TextField()0 码力 | 347 页 | 380.80 KB | 1 年前3peewee Documentation Release 3.5.0
values 1.3. Example app 13 peewee Documentation, Release 3.5.0 • Dates, times and datetimes • None (NULL) • Binary data Creating tables In order to start using the models, its necessary to create the their default values: 44 Chapter 1. Contents: peewee Documentation, Release 3.5.0 • null = False – allow null values • index = False – create an index on this column • unique = False – create a unique for fields when objects are created. For example to have an IntegerField default to zero rather than NULL, you could declare the field with a default value: class Message(Model): context = TextField() read_count0 码力 | 282 页 | 1.02 MB | 1 年前3peewee Documentation Release 3.0.0
otherwise) Integers, floats, and Decimal numbers. Boolean values Dates, times and datetimes None (NULL) Binary data Creating tables In order to start using the models, its necessary to create the tables ForeignKeyField('self', backref='recommended', column_name='recommendedby', null=True) joindate = DateTimeField() class Meta: table_name = 'members' # Conveniently recommendedby IS NOT NULL GROUP BY recommendedby ORDER BY recommendedby query = (Member .select(Member.recommendedby, fn.COUNT(Member.memid)) .where(Member.recommendedby.is_null(False))0 码力 | 319 页 | 361.50 KB | 1 年前3peewee Documentation Release 3.4.0
otherwise) Integers, floats, and Decimal numbers. Boolean values Dates, times and datetimes None (NULL) Binary data Creating tables In order to start using the models, its necessary to create the tables ForeignKeyField('self', backref='recommended', column_name='recommendedby', null=True) joindate = DateTimeField() class Meta: table_name = 'members' # Conveniently recommendedby IS NOT NULL GROUP BY recommendedby ORDER BY recommendedby query = (Member .select(Member.recommendedby, fn.COUNT(Member.memid)) .where(Member.recommendedby.is_null(False))0 码力 | 349 页 | 382.34 KB | 1 年前3peewee Documentation Release 3.4.0
values 1.3. Example app 13 peewee Documentation, Release 3.4.0 • Dates, times and datetimes • None (NULL) • Binary data Creating tables In order to start using the models, its necessary to create the CharField() recommendedby = ForeignKeyField('self', backref='recommended', column_name='recommendedby', null=True) joindate = DateTimeField() class Meta: table_name = 'members' # Conveniently declare decimal recommendedby IS NOT NULL GROUP BY recommendedby ORDER BY recommendedby query = (Member .select(Member.recommendedby, fn.COUNT(Member.memid)) .where(Member.recommendedby.is_null(False)) .group_by(Member0 码力 | 284 页 | 1.03 MB | 1 年前3peewee Documentation Release 3.1.0
otherwise) Integers, floats, and Decimal numbers. Boolean values Dates, times and datetimes None (NULL) Binary data Creating tables In order to start using the models, its necessary to create the tables ForeignKeyField('self', backref='recommended', column_name='recommendedby', null=True) joindate = DateTimeField() class Meta: table_name = 'members' # Conveniently recommendedby IS NOT NULL GROUP BY recommendedby ORDER BY recommendedby query = (Member .select(Member.recommendedby, fn.COUNT(Member.memid)) .where(Member.recommendedby.is_null(False))0 码力 | 332 页 | 370.77 KB | 1 年前3
共 16 条
- 1
- 2