I saw some links in the SQLAlchemy Documentation for the .c. attribute .c. (see the following examples). Where the SQLAlchemy documentation describes this .c. attribute .c. ? (for example, on what objects is this attribute available?)
.c.
Link examples:
Select.apply_labels()
Select.c
c
>>> for u, count in session.query(User, stmt.c.address_count).\
... outerjoin(stmt, User.id==stmt.c.user_id).order_by(User.id):
... print u, count
mapper(User, user, properties={
'addresses' : relationship(Address, backref='user', order_by=address.c.id)
})
Table
address.c.id
Address
Address.id
class User(Base):
__table__ = user_table
id = user_table.c.user_id
name = user_table.c.user_name
included_parts
incl_alias
c is an alias for the columns attribute, and it is available for Select Expressions, Tables, Table Expressions and From Clause Expressions objects Select Expressions, Tables, Table Expressions and From Clause Expressions and possibly other classes.
columns
Select Expressions, Tables, Table Expressions and From Clause Expressions
c or columns is a collection of all available columns. An example of the c attribute described in the docs:
cinherited from c-attribute FromClauseAlias ββfor the columns attribute.
The following sqlalchemy documentation search shows all classes with c or columns as an attribute, including several that I did not know about before:
http://docs.sqlalchemy.org/en/rel_0_9/search.html?q=.columns&check_keywords=yes&area=default#
What I found really cool was that you can turn a simple TextClause object into a TextAsFrom object
http://docs.sqlalchemy.org/en/rel_0_9/core/sqlelement.html?highlight=.columns#sqlalchemy.sql.expression.TextClause.columns