peewee Documentation Release 1.0.0Support for paginating lists of results is implemented in a simple function called object_list (after it’s corollary in Django). This function is used by all the views that return lists of objects. def ob render_template(template_name, **kwargs) Simple authentication system with a login_required decorator. The first function simply adds user data into the current session when a user successfully logs in. The decorator login_required python operators to query You can use python operators to construct queries. This is possible by overloading operators on field instances. Comparing the three methods of querying Examples shown are “default”0 码力 | 101 页 | 163.20 KB | 1 年前3
peewee Documentation
Release 1.0.0Support for paginating lists of results is implemented in a simple function called object_list (after it’s corollary in Django). This function is used by all the views that return lists of objects. def ob Documentation, Release 1.0.0 • Simple authentication system with a login_required decorator. The first function simply adds user data into the current session when a user successfully logs in. The decorator login_required python operators to query You can use python operators to construct queries. This is possible by overloading operators on field instances. Comparing the three methods of querying Examples shown are “default”0 码力 | 71 页 | 405.29 KB | 1 年前3
peewee Documentation
Release 2.0.2actually is a wrapper – whatever appears to the right of the dot (i.e. fn.*Lower*) – is treated as a function that can take any arbitrary parameters. If you’re feeling froggy and want to get coding, you might 1)) == ’a’) The “where” clause now contains a tree with one leaf. The leaf represents the nested function expression on the left- hand-side and the scalar value ‘a’ on the right hand side. Peewee will recursively where(Employee.salary < (Employee.tenure * 1000) + 40000) Note: I totally went crazy with operator overloading. If you’re interested in looking, the QueryCompiler.parse_expr method is where the bulk of the0 码力 | 65 页 | 315.33 KB | 1 年前3
peewee Documentation Release 3.0.0Person returned by the original SELECT! We can avoid this by performing a JOIN and using a SQL function to aggregate the results. query = (Person .select(Person, fn.COUNT(Pet.id).alias('pet_count')) * Fido # Grandma L. # Herb # * Mittens Jr SQL Functions One last query. This will use a SQL function to find all people whose names start with either an upper or lower-case G: expression = fn.Lower(fn operation and can be done quickly using the interactive interpreter. We can create a small helper function to accomplish this: def create_tables(): with database: database.create_tables([User0 码力 | 319 页 | 361.50 KB | 1 年前3
peewee Documentation
Release 3.5.0Person returned by the original SELECT! We can avoid this by performing a JOIN and using a SQL function to aggregate the results. query = (Person .select(Person, fn.COUNT(Pet.id).alias('pet_count')) * Fido # Grandma L. # Herb # * Mittens Jr SQL Functions One last query. This will use a SQL function to find all people whose names start with either an upper or lower-case G: expression = fn.Lower(fn operation and can be done quickly using the interactive interpreter. We can create a small helper function to accomplish this: def create_tables(): with database: database.create_tables([User0 码力 | 347 页 | 380.80 KB | 1 年前3
peewee Documentation
Release 3.5.0every Person returned by the original SELECT! We can avoid this by performing a JOIN and using a SQL function to aggregate the results. query = (Person .select(Person, fn.COUNT(Pet.id).alias('pet_count')) # * Fido # Grandma L. # Herb # * Mittens Jr SQL Functions One last query. This will use a SQL function to find all people whose names start with either an upper or lower-case G: expression = fn.Lower(fn operation and can be done quickly using the interactive interpreter. We can create a small helper function to accomplish this: def create_tables(): with database: database.create_tables([User, Relationship0 码力 | 282 页 | 1.02 MB | 1 年前3
peewee Documentation Release 3.4.0Person returned by the original SELECT! We can avoid this by performing a JOIN and using a SQL function to aggregate the results. query = (Person .select(Person, fn.COUNT(Pet.id).alias('pet_count')) * Fido # Grandma L. # Herb # * Mittens Jr SQL Functions One last query. This will use a SQL function to find all people whose names start with either an upper or lower-case G: expression = fn.Lower(fn operation and can be done quickly using the interactive interpreter. We can create a small helper function to accomplish this: def create_tables(): with database: database.create_tables([User0 码力 | 349 页 | 382.34 KB | 1 年前3
peewee Documentation
Release 3.4.0every Person returned by the original SELECT! We can avoid this by performing a JOIN and using a SQL function to aggregate the results. query = (Person .select(Person, fn.COUNT(Pet.id).alias('pet_count')) # * Fido # Grandma L. # Herb # * Mittens Jr SQL Functions One last query. This will use a SQL function to find all people whose names start with either an upper or lower-case G: expression = fn.Lower(fn operation and can be done quickly using the interactive interpreter. We can create a small helper function to accomplish this: def create_tables(): with database: database.create_tables([User, Relationship0 码力 | 284 页 | 1.03 MB | 1 年前3
peewee Documentation
Release 3.3.0every Person returned by the original SELECT! We can avoid this by performing a JOIN and using a SQL function to aggregate the results. query = (Person .select(Person, fn.COUNT(Pet.id).alias('pet_count')) # * Fido # Grandma L. # Herb # * Mittens Jr SQL Functions One last query. This will use a SQL function to find all people whose names start with either an upper or lower-case G: expression = fn.Lower(fn operation and can be done quickly using the interactive interpreter. We can create a small helper function to accomplish this: def create_tables(): with database: database.create_tables([User, Relationship0 码力 | 280 页 | 1.02 MB | 1 年前3
peewee Documentation Release 3.1.0Person returned by the original SELECT! We can avoid this by performing a JOIN and using a SQL function to aggregate the results. query = (Person .select(Person, fn.COUNT(Pet.id).alias('pet_count')) * Fido # Grandma L. # Herb # * Mittens Jr SQL Functions One last query. This will use a SQL function to find all people whose names start with either an upper or lower-case G: expression = fn.Lower(fn operation and can be done quickly using the interactive interpreter. We can create a small helper function to accomplish this: def create_tables(): with database: database.create_tables([User0 码力 | 332 页 | 370.77 KB | 1 年前3
共 16 条
- 1
- 2













