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/k/u/kuma-lib-HEAD/packages/sqlalchemy/examples/vertical/dictlike.py   kuma-lib(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/i/n/input-lib-HEAD/packages/sqlalchemy/examples/vertical/dictlike.py   input-lib(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/k/u/kuma-lib-HEAD/packages/sqlalchemy/examples/poly_assoc/poly_assoc_generic.py   kuma-lib(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),

src/i/n/input-lib-HEAD/packages/sqlalchemy/examples/poly_assoc/poly_assoc_generic.py   input-lib(Download)
"""
 
from sqlalchemy import MetaData, Table, Column, Integer, String, ForeignKey
from sqlalchemy.orm import mapper, relationship, create_session, class_mapper
 
 
    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', None, 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),

src/s/q/sqlalchemy-HEAD/examples/vertical/dictlike.py   sqlalchemy(Download)
 
if __name__ == '__main__':
    from sqlalchemy import (MetaData, Table, Column, Integer, Unicode,
        ForeignKey, UnicodeText, and_, not_)
    from sqlalchemy.orm import mapper, relation, 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/n/e/neutron-drive-HEAD/google_appengine/lib/PyAMF/doc/tutorials/examples/actionscript/addressbook/python/persistent.py   neutron-drive(Download)
    def createSchema(self):
        metadata = sa.MetaData()
 
        metadata = sa.MetaData()
        self.users_table = sa.Table('users_table', metadata,
                                 server_default="2001-01-01 01:01:01"))
 
        self.phone_numbers_table = sa.Table('phone_numbers_table', metadata,
            sa.Column('id', sa.Integer, primary_key=True),
            sa.Column('user_id', sa.Integer, sa.ForeignKey('users_table.id')),
            sa.Column('label', sa.String(50)),
            sa.Column('number', sa.String(50)))
 
        self.emails_table = sa.Table('emails_table', metadata,

src/k/i/kitsune-HEAD/vendor/packages/sqlalchemy/examples/sharding/attribute_shard.py   kitsune(Download)
 
# step 1. imports
from sqlalchemy import (create_engine, MetaData, Table, Column, Integer,
    String, ForeignKey, Float, DateTime)
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/l/u/LuoYunCloud-HEAD/lyweb/lib/SQLAlchemy-0.8.2/examples/inheritance/concrete.py   LuoYunCloud(Download)
from sqlalchemy import create_engine, MetaData, Table, Column, Integer, \
    String
from sqlalchemy.orm import mapper, sessionmaker, polymorphic_union
 
metadata = MetaData()
 
managers_table = Table('managers', metadata,
)
 
engineers_table = Table('engineers', metadata,
    Column('employee_id', Integer, primary_key=True),
    Column('name', String(50)),

src/s/q/sqlalchemy-HEAD/examples/poly_assoc/poly_assoc_generic.py   sqlalchemy(Download)
"""
 
from sqlalchemy import MetaData, Table, Column, Integer, String, ForeignKey
from sqlalchemy.orm import mapper, relation, create_session, class_mapper
 
 
    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', None, 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),

src/m/m/mmc-HEAD/pulse2/services/mmc/plugins/glpi/database_07.py   mmc(Download)
from configobj import ConfigObj
 
from sqlalchemy import and_, create_engine, MetaData, Table, Column, String, \
        Integer, ForeignKey, asc, or_, not_, desc, func, distinct
from sqlalchemy.orm import create_session, mapper
                  'glpi_device_iface', 'glpi_device_moboard', 'glpi_device_pci', 'glpi_device_power', \
                  'glpi_device_processor', 'glpi_device_sndcard', 'glpi_config'):
            setattr(self, i, Table(i, self.metadata, autoload = True))
            j = self.getTableName(i) #''.join(map(lambda x:x.capitalize(), i.split('_')))
            exec "class %s(DbTOA): pass" % j
 
        # entity
        self.location = Table("glpi_entities", self.metadata, autoload = True)
        mapper(Location, self.location)
 
        # location
        self.locations = Table("glpi_dropdown_locations", self.metadata, autoload = True)
 
        # logs
        self.logs = Table("glpi_history", self.metadata,
            Column('FK_glpi_device', Integer, ForeignKey('glpi_computers.ID')),
            autoload = True)

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