From: Mike Bayer Date: Sun, 5 Feb 2006 23:45:26 +0000 (+0000) Subject: added between(), column.label() X-Git-Tag: rel_0_1_0~49 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9d3c5ce66eeb57270e2b268e8f188275e57a167b;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git added between(), column.label() --- diff --git a/doc/build/content/sqlconstruction.myt b/doc/build/content/sqlconstruction.myt index 1b2df02fe4..c386705062 100644 --- a/doc/build/content/sqlconstruction.myt +++ b/doc/build/content/sqlconstruction.myt @@ -117,7 +117,7 @@ WHERE users.user_id = addresses.address_id {} -

If you want to use a different label, you can also try using an alias:

+

The table name part of the label is affected if you use a construct such as a table alias:

<&|formatting.myt:code&> person = users.alias('person') @@ -134,6 +134,16 @@ person.password AS person_password, addresses.address_id AS addresses_address_id WHERE person.user_id = addresses.address_id +

You can also specify custom labels on a per-column basis using the label() function: + <&|formatting.myt:code&> + <&formatting.myt:poplink&>c = select([users.c.user_id.label('id'), users.c.user_name.label('name')]).execute() +<&|formatting.myt:codepopper, link="sql" &> +SELECT users.user_id AS id, users.user_name AS name +FROM users +{} + + + <&|doclib.myt:item, name="columns", description="Table/Column Specification" &> @@ -276,7 +286,7 @@ FROM users WHERE users.user_name = :users_user_name AND users.user_id = :users_u <&|doclib.myt:item, name="operators", description="Operators" &> -

Supported column operators so far are all the numerical comparison operators, i.e. '==', '>', '>=', etc., as well as like(), startswith(), endswith(), and in(). Boolean operators include not_(), and_() and or_(), which also can be used inline via '~', '&', and '|'. Math operators are '+', '-', '*', '/'. Any custom operator can be specified via the op() function shown below.

+

Supported column operators so far are all the numerical comparison operators, i.e. '==', '>', '>=', etc., as well as like(), startswith(), endswith(), between(), and in(). Boolean operators include not_(), and_() and or_(), which also can be used inline via '~', '&', and '|'. Math operators are '+', '-', '*', '/'. Any custom operator can be specified via the op() function shown below.

<&|formatting.myt:code &> # "like" operator users.select(users.c.user_name.like('%ter'))