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/optimized_al.py   input-lib(Download)
 
################################# PART I - Imports/Configuration ###########################################
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,
# 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/s/q/sqlalchemy-HEAD/examples/elementtree/optimized_al.py   sqlalchemy(Download)
 
################################# PART I - Imports/Configuration ###########################################
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,
# 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/k/i/kitsune-HEAD/vendor/packages/sqlalchemy/examples/poly_assoc/poly_assoc.py   kitsune(Download)
"""
 
from sqlalchemy import MetaData, Table, Column, Integer, String, and_
from sqlalchemy.orm import mapper, relationship, sessionmaker, \
    class_mapper, backref
# addresses table, class, 'addressable interface'.
 
addresses = Table("addresses", metadata,
    Column('id', Integer, primary_key=True),
    Column('addressable_id', Integer),
# 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/k/u/kuma-lib-HEAD/packages/sqlalchemy/examples/poly_assoc/poly_assoc.py   kuma-lib(Download)
"""
 
from sqlalchemy import MetaData, Table, Column, Integer, String, and_
from sqlalchemy.orm import mapper, relationship, sessionmaker, \
    class_mapper, backref
# addresses table, class, 'addressable interface'.
 
addresses = Table("addresses", metadata,
    Column('id', Integer, primary_key=True),
    Column('addressable_id', Integer),
# 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.py   input-lib(Download)
"""
 
from sqlalchemy import MetaData, Table, Column, Integer, String, and_
from sqlalchemy.orm import (mapper, relationship, create_session, class_mapper,
    backref)
# addresses table, class, 'addressable interface'.
 
addresses = Table("addresses", metadata,
    Column('id', Integer, primary_key=True),
    Column('addressable_id', Integer),
# 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/k/i/kitsune-HEAD/vendor/packages/sqlalchemy/examples/elementtree/adjacency_list.py   kitsune(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/k/i/kitsune-HEAD/vendor/packages/sqlalchemy/examples/inheritance/polymorph.py   kitsune(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/s/q/sqlalchemy-HEAD/examples/poly_assoc/poly_assoc.py   sqlalchemy(Download)
"""
 
from sqlalchemy import MetaData, Table, Column, Integer, String, and_
from sqlalchemy.orm import (mapper, relation, create_session, class_mapper,
    backref)
# addresses table, class, 'addressable interface'.
 
addresses = Table("addresses", metadata,
    Column('id', Integer, primary_key=True),
    Column('addressable_id', Integer),
# 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/k/i/kitsune-HEAD/vendor/packages/sqlalchemy/examples/poly_assoc/poly_assoc_fk.py   kitsune(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/k/u/kuma-lib-HEAD/packages/sqlalchemy/examples/elementtree/adjacency_list.py   kuma-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),

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