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/i/n/input-lib-HEAD/packages/sqlalchemy/examples/elementtree/adjacency_list.py   input-lib(Download)
 
################################# PART I - Imports/Coniguration ####################################
from sqlalchemy import (MetaData, Table, Column, Integer, String, ForeignKey,
    Unicode, and_)
from sqlalchemy.orm import mapper, relationship, create_session, lazyload
 
# stores a top level record of an XML document.
documents = Table('documents', meta,
    Column('document_id', Integer, primary_key=True),
    Column('filename', String(30), unique=True),
# stores XML nodes in an adjacency list model.  This corresponds to
# Element and SubElement objects.
elements = Table('elements', meta,
    Column('element_id', Integer, primary_key=True),
    Column('parent_id', Integer, ForeignKey('elements.element_id')),
# stores attributes.  This corresponds to the dictionary of attributes
# stored by an Element or SubElement.
attributes = Table('attributes', meta,
    Column('element_id', Integer, ForeignKey('elements.element_id'), primary_key=True),
    Column('name', Unicode(100), nullable=False, primary_key=True),

src/h/x/HXLator-SpaceAppsVersion-HEAD/submodules/werkzeug/examples/plnt/database.py   HXLator-SpaceAppsVersion(Download)
    :license: BSD.
"""
from sqlalchemy import MetaData, Table, Column, ForeignKey, Boolean, \
     Integer, String, DateTime
from sqlalchemy.orm import dynamic_loader, scoped_session, create_session, \
 
 
blog_table = Table('blogs', metadata,
    Column('id', Integer, primary_key=True),
    Column('name', String(120)),
)
 
entry_table = Table('entries', metadata,
    Column('id', Integer, primary_key=True),
    Column('blog_id', Integer, ForeignKey('blogs.id')),

src/b/r/brunch-flask-gae-skeleton-HEAD/submodules/werkzeug/examples/plnt/database.py   brunch-flask-gae-skeleton(Download)
    :license: BSD.
"""
from sqlalchemy import MetaData, Table, Column, ForeignKey, Boolean, \
     Integer, String, DateTime
from sqlalchemy.orm import dynamic_loader, scoped_session, create_session, \
 
 
blog_table = Table('blogs', metadata,
    Column('id', Integer, primary_key=True),
    Column('name', String(120)),
)
 
entry_table = Table('entries', metadata,
    Column('id', Integer, primary_key=True),
    Column('blog_id', Integer, ForeignKey('blogs.id')),

src/k/u/kuma-lib-HEAD/packages/sqlalchemy/examples/inheritance/polymorph.py   kuma-lib(Download)
from sqlalchemy import MetaData, Table, Column, Integer, String, \
    ForeignKey, create_engine
from sqlalchemy.orm import mapper, relationship, sessionmaker
 
 
 
# 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),
  )
 
managers = Table('managers', metadata, 
   Column('person_id', Integer, ForeignKey('people.person_id'), 
                                    primary_key=True),

src/k/u/kuma-lib-HEAD/packages/sqlalchemy/examples/poly_assoc/poly_assoc_fk.py   kuma-lib(Download)
"""
 
from sqlalchemy import MetaData, Table, Column, Integer, String, \
    ForeignKey
from sqlalchemy.orm import mapper, relationship, sessionmaker, \
# 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/poly_assoc/poly_assoc_fk.py   input-lib(Download)
"""
 
from sqlalchemy import MetaData, Table, Column, Integer, String, ForeignKey
from sqlalchemy.orm import mapper, relationship, 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/s/q/sqlalchemy-HEAD/examples/elementtree/adjacency_list.py   sqlalchemy(Download)
 
################################# PART I - Imports/Coniguration ###########################################
from sqlalchemy import (MetaData, Table, Column, Integer, String, ForeignKey,
    Unicode, and_)
from sqlalchemy.orm import mapper, relation, create_session, lazyload
 
# stores a top level record of an XML document.  
documents = Table('documents', meta,
    Column('document_id', Integer, primary_key=True),
    Column('filename', String(30), unique=True),
# stores XML nodes in an adjacency list model.  This corresponds to 
# Element and SubElement objects.
elements = Table('elements', meta,
    Column('element_id', Integer, primary_key=True),
    Column('parent_id', Integer, ForeignKey('elements.element_id')),
# stores attributes.  This corresponds to the dictionary of attributes
# stored by an Element or SubElement.
attributes = Table('attributes', meta,
    Column('element_id', Integer, ForeignKey('elements.element_id'), primary_key=True),
    Column('name', Unicode(100), nullable=False, primary_key=True),

src/w/e/Werkzeug-0.9.4/examples/plnt/database.py   Werkzeug(Download)
    :license: BSD.
"""
from sqlalchemy import MetaData, Table, Column, ForeignKey, Boolean, \
     Integer, String, DateTime
from sqlalchemy.orm import dynamic_loader, scoped_session, create_session, \
 
 
blog_table = Table('blogs', metadata,
    Column('id', Integer, primary_key=True),
    Column('name', String(120)),
)
 
entry_table = Table('entries', metadata,
    Column('id', Integer, primary_key=True),
    Column('blog_id', Integer, ForeignKey('blogs.id')),

src/c/e/ceilometer-HEAD/ceilometer/storage/sqlalchemy/migrate_repo/versions/007_add_alarm_table.py   ceilometer(Download)
# under the License.
 
from sqlalchemy import MetaData, Table, Column, Text
from sqlalchemy import Boolean, Integer, String, DateTime, Float
 
 
def upgrade(migrate_engine):
    meta = MetaData(bind=migrate_engine)
    alarm = Table(
        'alarm', meta,
def downgrade(migrate_engine):
    meta = MetaData(bind=migrate_engine)
    alarm = Table('alarm', meta, autoload=True)
    alarm.drop()
 

src/w/e/werkzeug-HEAD/examples/plnt/database.py   werkzeug(Download)
    :license: BSD.
"""
from sqlalchemy import MetaData, Table, Column, ForeignKey, Boolean, \
     Integer, String, DateTime
from sqlalchemy.orm import dynamic_loader, scoped_session, create_session, \
 
 
blog_table = Table('blogs', metadata,
    Column('id', Integer, primary_key=True),
    Column('name', String(120)),
)
 
entry_table = Table('entries', metadata,
    Column('id', Integer, primary_key=True),
    Column('blog_id', Integer, ForeignKey('blogs.id')),

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