peewee Documentation Release 2.10.2
'sqlite:///default.db') class BaseModel(Model): class Meta: database = db Example database URLs: sqlite:///my_database.db will create a SqliteDatabase instance for the file my_database.db in the >>> PageView.select(fn.Count(fn.Distinct(PageView.url))).scalar() 100 # <-- there are 100 distinct URLs in the pageview table This example illustrates the use of the convert argument. When using a SQLite0 码力 | 275 页 | 276.96 KB | 1 年前3peewee Documentation Release 2.10.2
get('DATABASE') or 'sqlite:///default.db') class BaseModel(Model): class Meta: database = db Example database URLs: • sqlite:///my_database.db will create a SqliteDatabase instance for the file my_database.db in >>> PageView.select(fn.Count(fn.Distinct(PageView.url))).scalar() 100 # <-- there are 100 distinct URLs in the pageview table This example illustrates the use of the convert argument. When using a SQLite0 码力 | 221 页 | 844.06 KB | 1 年前3peewee Documentation Release 3.0.0
'sqlite:///default.db') class BaseModel(Model): class Meta: database = db Example database URLs: sqlite:///my_database.db will create a SqliteDatabase instance for the file my_database.db in the a library function (“hostname”): # Assume we have a model, Link, that contains lots of arbitrary URLs. # We want to discover the most common hosts that have been linked. query = (Link .select(fn0 码力 | 319 页 | 361.50 KB | 1 年前3peewee Documentation Release 3.5.0
'sqlite:///default.db') class BaseModel(Model): class Meta: database = db Example database URLs: sqlite:///my_database.db will create a SqliteDatabase instance for the file my_database.db in the a library function (“hostname”): # Assume we have a model, Link, that contains lots of arbitrary URLs. # We want to discover the most common hosts that have been linked. query = (Link .select(fn0 码力 | 347 页 | 380.80 KB | 1 年前3peewee Documentation Release 3.4.0
'sqlite:///default.db') class BaseModel(Model): class Meta: database = db Example database URLs: sqlite:///my_database.db will create a SqliteDatabase instance for the file my_database.db in the a library function (“hostname”): # Assume we have a model, Link, that contains lots of arbitrary URLs. # We want to discover the most common hosts that have been linked. query = (Link .select(fn0 码力 | 349 页 | 382.34 KB | 1 年前3peewee Documentation Release 3.1.0
'sqlite:///default.db') class BaseModel(Model): class Meta: database = db Example database URLs: sqlite:///my_database.db will create a SqliteDatabase instance for the file my_database.db in the a library function (“hostname”): # Assume we have a model, Link, that contains lots of arbitrary URLs. # We want to discover the most common hosts that have been linked. query = (Link .select(fn0 码力 | 332 页 | 370.77 KB | 1 年前3peewee Documentation Release 3.5.0
get('DATABASE') or 'sqlite:///default.db') class BaseModel(Model): class Meta: database = db Example database URLs: • sqlite:///my_database.db will create a SqliteDatabase instance for the file my_database.db in a library function (“hostname”): # Assume we have a model, Link, that contains lots of arbitrary URLs. # We want to discover the most common hosts that have been linked. query = (Link .select(fn.hostname(Link0 码力 | 282 页 | 1.02 MB | 1 年前3peewee Documentation Release 3.3.0
get('DATABASE') or 'sqlite:///default.db') class BaseModel(Model): class Meta: database = db Example database URLs: • sqlite:///my_database.db will create a SqliteDatabase instance for the file my_database.db in a library function (“hostname”): # Assume we have a model, Link, that contains lots of arbitrary URLs. # We want to discover the most common hosts that have been linked. (continues on next page) 1.160 码力 | 280 页 | 1.02 MB | 1 年前3peewee Documentation Release 3.4.0
get('DATABASE') or 'sqlite:///default.db') class BaseModel(Model): class Meta: database = db Example database URLs: • sqlite:///my_database.db will create a SqliteDatabase instance for the file my_database.db in a library function (“hostname”): # Assume we have a model, Link, that contains lots of arbitrary URLs. # We want to discover the most common hosts that have been linked. (continues on next page) 2080 码力 | 284 页 | 1.03 MB | 1 年前3peewee Documentation Release 3.6.0
'sqlite:///default.db') class BaseModel(Model): class Meta: database = db Example database URLs: sqlite:///my_database.db will create a SqliteDatabase instance for the file my_database.db in the a library function (“hostname”): # Assume we have a model, Link, that contains lots of arbitrary URLs. # We want to discover the most common hosts that have been linked. query = (Link .select(fn0 码力 | 377 页 | 399.12 KB | 1 年前3
共 11 条
- 1
- 2