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/p/y/pyke-HEAD/examples/web_framework/TurboGears2/tg2movie/model/__init__.py   pyke(Download)
 
# Bruce added:
from sqlalchemy import Column, MetaData, Table, types
from sqlalchemy.orm import mapper
 
    #    autoload=True, autoload_with=engine)
    global t_movie, t_catalog, t_director, t_genre, t_movie_director_link
    t_catalog = Table("catalog", metadata, autoload=True,
autoload_with=engine)
    t_director = Table("director", metadata, autoload=True,
autoload_with=engine)
    t_genre = Table("genre", metadata, autoload=True, autoload_with=engine)
    t_movie = Table("movie", metadata, autoload=True, autoload_with=engine)

src/i/n/input-lib-HEAD/packages/sqlalchemy/examples/association/proxied_association.py   input-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),

src/s/q/sqlalchemy-HEAD/examples/association/basic_association.py   sqlalchemy(Download)
from datetime import datetime
 
from sqlalchemy import (create_engine, MetaData, Table, Column, Integer,
    String, DateTime, Numeric, ForeignKey, and_)
from sqlalchemy.orm import mapper, relation, 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/s/q/sqlalchemy-HEAD/examples/association/proxied_association.py   sqlalchemy(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/k/i/kitsune-HEAD/vendor/packages/Werkzeug/examples/simplewiki/database.py   kitsune(Download)
"""
from datetime import datetime
from sqlalchemy import Table, Column, Integer, String, DateTime, \
     ForeignKey, MetaData, join
from sqlalchemy.orm import relation, create_session, scoped_session
 
# our database tables.
page_table = Table('pages', metadata,
    Column('page_id', Integer, primary_key=True),
    Column('name', String(60), unique=True)
)
 
revision_table = Table('revisions', metadata,

src/l/u/LuoYunCloud-HEAD/lyweb/lib/SQLAlchemy-0.8.2/examples/sharding/attribute_shard.py   LuoYunCloud(Download)
 
# step 1. imports
from sqlalchemy import (create_engine, MetaData, Table, Column, Integer,
    String, ForeignKey, Float, DateTime, event)
from sqlalchemy.orm import sessionmaker, mapper, relationship
# #1.  Any other method will do just as well; UUID, hilo, application-specific, etc.
 
ids = Table('ids', meta,
    Column('nextid', Integer, nullable=False))
 
# if you're willing to write more complex sharding functions.
 
weather_locations = Table("weather_locations", meta,
        Column('id', Integer, primary_key=True, default=id_generator),
        Column('continent', String(30), nullable=False),
        Column('city', String(50), nullable=False)
    )
 
weather_reports = Table("weather_reports", meta,

src/k/u/kuma-lib-HEAD/packages/Werkzeug/examples/simplewiki/database.py   kuma-lib(Download)
"""
from datetime import datetime
from sqlalchemy import Table, Column, Integer, String, DateTime, \
     ForeignKey, MetaData, join
from sqlalchemy.orm import relation, create_session, scoped_session
 
# our database tables.
page_table = Table('pages', metadata,
    Column('page_id', Integer, primary_key=True),
    Column('name', String(60), unique=True)
)
 
revision_table = Table('revisions', metadata,

src/k/i/kitsune-HEAD/vendor/packages/sqlalchemy/examples/vertical/dictlike.py   kitsune(Download)
 
if __name__ == '__main__':
    from sqlalchemy import (MetaData, Table, Column, Integer, Unicode,
        ForeignKey, UnicodeText, and_, not_)
    from sqlalchemy.orm import mapper, relationship, create_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/s/q/SQLAlchemy-0.9.4/examples/sharding/attribute_shard.py   SQLAlchemy(Download)
 
# step 1. imports
from sqlalchemy import (create_engine, MetaData, Table, Column, Integer,
    String, ForeignKey, Float, DateTime, event)
from sqlalchemy.orm import sessionmaker, mapper, relationship
# #1.  Any other method will do just as well; UUID, hilo, application-specific, etc.
 
ids = Table('ids', meta,
    Column('nextid', Integer, nullable=False))
 
# if you're willing to write more complex sharding functions.
 
weather_locations = Table("weather_locations", meta,
        Column('id', Integer, primary_key=True, default=id_generator),
        Column('continent', String(30), nullable=False),
        Column('city', String(50), nullable=False)
    )
 
weather_reports = Table("weather_reports", meta,

src/k/i/kitsune-HEAD/vendor/packages/sqlalchemy/examples/poly_assoc/poly_assoc_generic.py   kitsune(Download)
"""
 
from sqlalchemy import MetaData, Table, Column, Integer, String, \
    ForeignKey
from sqlalchemy.orm import mapper, relationship, sessionmaker, \
 
    metadata = table.metadata
    association_table = Table("%s_associations" % interface_name, metadata,
        Column('assoc_id', Integer, primary_key=True),
        Column('type', String(50), nullable=False)
# addresses table
 
addresses = Table("addresses", metadata,
    Column('id', Integer, primary_key=True),
    Column('assoc_id', Integer, ForeignKey('addresses_associations.assoc_id')),
# 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),

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