Did I find the right examples for you? yes no

All Samples(8067)  |  Call(6186)  |  Derive(1)  |  Import(1880)
Represent a table in a database.

e.g.::

    mytable = Table("mytable", metadata,
                    Column('mytable_id', Integer, primary_key=True),
                    Column('value', String(50))
               )

The :class:`.Table` object constructs a unique instance of itself based(more...)

src/s/q/sqlalchemy-HEAD/examples/poly_assoc/poly_assoc_fk.py   sqlalchemy(Download)
"""
 
from sqlalchemy import MetaData, Table, Column, Integer, String, ForeignKey
from sqlalchemy.orm import mapper, relation, create_session, class_mapper
 
# addresses table, class, 'addressable interface'.
 
addresses = Table("addresses", metadata,
    Column('id', Integer, primary_key=True),
    Column('assoc_id', None, ForeignKey('address_associations.assoc_id')),
 
## association table
address_associations = Table("address_associations", metadata,
    Column('assoc_id', Integer, primary_key=True),
    Column('type', String(50), nullable=False)
# sample # 1, users
 
users = Table("users", metadata,
    Column('id', Integer, primary_key=True),
    Column('name', String(50), nullable=False),
# sample # 2, orders
 
orders = Table("orders", metadata,
    Column('id', Integer, primary_key=True),
    Column('description', String(50), nullable=False),

src/i/n/input-lib-HEAD/packages/sqlalchemy/examples/inheritance/polymorph.py   input-lib(Download)
from sqlalchemy import MetaData, Table, Column, Integer, String, ForeignKey
from sqlalchemy.orm import mapper, relationship, create_session
import sets
 
# this example illustrates a polymorphic load of two classes
 
# a table to store companies
companies = Table('companies', metadata, 
   Column('company_id', Integer, primary_key=True),
   Column('name', String(50)))
 
# we will define an inheritance relationship between the table "people" and "engineers",
# and a second inheritance relationship between the table "people" and "managers"
people = Table('people', metadata, 
   Column('type', String(30)))
 
engineers = Table('engineers', metadata, 
   Column('person_id', Integer, ForeignKey('people.person_id'), primary_key=True),
   Column('status', String(30)),
   Column('engineer_name', String(50)),
   Column('primary_language', String(50)),
  )
 
managers = Table('managers', metadata, 

src/l/u/LuoYunCloud-HEAD/lyweb/lib/SQLAlchemy-0.8.2/examples/vertical/dictlike.py   LuoYunCloud(Download)
 
if __name__ == '__main__':
    from sqlalchemy import (MetaData, Table, Column, Integer, Unicode,
        ForeignKey, UnicodeText, and_, not_, create_engine)
    from sqlalchemy.orm import mapper, relationship, Session
 
    # Here we have named animals, and a collection of facts about them.
    animals = Table('animal', metadata,
                    Column('id', Integer, primary_key=True),
                    Column('name', Unicode(100)))
 
    facts = Table('facts', metadata,

src/k/i/kitsune-HEAD/vendor/packages/sqlalchemy/examples/association/basic_association.py   kitsune(Download)
from datetime import datetime
 
from sqlalchemy import (create_engine, MetaData, Table, Column, Integer,
    String, DateTime, Numeric, ForeignKey, and_)
from sqlalchemy.orm import mapper, relationship, create_session
metadata = MetaData(engine)
 
orders = Table('orders', metadata, 
    Column('order_id', Integer, primary_key=True),
    Column('customer_name', String(30), nullable=False),
    Column('order_date', DateTime, nullable=False, default=datetime.now()),
    )
 
items = Table('items', metadata,
    )
 
orderitems = Table('orderitems', metadata,
    Column('order_id', Integer, ForeignKey('orders.order_id'),
           primary_key=True),

src/k/i/kitsune-HEAD/vendor/packages/sqlalchemy/examples/association/proxied_association.py   kitsune(Download)
"""this is a modified version of the basic association example, which illustrates
the usage of the associationproxy extension."""
 
from datetime import datetime
from sqlalchemy import (create_engine, MetaData, Table, Column, Integer,
metadata = MetaData(engine)
 
orders = Table('orders', metadata,
    Column('order_id', Integer, primary_key=True),
    Column('customer_name', String(30), nullable=False),
    Column('order_date', DateTime, nullable=False, default=datetime.now))
 
items = Table('items', metadata,
    Column('price', Float, nullable=False))
 
orderitems = Table('orderitems', metadata,
    Column('order_id', Integer, ForeignKey('orders.order_id'),
           primary_key=True),

src/s/q/sqlalchemy-HEAD/examples/inheritance/polymorph.py   sqlalchemy(Download)
from sqlalchemy import MetaData, Table, Column, Integer, String, ForeignKey
from sqlalchemy.orm import mapper, relation, create_session
import sets
 
# this example illustrates a polymorphic load of two classes
 
# a table to store companies
companies = Table('companies', metadata, 
   Column('company_id', Integer, primary_key=True),
   Column('name', String(50)))
 
# we will define an inheritance relationship between the table "people" and "engineers",
# and a second inheritance relationship between the table "people" and "managers"
people = Table('people', metadata, 
   Column('type', String(30)))
 
engineers = Table('engineers', metadata, 
   Column('person_id', Integer, ForeignKey('people.person_id'), primary_key=True),
   Column('status', String(30)),
   Column('engineer_name', String(50)),
   Column('primary_language', String(50)),
  )
 
managers = Table('managers', metadata, 

src/k/u/kuma-lib-HEAD/packages/sqlalchemy/examples/association/basic_association.py   kuma-lib(Download)
from datetime import datetime
 
from sqlalchemy import (create_engine, MetaData, Table, Column, Integer,
    String, DateTime, Numeric, ForeignKey, and_)
from sqlalchemy.orm import mapper, relationship, create_session
metadata = MetaData(engine)
 
orders = Table('orders', metadata, 
    Column('order_id', Integer, primary_key=True),
    Column('customer_name', String(30), nullable=False),
    Column('order_date', DateTime, nullable=False, default=datetime.now()),
    )
 
items = Table('items', metadata,
    )
 
orderitems = Table('orderitems', metadata,
    Column('order_id', Integer, ForeignKey('orders.order_id'),
           primary_key=True),

src/i/n/input-lib-HEAD/packages/sqlalchemy/examples/association/basic_association.py   input-lib(Download)
from datetime import datetime
 
from sqlalchemy import (create_engine, MetaData, Table, Column, Integer,
    String, DateTime, Numeric, ForeignKey, and_)
from sqlalchemy.orm import mapper, relationship, create_session
metadata = MetaData(engine)
 
orders = Table('orders', metadata, 
    Column('order_id', Integer, primary_key=True),
    Column('customer_name', String(30), nullable=False),
    Column('order_date', DateTime, nullable=False, default=datetime.now()),
    )
 
items = Table('items', metadata,
    )
 
orderitems = Table('orderitems', metadata,
    Column('order_id', Integer, ForeignKey('orders.order_id'),
           primary_key=True),

src/m/a/manila-HEAD/manila/db/sqlalchemy/migrate_repo/versions/001_manila_init.py   manila(Download)
from oslo.config import cfg
from sqlalchemy import Boolean, Column, DateTime, ForeignKey
from sqlalchemy import Integer, MetaData, String, Table, UniqueConstraint
 
 
 
    migrations = Table(
        'migrations', meta,
        Column('created_at', DateTime),
        Column('updated_at', DateTime),
 
    services = Table(
        'services', meta,
        Column('created_at', DateTime),
        Column('updated_at', DateTime),
 
    quotas = Table(
        'quotas', meta,
        Column('id', Integer, primary_key=True, nullable=False),
        Column('created_at', DateTime),
 
    quota_classes = Table(
        'quota_classes', meta,
        Column('created_at', DateTime(timezone=False)),
        Column('updated_at', DateTime(timezone=False)),

src/k/u/kuma-lib-HEAD/packages/sqlalchemy/examples/association/proxied_association.py   kuma-lib(Download)
"""this is a modified version of the basic association example, which illustrates
the usage of the associationproxy extension."""
 
from datetime import datetime
from sqlalchemy import (create_engine, MetaData, Table, Column, Integer,
metadata = MetaData(engine)
 
orders = Table('orders', metadata,
    Column('order_id', Integer, primary_key=True),
    Column('customer_name', String(30), nullable=False),
    Column('order_date', DateTime, nullable=False, default=datetime.now))
 
items = Table('items', metadata,
    Column('price', Float, nullable=False))
 
orderitems = Table('orderitems', metadata,
    Column('order_id', Integer, ForeignKey('orders.order_id'),
           primary_key=True),

Previous  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10  Next