diff --git a/.codeclimate.yml b/.codeclimate.yml deleted file mode 100755 index 6447d67..0000000 --- a/.codeclimate.yml +++ /dev/null @@ -1,3 +0,0 @@ -languages: - JavaScript: false - Python: true diff --git a/.coveragerc b/.coveragerc deleted file mode 100644 index 8741ccc..0000000 --- a/.coveragerc +++ /dev/null @@ -1,28 +0,0 @@ -[run] - -branch = True - -[report] - -exclude_lines = - pragma: no cover - def __repr__ - if self.debug: - raise NotImplementedError - if __name__ == .__main__.: - -ignore_errors = True - -include = - */carepoint/* - -omit = - */virtualenv/* - */tests/* - setup.py - */__init__.py - tests.py - -[xml] - -output = coverage.xml diff --git a/.gitignore b/.gitignore deleted file mode 100644 index cc25d4f..0000000 --- a/.gitignore +++ /dev/null @@ -1,65 +0,0 @@ -# Virtual Env -_venv/ - -# Byte-compiled / optimized / DLL files -__pycache__/ -*.py[cod] - -# C extensions -*.so - -# Distribution / packaging -.Python -env/ -bin/ -build/ -develop-eggs/ -dist/ -eggs/ -lib/ -lib64/ -parts/ -sdist/ -var/ -*.egg-info/ -.installed.cfg -*.egg -*.eggs - -# Installer logs -pip-log.txt -pip-delete-this-directory.txt - -# Unit test / coverage reports -htmlcov/ -.tox/ -.coverage -.cache -nosetests.xml -coverage.xml -_results/ - -# Translations -*.mo -*.pot - -# Pycharm -.idea - -# Django stuff: -*.log - -# Mr Developer -.mr.developer.cfg -.project -.pydevproject - -# Rope -.ropeproject - -# Sphinx documentation -docs/_build/ - -# Backup files -*~ -*.swp diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 0000000..e69de29 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index b3047a3..0000000 --- a/.travis.yml +++ /dev/null @@ -1,41 +0,0 @@ -addons: - apt: - packages: - - expect-dev # provides unbuffer utility - - unixodbc-dev - -language: python - -python: - - "2.7" - -virtualenv: - system_site_packages: true - -env: - global: - - VERSION="0.1.0" - - RELEASE="0.1.8" - - PROJECT="Python CarePoint" - - BRANCH_PROD="master" - - BRANCH_DOC="gh-pages" - - TESTS="0" - - LINT_CHECK="0" - - DOCS="0" - - PYPI="0" - - secure: "Agq7rh2FbYpV5u1WhpEcfjx/V9dwB04NwWhQMGviVeTQgwszgoHZ6XzDCIoWRwBmxOHBPFw2FIBf7/QwQAOJrnB0C9Ijza1t9LmsUWextOBNGnZTYuMdM0sUigPhQ5mVgHEs5sWRPf8JyRS4n2v0bzlrIA3PGvUU3LBipJ6CsmgQLfEb9Xy16KTCcneRBCUZHEc4sNNPOnLrXC+DhnKKBzFhdQKeQlDj1SOsvYsFDRIRe1Y2A2lgXgIYXO6mfdBz51G3AcRI3dZTQoOawtXHz00IOeNMkgv4AtaywlcDd4Io+Z0z0O+p6CJRW6DvJo4Ldi9lh2/nLbPcm+1Gqv4qAaIACCTI34mO+K3u/Yrh1baS+QfI9V03k5hmV2MtiEeSjA0TwDJj24Pmczesccn4iVrlcn+XFSDz8BDLRhp1RMjSP8YQ3+7W5UFpEuVpyPFwpYJsbVHfHDBL94zcyyhoitriI9DRV4IgqiQ59TGfINLBh8ssZtDuNhLPjEvDMMQwEdOyFnkakEA83eGebVyEXHCAREL8G/XKqr2WJV7UMHpDtc0DmVlwuH4ZBYKCA9L2+sYg9s5d2Z+tJrDucXwBan1W7ov9wqer8DotyxgC5eht8KVS2WuTjsgxErevVDV+PGn9Wnfwlqxw/Rih6CKdT+W1/rEVr3ufcTJrYD3jm6U=" - matrix: - - TESTS="1" - - PYPI="1" - - DOCS="1" - -install: - - git clone --depth=1 https://github.com/LasLabs/python-quality-tools.git ${HOME}/python-quality-tools - - export PATH=${HOME}/python-quality-tools/travis:${PATH} - - travis_install - -script: - - travis_run - -after_success: - - travis_after_success diff --git a/LICENSE.md b/LICENSE.md deleted file mode 100755 index f7b830e..0000000 --- a/LICENSE.md +++ /dev/null @@ -1,25 +0,0 @@ -The MIT License (MIT) -===================== - -Copyright `2015-TODAY` `LasLabs Inc.` - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the “Software”), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.rst b/README.rst deleted file mode 100755 index 21aa9fd..0000000 --- a/README.rst +++ /dev/null @@ -1,138 +0,0 @@ -| |Build Status| | |Coveralls Status| | |Codecov Status| | |Code Climate| - -Python CarePoint Library -======================== - -This library will allow you to interact with CarePoint using Python. - -| For the most part, it just provides some convenience wrappers to - encapsulate -| all of the tables within one object/session for easy use. - -Most of the methods return SQLAlchemy ResultProxies. - -Installation ------------- - -To install this module, you need to: - -- Utilize a system able to access all CarePoint network resources - (database, SMB) -- This includes things like DNS entries for the NETBIOS names -- Setup UnixODBC - http://help.interfaceware.com/kb/904 -- Install UnixODBC development headers - - ``apt-get install unixodbc-dev`` or ``yum install unixODBC-devel`` -- Install dependencies - ``pip install -r requirements.txt`` -- Install library - ``pip install .`` - -Setup ------ - -- Create an Active Directory user -- Give AD user permissions to CarePoint images and data net shares -- Give AD user read & write permissions on the following databases: -- cph -- grx\_master - -Usage ------ - -* `API Documentation `_ - -Connect to Database server -~~~~~~~~~~~~~~~~~~~~~~~~~~ - -:: - - from carepoint import Carepoint - - cp = Carepoint( - server='127.0.0.1', - user='test_db_user', - passwd='db_pass', - ) - -Perform a search for a patient with the last name Smith -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -:: - - res = cp.search( - cp['Patient'], - {'lname': 'Smith'}, - ) - for row in res: - print row.fname - -Perform a search for a patient with the last name Smith or Jones -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -:: - - res = cp.search( - cp['Patient'], - {'lname': ['Smith', 'Jones']}, - ) - for row in res: - print row.fname - -Perform a patient search, but only return the ``mname`` column -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -:: - - res = cp.search( - cp['Patient'], - {'lname': 'Smith'}, - ['mname'], - ) - for row in res: - print row.mname - -Get patients modified in 2015 -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -:: - - res = cp.search( - cp['Patient'], - { - 'chg_date': { - '<=': '2015-12-31', - '>=': '2015-01-01', - } - }, - ) - for row in res: - print row.fname - -Get image using SMB path from database -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -:: - - cp = Carepoint(**opts) - img_rec = cp.search(cp['FdbImg']).first() - image_file = cp.get_file(img_rec.IMAGE_PATH) - image_data = image_file.read() - -Known Issues / Road Map ------------------------ - -- More usage samples -- A decent amount of models are missing -- Create documentation of models -- Add some basic validations -- Create a column type that will retrieve file from SMB path in DB -- Better SMB support (allow ftimes, dir list, caching) -- FDB images only serve from store ID 1’s net share -- Having to pass the model to the Carepoint object is annoying, object - -.. |Build Status| image:: https://api.travis-ci.org/LasLabs/python-carepoint.svg?branch=release%2F0.1 - :target: https://travis-ci.org/LasLabs/python-carepoint -.. |Coveralls Status| image:: https://coveralls.io/repos/laslabs/Python-Carepoint/badge.svg?branch=release%2F0.1 - :target: https://coveralls.io/r/laslabs/Python-Carepoint?branch=release%2F0.1 -.. |Codecov Status| image:: https://codecov.io/gh/laslabs/Python-Carepoint/branch/release%2F0.1/graph/badge.svg - :target: https://codecov.io/gh/laslabs/Python-Carepoint -.. |Code Climate| image:: https://codeclimate.com/github/laslabs/Python-Carepoint/badges/gpa.svg - :target: https://codeclimate.com/github/laslabs/Python-Carepoint diff --git a/_modules/carepoint/db/carepoint.html b/_modules/carepoint/db/carepoint.html new file mode 100644 index 0000000..6dc0b2a --- /dev/null +++ b/_modules/carepoint/db/carepoint.html @@ -0,0 +1,613 @@ + + + + + + + carepoint.db.carepoint — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.db.carepoint

+# -*- coding: utf-8 -*-
+# Copyright 2016-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+import imp
+import operator
+import os
+import urllib2
+
+from contextlib import contextmanager
+
+from sqlalchemy import bindparam, or_
+from sqlalchemy.ext.declarative import declarative_base
+from sqlalchemy.inspection import inspect
+from sqlalchemy.orm import sessionmaker
+from sqlalchemy import text
+
+
+from .db import Db
+from smb.SMBHandler import SMBHandler
+
+
+Base = declarative_base()
+Base.get = lambda s, k, v=None: getattr(s, k, v)
+Base.__getitem__ = lambda s, k, v=None: getattr(s, k, v)
+Base.__setitem__ = lambda s, k, v: setattr(s, k, v)
+
+
+models, env, dbs = {}, {}, {}
+
+
+
[docs]class Carepoint(dict): + """ Base CarePoint db connector object """ + + BASE = Base + DEFAULT_DB = 'cph' + + # Default path to search for models - change with register_model_dir + model_path = os.path.join(os.path.dirname(__file__), '..', 'models') + + FILTERS = { + '>=': operator.ge, + '>': operator.gt, + '<=': operator.le, + '<': operator.lt, + '=': operator.eq, + '==': operator.eq, + } + + def __init__( + self, server, user, passwd, smb_user=None, smb_passwd=None, + db_args=None, **engine_args + ): + """ It initializes new Carepoint object + + Args: + server (str): IP or Hostname to database + user (str): Username for database + passwd (str): Password for database + smb_user (str): Username to use for SMB connection, ``None`` to + use the database user + smd_passwd (str): Password to use for the SMB connection, ``None`` + to use the database password + db_args (dict): Dictionary of arguments to send during initial + db creation + **engine_args (mixed): Kwargs to pass to ``create_engine`` + """ + + super(Carepoint, self).__init__() + global dbs + self.env = {} + self.dbs = dbs + self.iter_refresh = False + params = { + 'user': user, + 'passwd': passwd, + 'server': server, + 'db': 'cph', + } + if db_args is not None: + params.update(db_args) + if engine_args: + params.update(engine_args) + if smb_user is None: + self.smb_creds = { + 'user': user, + 'passwd': passwd, + } + else: + self.smb_creds = { + 'user': smb_user, + 'passwd': smb_passwd, + } + self.db_params = params + self._init_env(False) + + def _init_env(self, clear=False): + """ It initializes the global db and environments + + Params: + clear: (bool) True to clear the global session + """ + if clear: + self.dbs.clear() + # @TODO: Lazy load, once other dbs needed + if not self.dbs.get('cph'): + self.dbs['cph'] = Db(**self.db_params) + if not self.env.get('cph'): + self.env['cph'] = sessionmaker( + autocommit=False, + autoflush=False, + bind=self.dbs['cph'], + expire_on_commit=True, + ) + + def _get_model_session(self, model_obj): + """ It yields a session for the model_obj """ + return self._get_session(model_obj.__dbname__) + + @contextmanager + def _get_session(self, db_name): + session = self.env[db_name]() + try: + yield session + session.commit() + except: + session.rollback() + raise + finally: + session.close() + + @property + def _smb_prefix(self): + """ Return URI prefix for SMB share """ + return 'smb://{user}:{passwd}@'.format(**self.smb_creds) + +
[docs] def get_file(self, path): + """ Return a file-like object for the SMB path + + Args: + path: :type:`str` SMB path to fetch + + Returns: + :type:`file` File interface object representing remote resource + """ + opener = urllib2.build_opener(SMBHandler) + return opener.open('%s%s' % (self._smb_prefix, path))
+ +
[docs] def send_file(self, path, file_obj): + """ Send a file-like object to the SMB path + + Args: + path: :type:`str` SMB path to fetch + file_obj: :type:`file` File interface object to send to server + + Returns: + :type:`bool` Success + """ + with urllib2.build_opener(SMBHandler) as opener: + opener.open('%s%s' % (self._smb_prefix, path), data=file_obj) + return True
+ + def _create_criterion(self, model_obj, col_name, operator, query): + """ Create a SQLAlchemy criterion from filter parts + + Args: + model_obj: :class:`sqlalchemy.Table` Table class to search + col_name: :type:`str` Name of column to query + operator: :type:`str` Domain operator to use in query + query: :type:`str` Text to search for + + Returns: + SQLAlchemy criterion representing a single WHERE clause + + Raises: + NotImplementedError: When query operator is not implemented + AttributeError: When col_name does not exist in the model_obj + """ + + try: + col_obj = getattr(model_obj, col_name) + operator_obj = self.FILTERS[operator] + return operator_obj(col_obj, query) + + except KeyError: + raise + + except AttributeError: + raise + + def _unwrap_filters(self, model_obj, filters=None): + """ Unwrap a dictionary of filters into something usable by SQLAlchemy + :param model_obj: Table class to search + :type model_obj: :class:`sqlalchemy.Table` + :param filters: Filters, keyed by col name + :type filters: dict + :rtype: list + """ + + if filters is None: + filters = {} + + new_filters = [] + for col_name, col_filter in filters.items(): + + if isinstance(col_filter, dict): + for _operator, _filter in col_filter.items(): + new_filters.append(self._create_criterion( + model_obj, col_name, _operator, _filter + )) + + elif isinstance(col_filter, (list, tuple)): + query = [] + for _filter in col_filter: + query.append( + self._create_criterion( + model_obj, col_name, '==', _filter, + ), + ) + new_filters.append(or_(*query)) + + else: + new_filters.append(self._create_criterion( + model_obj, col_name, '==', col_filter + )) + + return new_filters + + def _create_entities(self, model_obj, cols): + """ Return list of entities matching cols + :param model_obj: Table class to search + :type model_obj: :class:`sqlalchemy.Table` + :param cols: List of col names + :type cols: list + :rtype: :type:`list` of :class:`sqlalchemy.Column` + """ + out = [] + for col in cols: + try: + out.append(getattr(model_obj, col)) + except AttributeError: + pass + return out + +
[docs] def read(self, model_obj, record_id, with_entities=None): + """ Get record by id and return the object + :param model_obj: Table class to search + :type model_obj: :class:`sqlalchemy.Table` + :param record_id: Id of record to manipulate + :param with_entities: Attributes to rcv from db. None for * + :type with_entities: list or None + :param with_entities: List of col names to select, None for all + :type with_entities: list or None + :rtype: :class:`sqlalchemy.engine.ResultProxy` + """ + with self._get_model_session(model_obj) as session: + res = session.query(model_obj).get(record_id) + if with_entities: + res.with_entities(*self._create_entities( + model_obj, with_entities + )) + return res
+ +
[docs] def search(self, model_obj, filters=None, with_entities=None): + """ Search table by filters and return records + :param model_obj: Table class to search + :type model_obj: :class:`sqlalchemy.schema.Table` + :param filters: Filters to apply to search + :type filters: dict or None + :param with_entities: List of col names to select, None for all + :type with_entities: list or None + :rtype: :class:`sqlalchemy.engine.ResultProxy` + """ + with self._get_model_session(model_obj) as session: + if filters is None: + filters = {} + filters = self._unwrap_filters(model_obj, filters) + res = session.query(model_obj).filter(*filters) + if with_entities: + res.with_entities(*self._create_entities( + model_obj, with_entities + )) + return res
+ +
[docs] def create(self, model_obj, vals): + """ Wrapper to create a record in Carepoint + :param model_obj: Table class to create with + :type model_obj: :class:`sqlalchemy.schema.Table` + :param vals: Data to create record with + :type vals: dict + :rtype: :class:`sqlalchemy.ext.declarative.Declarative` + """ + with self._get_model_session(model_obj) as session: + record = model_obj(**vals) + session.add(record) + return record
+ +
[docs] def update(self, model_obj, record_id, vals): + """ Wrapper to update a record in Carepoint + :param model_obj: Table class to update + :type model_obj: :class:`sqlalchemy.schema.Table` + :param record_id: Id of record to manipulate + :type record_id: int + :param vals: Data to create record with + :type vals: dict + :rtype: :class:`sqlalchemy.ext.declarative.Declarative` + """ + with self._get_model_session(model_obj): + record = self.read(model_obj, record_id) + for key, val in vals.items(): + setattr(record, key, val) + return record
+ +
[docs] def delete(self, model_obj, record_id): + """ Wrapper to delete a record in Carepoint + :param model_obj: Table class to update + :type model_obj: :class:`sqlalchemy.schema.Table` + :param record_id: Id of record to manipulate + :type record_id: int + :return: Whether the record was found, and deleted + :rtype: bool + """ + with self._get_model_session(model_obj) as session: + record = self.read(model_obj, record_id) + result_cnt = record.count() + if result_cnt == 0: + return False + assert result_cnt == 1 + session.delete(record) + return True
+ +
[docs] def get_pks(self, model_obj): + """ Return the Primary keys in the model + :param model_obj: Table class to update + :type model_obj: :class:`sqlalchemy.schema.Table` + :return: Tuple of primary key name strings + :rtype: tuple + """ + return tuple(k.name for k in inspect(model_obj).primary_key)
+ +
[docs] def get_next_sequence(self, sequence_name, db_name='cph'): + """ It generates and returns the next int in sequence + Params: + sequence_name: ``str`` Name of the sequence in Carepoint DB + db_name: ``str`` Name of DB containing sequence stored proc + Return: + Integer to use as pk + """ + with self._get_session(db_name) as session: + res = session.connection().execute( + text( + "SET NOCOUNT ON;" + "DECLARE @out int = 0;" + "EXEC CsGenerateIntId :seq_name, @out output;" + "SELECT @out;" + "SET NOCOUNT OFF;", + bindparams=[bindparam('seq_name')], + ), + seq_name=sequence_name, + ) + id_int = res.fetchall()[0][0] + return id_int
+ + def __getattr__(self, key): + """ Re-implement __getattr__ to use __getitem__ if attr not found """ + try: + return super(Carepoint, self).__getattr__(key) + except AttributeError: + try: + self.__getitem__(key) + except KeyError: + raise AttributeError() + + def __setitem__(self, key, val, __global=False, *args, **kwargs): + """ Re-implement __setitem__ to allow for global model sync """ + super(Carepoint, self).__setitem__(key, val, *args, **kwargs) + if not __global: + global models + models[key] = val + + def __getitem__(self, key, retry=True, default=False): + """ Re-implement __getitem__ to scan for models if key missing """ + global models + for k, v in models.iteritems(): + self.__setitem__(k, v, True) + try: + return super(Carepoint, self).__getitem__(key) + except KeyError: + if default is not False: + return default + elif retry: + self.find_models() + return self.__getitem__(key, False) + else: + raise KeyError( + 'Plugin "%s" not found in model_dir "%s"' % ( + key, self.model_path + ) + ) + +
[docs] def set_iter_refresh(self, refresh=True): + """ Toggle flag to search for new models before iteration + :param refresh: Whether to refresh before iteration + :type refresh: bool + """ + self.iter_refresh = refresh
+ + def __refresh_models__(self): + if self.iter_refresh: + self.find_models() + + def __iter__(self): + """ Reimplement __iter__ to allow for optional model refresh """ + self.__refresh_models__() + return super(Carepoint, self).__iter__() + +
[docs] def values(self): + """ Reimplement values to allow for optional model refresh """ + self.__refresh_models__() + return super(Carepoint, self).values()
+ +
[docs] def keys(self): + """ Reimplement keys to allow for optional model refresh """ + self.__refresh_models__() + return super(Carepoint, self).keys()
+ +
[docs] def items(self): + """ Reimplement items to allow for optional model refresh """ + self.__refresh_models__() + return super(Carepoint, self).items()
+ +
[docs] def itervalues(self): + """ Reimplement itervalues to allow for optional model refresh """ + self.__refresh_models__() + return super(Carepoint, self).itervalues()
+ +
[docs] def iterkeys(self): + """ Reimplement iterkeys to allow for optional model refresh """ + self.__refresh_models__() + return super(Carepoint, self).iterkeys()
+ +
[docs] def iteritems(self): + """ Reimplement iteritems to allow for optional model refresh """ + self.__refresh_models__() + return super(Carepoint, self).iteritems()
+ +
[docs] def register_model(self, model_obj): + """ Registration logic + append to models struct + :param model_obj: Model object to register + :type model_obj: :class:`sqlalchemy.ext.declarative.Declarative` + """ + self[model_obj.__name__] = model_obj
+ +
[docs] def register_model_dir(self, model_path): + """ This function sets the model path to be searched + :param model_path: Path of models + :type model_path: str + """ + if os.path.isdir(model_path): + self.model_path = model_path + else: + raise EnvironmentError('%s is not a directory' % model_path)
+ +
[docs] def find_models(self, model_path=None): + """ Traverse registered model directory and import non-loaded modules + """ + + if model_path is None: + model_path = self.model_path + + if model_path is not None and not os.path.isdir(model_path): + raise EnvironmentError('%s is not a directory' % model_path) + + for dir_name, subdirs, files in os.walk(model_path): + + if dir_name.startswith('__'): + continue + dir_name = os.path.abspath(dir_name) + parent_module = dir_name.replace(model_path, '') + parent_module = parent_module.replace(os.path.sep, '.') + + for file_ in files: + if file_.endswith('.py') and file_ != '__init__.py': + module = file_[:-3] + mod_obj = globals().get(module) + if mod_obj is None: + f, filename, desc = imp.find_module( + module, [dir_name] + ) + mod_obj = imp.load_module( + module, f, filename, desc + ) + cls = [ + m for m in dir(mod_obj) if not m.startswith('__') + ] + for model_cls in cls: + model_obj = getattr(mod_obj, model_cls) + if hasattr(model_obj, '__tablename__'): + if not hasattr(model_obj, '__dbname__'): + model_obj.__dbname__ = self.DEFAULT_DB + self.register_model(model_obj)
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/db/db.html b/_modules/carepoint/db/db.html new file mode 100644 index 0000000..65239f8 --- /dev/null +++ b/_modules/carepoint/db/db.html @@ -0,0 +1,159 @@ + + + + + + + carepoint.db.db — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.db.db

+# -*- coding: utf-8 -*-
+# Copyright 2016-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+from sqlalchemy import create_engine
+from urllib import quote_plus as urlquote
+
+
+
[docs]class Db(object): + ''' Base db connector object ''' + + ODBC_DRIVER = 'FreeTDS&TDS_VERSION=8.0' + SQLITE = 'sqlite' + + def __new__( + self, server=None, user=None, passwd=None, db=None, port=1433, + drv=ODBC_DRIVER, **engine_args + ): + """ It establishes a new database connection and returns engine + + Args: + server (str): IP or Hostname to database + user (str): Username for database + passwd (str): Password for database + db (str): Name of database + port (int): Connection port + drv (str): Name of underlying database driver for connection + **engine_args (mixed): Kwargs to pass to ``create_engine`` + + Return: + sqlalchemy.engine.Engine + """ + + if drv != self.SQLITE: + params = { + 'usr': urlquote(user), + 'pass': urlquote(passwd), + 'srv': server, + 'drv': drv, + 'db': db, + 'prt': port, + } + dsn = 'mssql+pyodbc://{usr}:{pass}@{srv}:{prt}/{db}?driver={drv}' + return create_engine(dsn.format(**params), **engine_args) + + else: + return create_engine('%s://' % self.SQLITE, **engine_args)
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/models/address_mixin.html b/_modules/carepoint/models/address_mixin.html new file mode 100644 index 0000000..7f3c372 --- /dev/null +++ b/_modules/carepoint/models/address_mixin.html @@ -0,0 +1,158 @@ + + + + + + + carepoint.models.address_mixin — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.models.address_mixin

+# -*- coding: utf-8 -*-
+# Copyright 2016 LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+import enum
+
+from sqlalchemy import (Column,
+                        Integer,
+                        DateTime,
+                        ForeignKey,
+                        )
+from sqlalchemy.types import Enum
+from sqlalchemy.ext.declarative import declared_attr
+
+
+
[docs]class EnumAddressType(enum.Enum): + """ It provides PEP-0435 compliant Carepoint Address Type Enumerable """ + + business = 1 + home = 2 + school = 3 + vacation = 4 + other = 5 + billing = 6 + shipping = 7
+ + +
[docs]class AddressMixin(object): + """ This is a mixin for Address Many2Many bindings """ + + priority = Column(Integer) + addr_type_cn = Column(Integer) + app_flags = Column(Integer) + timestmp = Column(DateTime) + + @declared_attr + def addr_id(cls): + return Column( + Integer, + ForeignKey('csaddr.addr_id'), + primary_key=True, + ) + + @property + def addr_type(self): + return EnumAddressType(self.addr_type_cn)
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/models/cph/account.html b/_modules/carepoint/models/cph/account.html new file mode 100644 index 0000000..76575c7 --- /dev/null +++ b/_modules/carepoint/models/cph/account.html @@ -0,0 +1,139 @@ + + + + + + + carepoint.models.cph.account — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.models.cph.account

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+from carepoint import Carepoint
+from sqlalchemy import (Column,
+                        Integer,
+                        ForeignKey,
+                        )
+
+
+
[docs]class Account(Carepoint.BASE): + __tablename__ = 'cp_acct' + __dbname__ = 'cph' + + pat_id = Column( + Integer, + ForeignKey('cppat.pat_id'), + primary_key=True, + ) + ID = Column( + Integer, + primary_key=True, + ) + acct_type_cn = Column(Integer) + resp_pty_yn = Column(Integer) + chromis_id = Column(Integer)
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/models/cph/account_activity.html b/_modules/carepoint/models/cph/account_activity.html new file mode 100644 index 0000000..9f2aeb6 --- /dev/null +++ b/_modules/carepoint/models/cph/account_activity.html @@ -0,0 +1,189 @@ + + + + + + + carepoint.models.cph.account_activity — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.models.cph.account_activity

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+from carepoint import Carepoint
+from sqlalchemy import (Column,
+                        Integer,
+                        Numeric,
+                        ForeignKey,
+                        DateTime,
+                        String,
+                        )
+
+
+
[docs]class AccountActivity(Carepoint.BASE): + __tablename__ = 'CsSArActivity' + __dbname__ = 'cph' + + id = Column( + Integer, + primary_key=True, + autoincrement=False, + ) + acct_id = Column( + Integer, + ForeignKey('cp_acct.ID'), + ) + order_id = Column( + Integer, + ForeignKey('CsOm.order_id'), + ) + pat_id = Column( + Integer, + ForeignKey('cppat.pat_id'), + ) + rxdisp_id = Column( + Integer, + ForeignKey('cprx_disp.rxdisp_id'), + ) + org_id = Column( + Integer, + ForeignKey('csorg.org_id'), + ) + orig_org_id = Column( + Integer, + ForeignKey('csorg.org_id'), + ) + item_id = Column( + Integer, + ForeignKey('item.item_id'), + ) + descr = Column(String) + refno = Column(String) + ct_id = Column(Integer) + code_num = Column(Integer) + amt = Column(Numeric) + reason_cn = Column(Integer) + rpt_cat = Column(Integer) + qty = Column(Numeric) + tax = Column(Numeric) + nonrx_order_line_id = Column(Integer) + store_id = Column( + Integer, + ForeignKey('csstore.store_id'), + ) + batch_id = Column(Integer) + batch_no = Column(String) + add_user_id = Column( + Integer, + ForeignKey('csuser.user_id'), + ) + add_date = Column(DateTime) + chg_user_id = Column( + Integer, + ForeignKey('csuser.user_id'), + ) + chg_date = Column(DateTime)
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/models/cph/address.html b/_modules/carepoint/models/cph/address.html new file mode 100644 index 0000000..57bb6b1 --- /dev/null +++ b/_modules/carepoint/models/cph/address.html @@ -0,0 +1,164 @@ + + + + + + + carepoint.models.cph.address — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.models.cph.address

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+from carepoint import Carepoint
+from sqlalchemy import (Column,
+                        Integer,
+                        String,
+                        DateTime,
+                        Boolean,
+                        ForeignKey,
+                        )
+
+
+
[docs]class Address(Carepoint.BASE): + __tablename__ = 'csaddr' + __dbname__ = 'cph' + + addr_id = Column( + Integer, + primary_key=True, + autoincrement=False, + ) + parent_addr_id = Column( + Integer, + ForeignKey('csaddr.addr_id'), + ) + inherited_yn = Column(Boolean) + owner_type_cn = Column(Integer) + alt_name = Column(String) + addr1 = Column(String) + addr2 = Column(String) + addr3 = Column(String) + city = Column(String) + state_cd = Column(String) + zip = Column(String) + zip_plus4 = Column(String) + country_cd = Column(String) + mailing_yn = Column(Boolean) + anote = Column(String) + app_flags = Column(Integer) + timestmp = Column(DateTime) + add_user_id = Column( + Integer, + ForeignKey('csuser.user_id'), + ) + add_date = Column(DateTime) + chg_user_id = Column( + Integer, + ForeignKey('csuser.user_id'), + ) + chg_date = Column(DateTime)
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/models/cph/dispense.html b/_modules/carepoint/models/cph/dispense.html new file mode 100644 index 0000000..e7d6fe3 --- /dev/null +++ b/_modules/carepoint/models/cph/dispense.html @@ -0,0 +1,258 @@ + + + + + + + carepoint.models.cph.dispense — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.models.cph.dispense

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+from carepoint import Carepoint
+from sqlalchemy import (Column,
+                        Integer,
+                        String,
+                        DateTime,
+                        ForeignKey,
+                        Numeric,
+                        Text,
+                        SmallInteger)
+
+
+
[docs]class Dispense(Carepoint.BASE): + __tablename__ = 'cprx_disp' + __dbname__ = 'cph' + + rxdisp_id = Column( + Integer, + primary_key=True, + autoincrement=False, + ) + rx_id = Column( + Integer, + ForeignKey('cprx.rx_id'), + ) + store_id = Column( + Integer, + ForeignKey('csstore.store_id'), + ) + disp_ndc = Column(String) + disp_drug_name = Column(String) + prod_expire_date = Column(DateTime) + mfg = Column(String) + orig_mfg = Column(String) + pkg_size = Column(Numeric) + fill_no = Column(Integer) + dispense_date = Column(DateTime) + dispense_qty = Column(Numeric) + disp_days_supply = Column(Numeric) + sig_text = Column(String) + sched_of_admin_cn = Column(Integer) + freq_of_admin = Column(Numeric) + units_per_dose = Column(Numeric) + lot_number = Column(String) + disp_awp = Column(Numeric) + disp_aac = Column(Numeric) + disp_mac = Column(Numeric) + disp_ful = Column(Numeric) + disp_udef = Column(Numeric) + tech_initials = Column(String) + rph_initials = Column(String) + cnsl_initials = Column(String) + icd9 = Column(String) + daw_disp_cn = Column(Integer) + level_of_service = Column(Integer) + cmt = Column(Text) + status_cn = Column(Integer) + alt_pick_up_id = Column(Integer) + alt_pick_up_cn = Column(Integer) + clarification_fill = Column(Integer) + trip_no = Column(Integer) + gpi_disp = Column(Integer) + label_3pty_yn = Column(Integer) + reject_3pty_yn = Column(Integer) + pay_type_cn = Column(Integer) + price_differs_yn = Column(Integer) + pat_loc_cn = Column(Integer) + billing_units = Column(String) + price_table_id = Column(Integer) + app_flags = Column(Integer) + timestmp = Column(DateTime) + price_meth_cn = Column(Integer) + uu = Column(String) + p_tbl_override_yn = Column(Integer) + label_id = Column(Integer) + billing_hold = Column(Integer) + post_bal_yn = Column(Integer) + inv_no = Column(String) + disp_qty_delta = Column(Numeric) + brand_med_nec_yn = Column(Integer) + Other_coverage_cd = Column(Integer) + epsdt_yn = Column(Integer) + exempt_cd = Column(Integer) + num_labels = Column(Integer) + location = Column(String) + qty_override = Column(Numeric) + dur_summary = Column(Text) + cov_overrides = Column(Integer) + use_secondary_ins_yn = Column(Integer) + hp_blnRxExtr = Column(SmallInteger) + item_id = Column(Integer) + ud_override = Column(String) + disp_status_cn = Column(Integer) + order_id = Column(Integer) + sig_id = Column(Integer) + counsel_yn = Column(Integer) + processing_date = Column(DateTime) + hcpcs_mod_cn = Column(Integer) + acct_id = Column(Integer) + track_pat_resp_yn = Column(Integer) + track_org_resp_yn = Column(Integer) + label_fac_id = Column(Integer) + extern_process_cn = Column(Integer) + price_ovr_user_id = Column(Integer) + price_ovr_reason_cn = Column(Integer) + wf_status_cn = Column(Integer) + verify_user_id = Column(Integer) + verify_timestamp = Column(DateTime) + ar_hold = Column(Integer) + disp_type_cn = Column(Integer) + own_use_pricing_yn = Column(Integer) + pos_processed_yn = Column(Integer) + prescriber_cn = Column(Integer) + visit_nbr = Column(String) + disp_udef = Column(Integer) + SecondaryICD9 = Column(String) + uandc_pricing_used_yn = Column(Integer) + special_pkg_ind_cn = Column(Integer) + delay_reason_cn = Column(Integer) + place_of_service_cn = Column(Integer) + pat_residence_cn = Column(Integer) + compound_type_cn = Column(Integer) + pharmacy_service_type_cn = Column(Integer) + admin_start_date = Column(DateTime) + ClariFill_2 = Column(Integer) + ClariFill_3 = Column(Integer) + other_coverage_cd_2 = Column(Integer) + pat_assign_ind_yn = Column(Integer) + prov_assign_ind_yn = Column(Integer) + route_of_admin_ovr = Column(String) + csr_pickup_id = Column(Integer) + icd10 = Column(String) + secondaryicd10 = Column(String) + add_user_id = Column( + Integer, + ForeignKey('csuser.user_id'), + ) + add_date = Column(DateTime) + chg_user_id = Column( + Integer, + ForeignKey('csuser.user_id'), + ) + chg_date = Column(DateTime)
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/models/cph/dispense_price.html b/_modules/carepoint/models/cph/dispense_price.html new file mode 100644 index 0000000..3516b5c --- /dev/null +++ b/_modules/carepoint/models/cph/dispense_price.html @@ -0,0 +1,181 @@ + + + + + + + carepoint.models.cph.dispense_price — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.models.cph.dispense_price

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+from carepoint import Carepoint
+from sqlalchemy import (Column,
+                        Integer,
+                        String,
+                        DateTime,
+                        ForeignKey,
+                        Numeric,
+                        )
+
+
+
[docs]class DispensePrice(Carepoint.BASE): + __tablename__ = 'cprxdisp_pricing' + __dbname__ = 'cph' + + rxdisp_id = Column( + Integer, + ForeignKey('cprx_disp.rxdisp_id'), + primary_key=True, + ) + pay_type_cn = Column(Integer) + t_ingr_cost_paid = Column(Numeric) + t_ingr_cost_sub = Column(Numeric) + ingr_cost_cn = Column(Integer) + aac_cost = Column(Numeric) + uc_cost = Column(Numeric) + tpty_claim_id = Column(Integer) + t_disp_fee_sub = Column(Numeric) + t_disp_fee_paid = Column(Numeric) + t_tax_sub = Column(Numeric) + t_tax_paid = Column(Numeric) + t_other_amt_sub = Column(Numeric) + t_other_amt_paid = Column(Numeric) + t_patient_pay_sub = Column(Numeric) + t_patient_pay_paid = Column(Numeric) + app_deduct = Column(Numeric) + ex_max_ben = Column(Numeric) + prod_sel_amt = Column(Numeric) + t_copay_sub = Column(Numeric) + t_copay_paid = Column(Numeric) + profit_made = Column(Numeric) + t_cost_sub = Column(Numeric) + t_cost_paid = Column(Numeric) + coupon_no = Column(Integer) + coupon_type = Column(Integer) + coupon_amt = Column(Numeric) + discount = Column(Numeric) + prior_auth_no = Column(String) + tpty_auth_no = Column(String) + t_price_sub = Column(Numeric) + t_price_paid = Column(Numeric) + status_cn = Column(Integer) + primary_pay_date = Column(DateTime) + second_pay_type_cn = Column(Integer) + second_amt_paid = Column(Numeric) + second_auth_no = Column(String) + disc_grp_name = Column(String) + primary_amt_paid = Column(Numeric) + secondary_prior_auth = Column(String) + other_payor_id_str = Column(String) + remaining_benefit = Column(Numeric) + remaining_deductible = Column(Numeric) + prior_auth_type_cn = Column(Integer) + prior_auth_type_cn_2 = Column(Integer) + incentive_fee_sub = Column(Numeric) + incentive_fee_paid = Column(Numeric)
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/models/cph/doctor.html b/_modules/carepoint/models/cph/doctor.html new file mode 100644 index 0000000..c8373c3 --- /dev/null +++ b/_modules/carepoint/models/cph/doctor.html @@ -0,0 +1,202 @@ + + + + + + + carepoint.models.cph.doctor — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.models.cph.doctor

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+from carepoint import Carepoint
+from sqlalchemy import (Column,
+                        Integer,
+                        String,
+                        DateTime,
+                        Boolean,
+                        ForeignKey,
+                        Text,
+                        )
+
+
+
[docs]class Doctor(Carepoint.BASE): + __tablename__ = 'cpmd' + __dbname__ = 'cph' + + md_id = Column( + Integer, + primary_key=True, + autoincrement=False, + ) + lname = Column(String) + lname_sdx = Column(String) + fname = Column(String) + fname_sdx = Column(String) + mname = Column(String) + title_lu = Column(String) + suffix_lu = Column(String) + degree_lu = Column(String) + prescriber_type_cn = Column(Integer) + email = Column(String) + url = Column(String) + pref_meth_contact_cn = Column(Integer) + best_cont_time = Column(String) + specialty_cd = Column(String) + dea_no = Column(String) + dea_suffix = Column(String) + spin_no = Column(String) + upin_no = Column(String) + other_id = Column(String) + fed_tax_id = Column(String) + hin_id = Column(String) + champus_id = Column(String) + state_lic_id = Column(String) + ncpdp_id = Column(String) + medicaid_id = Column(String) + medicare_id = Column(String) + blue_shield_id = Column(String) + blue_cross_id = Column(String) + npi_id = Column(String) + practice_org_id = Column( + Integer, + ForeignKey('csorg.org_id'), + ) + cmt = Column(Text) + status_cn = Column(Integer) + conv_code = Column(String) + app_flags = Column(Integer) + timestmp = Column(DateTime) + state_issued_id = Column(String) + sname = Column(String) + medicaid_restricted_yn = Column(Boolean) + fac_id = Column(Integer) + C2Restricted_yn = Column(Boolean) + co_md_id = Column( + Integer, + ForeignKey('cpmd.md_id'), + ) + do_not_refer = Column(Integer) + deceased_yn = Column(Boolean) + C0restricted_yn = Column(Boolean) + C3restricted_yn = Column(Boolean) + C4restricted_yn = Column(Boolean) + C5restricted_yn = Column(Boolean) + study_drugs_yn = Column(Boolean) + tracking_cn = Column(Integer) + CTP_no = Column(String) + add_user_id = Column( + Integer, + ForeignKey('csuser.user_id'), + ) + add_date = Column(DateTime) + chg_user_id = Column( + Integer, + ForeignKey('csuser.user_id'), + ) + chg_date = Column(DateTime)
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/models/cph/doctor_address.html b/_modules/carepoint/models/cph/doctor_address.html new file mode 100644 index 0000000..e802dbd --- /dev/null +++ b/_modules/carepoint/models/cph/doctor_address.html @@ -0,0 +1,131 @@ + + + + + + + carepoint.models.cph.doctor_address — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.models.cph.doctor_address

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+from carepoint import Carepoint
+from carepoint.models.address_mixin import AddressMixin
+from sqlalchemy import (Column,
+                        Integer,
+                        )
+
+
+
[docs]class DoctorAddress(AddressMixin, Carepoint.BASE): + __dbname__ = 'cph' + __tablename__ = 'cpmd_addr' + md_id = Column( + Integer, + primary_key=True, + autoincrement=False, + )
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/models/cph/doctor_phone.html b/_modules/carepoint/models/cph/doctor_phone.html new file mode 100644 index 0000000..4d6e1ee --- /dev/null +++ b/_modules/carepoint/models/cph/doctor_phone.html @@ -0,0 +1,131 @@ + + + + + + + carepoint.models.cph.doctor_phone — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.models.cph.doctor_phone

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+from carepoint import Carepoint
+from carepoint.models.phone_mixin import PhoneMixin
+from sqlalchemy import (Column,
+                        Integer,
+                        )
+
+
+
[docs]class DoctorPhone(PhoneMixin, Carepoint.BASE): + __dbname__ = 'cph' + __tablename__ = 'cpmd_phone' + md_id = Column( + Integer, + primary_key=True, + autoincrement=False, + )
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/models/cph/fdb_allergen.html b/_modules/carepoint/models/cph/fdb_allergen.html new file mode 100644 index 0000000..e445e3a --- /dev/null +++ b/_modules/carepoint/models/cph/fdb_allergen.html @@ -0,0 +1,149 @@ + + + + + + + carepoint.models.cph.fdb_allergen — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.models.cph.fdb_allergen

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+from carepoint import Carepoint
+from sqlalchemy import (Column,
+                        String,
+                        Integer,
+                        Boolean,
+                        ForeignKey,
+                        )
+
+
+
[docs]class FdbAllergen(Carepoint.BASE): + __tablename__ = 'fdrhicl' + __dbname__ = 'cph' + + hicl_seqno = Column( + Integer, + ForeignKey('fdrhiclsq.hicl_seqno'), + primary_key=True, + ) + hic_seqn = Column( + Integer, + ForeignKey('fdrhicd.hic_seqn'), + primary_key=True, + ) + hic_rel_no = Column( + Integer, + ) + hic = Column( + String(6), + ForeignKey('fdrhicd.hic'), + ) + update_yn = Column( + Boolean, + )
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/models/cph/fdb_allergen_desc.html b/_modules/carepoint/models/cph/fdb_allergen_desc.html new file mode 100644 index 0000000..6af16bb --- /dev/null +++ b/_modules/carepoint/models/cph/fdb_allergen_desc.html @@ -0,0 +1,141 @@ + + + + + + + carepoint.models.cph.fdb_allergen_desc — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.models.cph.fdb_allergen_desc

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+from carepoint import Carepoint
+from sqlalchemy import (Column,
+                        String,
+                        Integer,
+                        Boolean,
+                        )
+
+
+
[docs]class FdbAllergenDesc(Carepoint.BASE): + __tablename__ = 'fdrhiclsq' + __dbname__ = 'cph' + + hicl_seqno = Column( + Integer, + primary_key=True, + ) + gnn = Column( + String(30), + ) + gnn60 = Column( + String(60), + ) + update_yn = Column( + Boolean, + )
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/models/cph/fdb_allergen_group.html b/_modules/carepoint/models/cph/fdb_allergen_group.html new file mode 100644 index 0000000..2e1ee64 --- /dev/null +++ b/_modules/carepoint/models/cph/fdb_allergen_group.html @@ -0,0 +1,141 @@ + + + + + + + carepoint.models.cph.fdb_allergen_group — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.models.cph.fdb_allergen_group

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+from carepoint import Carepoint
+from sqlalchemy import (Column,
+                        String,
+                        Integer,
+                        Boolean,
+                        )
+
+
+
[docs]class FdbAllergenGroup(Carepoint.BASE): + __tablename__ = 'fdrdamagd' + __dbname__ = 'cph' + + dam_agcsp = Column( + Integer, + primary_key=True, + ) + dam_agcspd = Column( + String(50), + ) + potentially_inactive = Column( + Boolean, + ) + dam_agcsp_status = Column( + Integer, + )
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/models/cph/fdb_allergen_rel.html b/_modules/carepoint/models/cph/fdb_allergen_rel.html new file mode 100644 index 0000000..d562866 --- /dev/null +++ b/_modules/carepoint/models/cph/fdb_allergen_rel.html @@ -0,0 +1,150 @@ + + + + + + + carepoint.models.cph.fdb_allergen_rel — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.models.cph.fdb_allergen_rel

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+from carepoint import Carepoint
+from sqlalchemy import (Column,
+                        String,
+                        Integer,
+                        Boolean,
+                        )
+
+
+
[docs]class FdbAllergenRel(Carepoint.BASE): + __tablename__ = 'fdrhicd' + __dbname__ = 'cph' + + hic_seqn = Column( + Integer, + ) + hic = Column( + String(6), + primary_key=True, + ) + hic_desc = Column( + String(50), + ) + hic_root = Column( + Integer, + ) + potentially_inactive = Column( + Integer, + ) + ing_status = Column( + Integer, + ) + update_yn = Column( + Boolean, + )
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/models/cph/fdb_attr.html b/_modules/carepoint/models/cph/fdb_attr.html new file mode 100644 index 0000000..4f48041 --- /dev/null +++ b/_modules/carepoint/models/cph/fdb_attr.html @@ -0,0 +1,143 @@ + + + + + + + carepoint.models.cph.fdb_attr — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.models.cph.fdb_attr

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+from carepoint import Carepoint
+from sqlalchemy import (Column,
+                        String,
+                        Integer,
+                        ForeignKey,
+                        )
+
+
+
[docs]class FdbAttr(Carepoint.BASE): + __tablename__ = 'fdbriptdes' + __dbname__ = 'cph' + + IPTDESCID = Column( + Integer, + primary_key=True, + autoincrement=False, + ) + IPTCATID = Column( + Integer, + ForeignKey('fdbriptcat.IPTCATID'), + primary_key=True, + ) + IPTBSCDID = Column( + Integer, + ForeignKey('fdbriptbsc.IPTBSCDID'), + ) + IPTDESC = Column(String)
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/models/cph/fdb_attr_base.html b/_modules/carepoint/models/cph/fdb_attr_base.html new file mode 100644 index 0000000..05b50bb --- /dev/null +++ b/_modules/carepoint/models/cph/fdb_attr_base.html @@ -0,0 +1,139 @@ + + + + + + + carepoint.models.cph.fdb_attr_base — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.models.cph.fdb_attr_base

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+from carepoint import Carepoint
+from sqlalchemy import (Column,
+                        String,
+                        Integer,
+                        ForeignKey,
+                        )
+
+
+
[docs]class FdbAttrBase(Carepoint.BASE): + __tablename__ = 'fdbriptbsc' + __dbname__ = 'cph' + + IPTBSCDID = Column( + Integer, + primary_key=True, + autoincrement=False, + ) + IPTCATID = Column( + Integer, + ForeignKey('fdbriptcat.IPTCATID'), + primary_key=True, + ) + IPTBSCDESC = Column(String)
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/models/cph/fdb_attr_type.html b/_modules/carepoint/models/cph/fdb_attr_type.html new file mode 100644 index 0000000..96d0234 --- /dev/null +++ b/_modules/carepoint/models/cph/fdb_attr_type.html @@ -0,0 +1,133 @@ + + + + + + + carepoint.models.cph.fdb_attr_type — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.models.cph.fdb_attr_type

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+from carepoint import Carepoint
+from sqlalchemy import (Column,
+                        String,
+                        Integer,
+                        )
+
+
+
[docs]class FdbAttrType(Carepoint.BASE): + __tablename__ = 'fdbriptcat' + __dbname__ = 'cph' + + IPTCATID = Column( + Integer, + primary_key=True, + autoincrement=False, + ) + IPTCATDESC = Column(String)
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/models/cph/fdb_form.html b/_modules/carepoint/models/cph/fdb_form.html new file mode 100644 index 0000000..fd3319a --- /dev/null +++ b/_modules/carepoint/models/cph/fdb_form.html @@ -0,0 +1,131 @@ + + + + + + + carepoint.models.cph.fdb_form — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.models.cph.fdb_form

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+from carepoint import Carepoint
+from sqlalchemy import (Column,
+                        Boolean,
+                        String,
+                        )
+
+
+
[docs]class FdbForm(Carepoint.BASE): + __tablename__ = 'fdrdosed' + __dbname__ = 'cph' + + gcdf = Column(String, primary_key=True) + dose = Column(String) + gcdf_desc = Column(String) + update_yn = Column(Boolean)
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/models/cph/fdb_gcn.html b/_modules/carepoint/models/cph/fdb_gcn.html new file mode 100644 index 0000000..067d1cc --- /dev/null +++ b/_modules/carepoint/models/cph/fdb_gcn.html @@ -0,0 +1,135 @@ + + + + + + + carepoint.models.cph.fdb_gcn — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.models.cph.fdb_gcn

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+from carepoint import Carepoint
+from sqlalchemy import (Column,
+                        Integer,
+                        Boolean,
+                        String,
+                        )
+
+
+
[docs]class FdbGcn(Carepoint.BASE): + __tablename__ = 'fdrgcn' + __dbname__ = 'cph' + + gcn_seqno = Column( + Integer, + primary_key=True, + autoincrement=False, + ) + gcn = Column(String) + update_yn = Column(Boolean)
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/models/cph/fdb_gcn_seq.html b/_modules/carepoint/models/cph/fdb_gcn_seq.html new file mode 100644 index 0000000..7aa4756 --- /dev/null +++ b/_modules/carepoint/models/cph/fdb_gcn_seq.html @@ -0,0 +1,153 @@ + + + + + + + carepoint.models.cph.fdb_gcn_seq — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.models.cph.fdb_gcn_seq

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+from carepoint import Carepoint
+from sqlalchemy import (Column,
+                        Integer,
+                        String,
+                        Boolean,
+                        ForeignKey,
+                        )
+
+
+
[docs]class FdbGcnSeq(Carepoint.BASE): + __tablename__ = 'fdrgcnseq' + __dbname__ = 'cph' + + gcn_seqno = Column( + Integer, + primary_key=True, + autoincrement=False, + ) + hic3 = Column(String) + hicl_seqno = Column(Integer) + gcdf = Column( + String, + ForeignKey('fdrdosed.gcdf'), + ) + gcrt = Column( + String, + ForeignKey('fdrrouted.gcrt'), + ) + str = Column(String) + gtc = Column(Integer) + tc = Column(Integer) + dcc = Column(Integer) + gcnseq_gi = Column(Integer) + gender = Column(Integer) + hic3_seqn = Column(Integer) + str60 = Column(String) + update_yn = Column(Boolean)
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/models/cph/fdb_img.html b/_modules/carepoint/models/cph/fdb_img.html new file mode 100644 index 0000000..b544d23 --- /dev/null +++ b/_modules/carepoint/models/cph/fdb_img.html @@ -0,0 +1,150 @@ + + + + + + + carepoint.models.cph.fdb_img — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.models.cph.fdb_img

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+from carepoint import Carepoint
+from sqlalchemy.orm import relationship
+from sqlalchemy import (Column,
+                        String,
+                        Numeric,
+                        )
+
+
+
[docs]class FdbImg(Carepoint.BASE): + __tablename__ = 'fdbrimgimg' + __dbname__ = 'cph' + + IMGID = Column( + Numeric(10, 0), + primary_key=True, + ) + IMGFILENM = Column( + String, + ) + IMAGE_ROOTS = relationship( + 'StoreParam', + primaryjoin=""" and_( + remote(literal_column('1')) == foreign(StoreParam.store_id), + 'SC_MOD_IMAGE_ROOT' == foreign(StoreParam.param_code) + ) """, + viewonly=True, + innerjoin=True, + ) + IMAGE_PATH = property(lambda s: s._compute_image_path()) + + def _compute_image_path(self): + root = self.IMAGE_ROOTS[0].data_value.strip().strip('\\') + root = root.replace('\\', '/') + return '%s/%s.JPG' % (root, self.IMGFILENM.strip())
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/models/cph/fdb_img_date.html b/_modules/carepoint/models/cph/fdb_img_date.html new file mode 100644 index 0000000..a790dba --- /dev/null +++ b/_modules/carepoint/models/cph/fdb_img_date.html @@ -0,0 +1,143 @@ + + + + + + + carepoint.models.cph.fdb_img_date — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.models.cph.fdb_img_date

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+from carepoint import Carepoint
+from sqlalchemy import (Column,
+                        DateTime,
+                        Numeric,
+                        ForeignKey,
+                        )
+
+
+
[docs]class FdbImgDate(Carepoint.BASE): + __tablename__ = 'fdbrimguij' + __dbname__ = 'cph' + + IMGUNIQID = Column( + Numeric(10, 0), + primary_key=True, + ) + IMGSTRTDT = Column( + DateTime, + primary_key=True, + ) + IMGSTOPDT = Column( + DateTime, + ) + IMGID = Column( + Numeric(10, 0), + ForeignKey('fdbrimgimg.IMGID'), + )
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/models/cph/fdb_img_id.html b/_modules/carepoint/models/cph/fdb_img_id.html new file mode 100644 index 0000000..0ceef8f --- /dev/null +++ b/_modules/carepoint/models/cph/fdb_img_id.html @@ -0,0 +1,142 @@ + + + + + + + carepoint.models.cph.fdb_img_id — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.models.cph.fdb_img_id

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+from carepoint import Carepoint
+from sqlalchemy import (Column,
+                        String,
+                        Numeric,
+                        ForeignKey,
+                        )
+
+
+
[docs]class FdbImgId(Carepoint.BASE): + __tablename__ = 'fdbrimgudg' + __dbname__ = 'cph' + + IMGUNIQID = Column( + Numeric(10, 0), + primary_key=True, + ) + IMGDFID = Column( + Numeric(5, 0), + ) + IMGNDC = Column( + String, + ) + IMGMFGID = Column( + Numeric(10, 0), + ForeignKey('fdbrimgmfg.IMGMFGID'), + )
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/models/cph/fdb_img_mfg.html b/_modules/carepoint/models/cph/fdb_img_mfg.html new file mode 100644 index 0000000..b654449 --- /dev/null +++ b/_modules/carepoint/models/cph/fdb_img_mfg.html @@ -0,0 +1,134 @@ + + + + + + + carepoint.models.cph.fdb_img_mfg — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.models.cph.fdb_img_mfg

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+from carepoint import Carepoint
+from sqlalchemy import (Column,
+                        String,
+                        Numeric,
+                        )
+
+
+
[docs]class FdbImgMfg(Carepoint.BASE): + __tablename__ = 'fdbrimgmfg' + __dbname__ = 'cph' + + IMGMFGID = Column( + Numeric(10, 0), + primary_key=True, + ) + IMGMFGNAME = Column( + String, + )
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/models/cph/fdb_lbl_rid.html b/_modules/carepoint/models/cph/fdb_lbl_rid.html new file mode 100644 index 0000000..aefe550 --- /dev/null +++ b/_modules/carepoint/models/cph/fdb_lbl_rid.html @@ -0,0 +1,130 @@ + + + + + + + carepoint.models.cph.fdb_lbl_rid — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.models.cph.fdb_lbl_rid

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+from carepoint import Carepoint
+from sqlalchemy import (Column,
+                        String,
+                        Boolean,
+                        )
+
+
+
[docs]class FdbLblRid(Carepoint.BASE): + __tablename__ = 'fdrlblrid' + __dbname__ = 'cph' + + lblrid = Column(String, primary_key=True) + mfg = Column(String) + update_yn = Column(Boolean)
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/models/cph/fdb_ndc.html b/_modules/carepoint/models/cph/fdb_ndc.html new file mode 100644 index 0000000..7c86048 --- /dev/null +++ b/_modules/carepoint/models/cph/fdb_ndc.html @@ -0,0 +1,211 @@ + + + + + + + carepoint.models.cph.fdb_ndc — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.models.cph.fdb_ndc

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+from carepoint import Carepoint
+from sqlalchemy import (Column,
+                        Integer,
+                        String,
+                        Boolean,
+                        )
+
+
+
[docs]class FdbNdc(Carepoint.BASE): + __tablename__ = 'fdrndc' + __dbname__ = 'cph' + + ndc = Column(String, primary_key=True) + id = Column(Integer) + lblrid = Column(String) + gcn_seqno = Column(Integer) + ps = Column(Integer) + df = Column(Integer) + ad = Column(String) + ln = Column(String) + bn = Column(String) + pndc = Column(Integer) + repndc = Column(Integer) + ndcfi = Column(Integer) + daddnc = Column(String) + dupdc = Column(String) + desi = Column(String) + desdtec = Column(Integer) + desi2 = Column(String) + des2dtec = Column(Integer) + dea = Column(Integer) + cl = Column(String) + gpi = Column(Integer) + hosp = Column(Integer) + innov = Column(Integer) + ipi = Column(Integer) + mini = Column(Integer) + maint = Column(Integer) + obc = Column(String) + obsdtec = Column(String) + ppi = Column(Integer) + stpk = Column(Integer) + repack = Column(Integer) + top200 = Column(Integer) + ud = Column(Integer) + csp = Column(Integer) + color = Column(String) + flavor = Column(String) + shape = Column(String) + ndl_gdge = Column(Integer) + ndl_lngth = Column(Integer) + syr_cpcty = Column(Integer) + shlf_pck = Column(Integer) + shipper = Column(Integer) + skey = Column(String) + hcfa_fda = Column(String) + hcfa_unit = Column(String) + hcfa_ps = Column(Integer) + hcfa_appc = Column(Integer) + hcfa_mrkc = Column(Integer) + hcfa_trmc = Column(Integer) + hcfa_typ = Column(Integer) + hcfa_desc1 = Column(Integer) + hcfa_desi1 = Column(Integer) + uu = Column(Integer) + pd = Column(String) + ln25 = Column(String) + ln25i = Column(Integer) + gpidc = Column(Integer) + bbdc = Column(Integer) + home = Column(Integer) + inpcki = Column(Integer) + outpcki = Column(Integer) + obc_exp = Column(String) + ps_equiv = Column(Integer) + plblr = Column(Integer) + hcpc = Column(String) + top50gen = Column(Integer) + obc3 = Column(String) + gmi = Column(Integer) + gni = Column(Integer) + gsi = Column(Integer) + gti = Column(Integer) + ndcgi1 = Column(Integer) + user_gcdf = Column(String) + user_str = Column(String) + real_product_yn = Column(Boolean) + no_update_yn = Column(Boolean) + no_prc_update_yn = Column(Boolean) + user_product_yn = Column(Integer) + cpname_short = Column(String) + status_cn = Column(String) + update_yn = Column(Boolean) + active_yn = Column(Boolean) + ln60 = Column(String)
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/models/cph/fdb_ndc_cs_ext.html b/_modules/carepoint/models/cph/fdb_ndc_cs_ext.html new file mode 100644 index 0000000..28dd424 --- /dev/null +++ b/_modules/carepoint/models/cph/fdb_ndc_cs_ext.html @@ -0,0 +1,191 @@ + + + + + + + carepoint.models.cph.fdb_ndc_cs_ext — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.models.cph.fdb_ndc_cs_ext

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+from carepoint import Carepoint
+from sqlalchemy import (Column,
+                        Integer,
+                        Boolean,
+                        String,
+                        ForeignKey,
+                        DateTime,
+                        )
+
+
+
[docs]class FdbNdcCsExt(Carepoint.BASE): + __tablename__ = 'csext_fdrndc' + __dbname__ = 'cph' + + ndc = Column(String, primary_key=True) + short_name = Column(String) + lot_no = Column(String) + orig_mfg = Column(String) + pref_gen_yn = Column(Boolean) + active_yn = Column(Boolean) + drug_expire_days = Column(String) + formulary_yn = Column(Boolean) + compound_yn = Column(Boolean) + sup_upd_gen_yn = Column(Boolean) + sup_upd_phys_yn = Column(Boolean) + sup_upd_clin_yn = Column(Boolean) + sup_upd_fin_yn = Column(Boolean) + sup_upd_med_yn = Column(Boolean) + dn_form = Column(String) + dn_str = Column(String) + dn_route = Column(String) + rx_only_yn = Column(Boolean) + manual_yn = Column(Boolean) + brand_ndc = Column(String) + add_user_id = Column( + Integer, + ForeignKey('csuser.user_id'), + ) + add_date = Column(DateTime) + chg_user_id = Column( + Integer, + ForeignKey('csuser.user_id'), + ) + app_flags = Column(String) + timestmp = Column(DateTime) + comp_yn = Column(Boolean) + dea = Column(String) + dea_chg_user = Column( + Integer, + ForeignKey('csuser.user_id'), + ) + dea_chg_date = Column(DateTime) + ln = Column(String) + ln_chg_user = Column( + Integer, + ForeignKey('csuser.user_id'), + ) + ln_chg_date = Column(DateTime) + fdb_chg_date = Column(DateTime) + ud_svc_code = Column(String) + gpi = Column(String) + gpi_chg_user = Column( + Integer, + ForeignKey('csuser.user_id'), + ) + gpi_chg_date = Column(DateTime) + bill_increment = Column(Integer) + formula_id = Column(Integer) + alt_iptside1 = Column(String) + alt_iptside2 = Column(String) + dose_multiplier = Column(String) + default_daw_override = Column(String) + manual_price_yn = Column(Boolean) + compound_type_cn = Column(Integer) + refrig_cn = Column(Integer)
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/models/cph/fdb_pem_moe.html b/_modules/carepoint/models/cph/fdb_pem_moe.html new file mode 100644 index 0000000..4adbbde --- /dev/null +++ b/_modules/carepoint/models/cph/fdb_pem_moe.html @@ -0,0 +1,144 @@ + + + + + + + carepoint.models.cph.fdb_pem_moe — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.models.cph.fdb_pem_moe

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+from carepoint import Carepoint
+from sqlalchemy import (Column,
+                        Integer,
+                        Boolean,
+                        String,
+                        )
+
+
+
[docs]class FdbPemMoe(Carepoint.BASE): + """ Monographs - Text Portion """ + __tablename__ = 'fdrpemmoe' + __dbname__ = 'cph' + + pemono = Column( + Integer, + primary_key=True, + autoincrement=False, + ) + pemono_sn = Column( + Integer, + primary_key=True, + autoincrement=False, + ) + pemtxtei = Column(String) + pemtxte = Column(String) + pemgndr = Column(String) + pemage = Column(String) + update_yn = Column(Boolean)
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/models/cph/fdb_pem_mogc.html b/_modules/carepoint/models/cph/fdb_pem_mogc.html new file mode 100644 index 0000000..510c806 --- /dev/null +++ b/_modules/carepoint/models/cph/fdb_pem_mogc.html @@ -0,0 +1,139 @@ + + + + + + + carepoint.models.cph.fdb_pem_mogc — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.models.cph.fdb_pem_mogc

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+from carepoint import Carepoint
+from sqlalchemy import (Column,
+                        Integer,
+                        Boolean,
+                        ForeignKey,
+                        )
+
+
+
[docs]class FdbPemMogc(Carepoint.BASE): + __tablename__ = 'fdrpemogc' + __dbname__ = 'cph' + + gcn_seqno = Column( + Integer, + primary_key=True, + autoincrement=False, + ) + pemono = Column( + Integer, + ForeignKey('fdrpemmoe.pemono'), + primary_key=True, + ) + update_yn = Column(Boolean)
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/models/cph/fdb_price.html b/_modules/carepoint/models/cph/fdb_price.html new file mode 100644 index 0000000..c819a0f --- /dev/null +++ b/_modules/carepoint/models/cph/fdb_price.html @@ -0,0 +1,132 @@ + + + + + + + carepoint.models.cph.fdb_price — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.models.cph.fdb_price

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+from carepoint import Carepoint
+from sqlalchemy import (Column,
+                        DateTime,
+                        Numeric,
+                        String,
+                        )
+
+
+
[docs]class FdbPrice(Carepoint.BASE): + __tablename__ = 'fdrnp_inc' + __dbname__ = 'cph' + + ndc = Column(String, primary_key=True) + npt_type = Column(String, primary_key=True) + npt_datec = Column(DateTime, primary_key=True) + npt_price = Column(Numeric)
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/models/cph/fdb_price_type.html b/_modules/carepoint/models/cph/fdb_price_type.html new file mode 100644 index 0000000..96a0365 --- /dev/null +++ b/_modules/carepoint/models/cph/fdb_price_type.html @@ -0,0 +1,131 @@ + + + + + + + carepoint.models.cph.fdb_price_type — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.models.cph.fdb_price_type

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+from carepoint import Carepoint
+from sqlalchemy import (Column,
+                        DateTime,
+                        Boolean,
+                        String,
+                        )
+
+
+
[docs]class FdbPriceType(Carepoint.BASE): + __tablename__ = 'fdrnptypd' + __dbname__ = 'cph' + + npt_type = Column(String, primary_key=True) + npt_desc = Column(DateTime) + update_yn = Column(Boolean)
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/models/cph/fdb_route.html b/_modules/carepoint/models/cph/fdb_route.html new file mode 100644 index 0000000..099c7ed --- /dev/null +++ b/_modules/carepoint/models/cph/fdb_route.html @@ -0,0 +1,133 @@ + + + + + + + carepoint.models.cph.fdb_route — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.models.cph.fdb_route

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+from carepoint import Carepoint
+from sqlalchemy import (Column,
+                        String,
+                        Boolean,
+                        )
+
+
+
[docs]class FdbRoute(Carepoint.BASE): + __tablename__ = 'fdrrouted' + __dbname__ = 'cph' + + gcrt = Column(String, primary_key=True) + rt = Column(String) + gcrt2 = Column(String) + gcrt_desc = Column(String) + systemic = Column(String) + update_yn = Column(Boolean)
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/models/cph/fdb_unit.html b/_modules/carepoint/models/cph/fdb_unit.html new file mode 100644 index 0000000..926c95b --- /dev/null +++ b/_modules/carepoint/models/cph/fdb_unit.html @@ -0,0 +1,131 @@ + + + + + + + carepoint.models.cph.fdb_unit — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.models.cph.fdb_unit

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+from carepoint import Carepoint
+from sqlalchemy import (Column,
+                        String,
+                        Boolean,
+                        )
+
+
+
[docs]class FdbUnit(Carepoint.BASE): + __tablename__ = 'fdrunitsd' + __dbname__ = 'cph' + + str = Column(String, primary_key=True) + str30 = Column(String) + str60 = Column(String) + update_yn = Column(Boolean)
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/models/cph/image_data.html b/_modules/carepoint/models/cph/image_data.html new file mode 100644 index 0000000..020feea --- /dev/null +++ b/_modules/carepoint/models/cph/image_data.html @@ -0,0 +1,171 @@ + + + + + + + carepoint.models.cph.image_data — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.models.cph.image_data

+# -*- coding: utf-8 -*-
+# Copyright 2017-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+from carepoint import Carepoint
+from sqlalchemy import (Column,
+                        DateTime,
+                        ForeignKey,
+                        Integer,
+                        String,
+                        Numeric,
+                        )
+
+
+
[docs]class ImageData(Carepoint.BASE): + __tablename__ = 'cpimage_data' + __dbname__ = 'cph' + + image_id = Column( + Integer, + ) + image_type_cn = Column( + Integer, + # Column is not actually a primary key in DB. + primary_key=True, + ) + related_id = Column( + Integer, + # Column is not actually a primary key in DB. + primary_key=True, + ) + RootFolderName = Column( + String, + ) + FullFileName = Column( + String, + ) + related_store_id = Column( + Integer, + ForeignKey('csstore.store_id'), + ) + related_pat_id = Column( + Integer, + ForeignKey('cppat.pat_id'), + ) + add_user_id = Column( + Integer, + ForeignKey('csuser.user_id'), + ) + add_date = Column(DateTime) + chg_user_id = Column( + Integer, + ForeignKey('csuser.user_id'), + ) + chg_date = Column(DateTime) + image_path = property(lambda s: s._compute_image_path()) + + def _compute_image_path(self): + return '%s/%s' % (self.RootFolderName, self.FullFileName)
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/models/cph/item.html b/_modules/carepoint/models/cph/item.html new file mode 100644 index 0000000..8933483 --- /dev/null +++ b/_modules/carepoint/models/cph/item.html @@ -0,0 +1,191 @@ + + + + + + + carepoint.models.cph.item — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.models.cph.item

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+from carepoint import Carepoint
+from sqlalchemy import (Column,
+                        Integer,
+                        String,
+                        DateTime,
+                        ForeignKey,
+                        Numeric,
+                        Float,
+                        Text,
+                        )
+
+
+
[docs]class Item(Carepoint.BASE): + __tablename__ = 'item' + __dbname__ = 'cph' + + ITEMMSTR = Column(String) + DESCR = Column(String) + TAXABLE = Column(String) + CLASS = Column(String) + UOFMSALES = Column(String) + UOFMORDERS = Column(String) + FACTOR = Column(Float) + ONHAND = Column(Numeric) + ONORDER = Column(Numeric) + VENDOR = Column(String) + COST = Column(Numeric) + INQTY = Column(Numeric) + INDATE = Column(DateTime) + OUTQTY = Column(Numeric) + OUTDATE = Column(DateTime) + ADJQTY = Column(Numeric) + ADJDATE = Column(DateTime) + MTD_ISSUE = Column(Numeric) + MTD_RCPTS = Column(Numeric) + MTD_ADJ = Column(Numeric) + COMMENTS = Column(Text) + IMIN = Column(Numeric) + IMAX = Column(Numeric) + UPCCODE = Column(String) + POSLOC = Column(String) + VENDITEMNO = Column(String) + EXCLUDE = Column(String) + NDC = Column(String) + SKU = Column(String) + AUTO_ORD = Column(Integer) + FIXED_QTY = Column(Numeric) + ACTIVE_YN = Column(Integer) + AVG_UNIT_COST = Column(Numeric) + location = Column(String) + item_id = Column( + Integer, + primary_key=True, + autoincrement=False, + ) + store_id = Column( + Integer, + ForeignKey('csstore.store_id'), + ) + chemical_id = Column(Integer) + allocated = Column(Numeric) + machine_id = Column(Integer) + special_pkg_ind_cn = Column(Integer) + refrig_cn = Column(Integer) + order_multiples_of = Column(Integer) + add_user_id = Column( + Integer, + ForeignKey('csuser.user_id'), + ) + add_date = Column(DateTime) + chg_user_id = Column( + Integer, + ForeignKey('csuser.user_id'), + ) + chg_date = Column(DateTime)
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/models/cph/order.html b/_modules/carepoint/models/cph/order.html new file mode 100644 index 0000000..974f078 --- /dev/null +++ b/_modules/carepoint/models/cph/order.html @@ -0,0 +1,206 @@ + + + + + + + carepoint.models.cph.order — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.models.cph.order

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+from carepoint import Carepoint
+from sqlalchemy.types import Enum
+from sqlalchemy import (Column,
+                        Integer,
+                        String,
+                        DateTime,
+                        ForeignKey,
+                        Boolean,
+                        Float,
+                        )
+
+from carepoint.models.state import EnumOrderState
+
+
+
[docs]class Order(Carepoint.BASE): + __tablename__ = 'CsOm' + __dbname__ = 'cph' + + order_id = Column( + Integer, + primary_key=True, + autoincrement=False, + ) + acct_id = Column(Integer) + invoice_nbr = Column(Integer) + order_state_cn = Column( + Integer, + ForeignKey('CsOmStatus.state_cn') + ) + order_status_cn = Column( + Integer, + ForeignKey('CsOmStatus.OmStatus'), + ) + hold_yn = Column(Boolean) + priority_cn = Column(Integer) + submit_date = Column(DateTime) + fax_sent = Column(DateTime) + fax_returned = Column(DateTime) + ship_text = Column(String) + rph_id = Column(Integer) + tech_fill = Column(String) + rph_check = Column(String) + comments = Column(String) + liCount = Column(Integer) + c2Count = Column(Integer) + ship_cn = Column(Integer) + sat_deliv_yn = Column(Boolean) + ship_amt = Column(Float) + store_id = Column( + Integer, + ForeignKey('csstore.store_id'), + ) + ship_flag_cn = Column(Integer) + Locked_yn = Column(Boolean) + locked_id = Column(Integer) + lock_user_id = Column( + Integer, + ForeignKey('csuser.user_id'), + ) + ship_date = Column(DateTime) + expected_by = Column(DateTime) + owner_store_id = Column( + Integer, + ForeignKey('csstore.store_id'), + ) + auto_charge_cc_id = Column(Integer) + auto_charge_cc_state_cn = Column(Integer) + send_pos_state_cn = Column(Integer) + automated_yn = Column(Boolean) + status_cn = Column(Integer) + order_category_cn = Column(Integer) + route_store_id = Column( + Integer, + ForeignKey('csstore.store_id'), + ) + DestStateCD = Column(String) + add_user_id = Column( + Integer, + ForeignKey('csuser.user_id'), + ) + add_date = Column(DateTime) + chg_user_id = Column( + Integer, + ForeignKey('csuser.user_id'), + ) + chg_date = Column(DateTime) + + @property + def order_state(self): + return EnumOrderState(self.order_state_cn)
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/models/cph/order_line.html b/_modules/carepoint/models/cph/order_line.html new file mode 100644 index 0000000..cc945b5 --- /dev/null +++ b/_modules/carepoint/models/cph/order_line.html @@ -0,0 +1,159 @@ + + + + + + + carepoint.models.cph.order_line — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.models.cph.order_line

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+from carepoint import Carepoint
+from sqlalchemy import (Column,
+                        Integer,
+                        Boolean,
+                        DateTime,
+                        ForeignKey,
+                        )
+
+
+
[docs]class OrderLine(Carepoint.BASE): + __tablename__ = 'CsOmLine' + __dbname__ = 'cph' + + line_id = Column( + Integer, + primary_key=True, + autoincrement=False, + ) + order_id = Column( + Integer, + ForeignKey('CsOm.order_id'), + ) + rx_id = Column( + Integer, + ForeignKey('cprx.rx_id'), + ) + rxdisp_id = Column( + Integer, + ForeignKey('cprx_disp.rxdisp_id'), + ) + line_state_cn = Column(Integer) + line_status_cn = Column(Integer) + hold_yn = Column(Boolean) + add_user_id = Column( + Integer, + ForeignKey('csuser.user_id'), + ) + add_date = Column(DateTime) + chg_user_id = Column( + Integer, + ForeignKey('csuser.user_id'), + ) + chg_date = Column(DateTime)
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/models/cph/order_line_non_rx.html b/_modules/carepoint/models/cph/order_line_non_rx.html new file mode 100644 index 0000000..46c323c --- /dev/null +++ b/_modules/carepoint/models/cph/order_line_non_rx.html @@ -0,0 +1,177 @@ + + + + + + + carepoint.models.cph.order_line_non_rx — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.models.cph.order_line_non_rx

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+from carepoint import Carepoint
+from sqlalchemy import (Column,
+                        Integer,
+                        String,
+                        DateTime,
+                        ForeignKey,
+                        Numeric,
+                        )
+
+
+
[docs]class OrderLineNonRx(Carepoint.BASE): + __tablename__ = 'CsOmNonRxLine' + __dbname__ = 'cph' + + line_id = Column( + Integer, + primary_key=True, + autoincrement=False, + ) + order_id = Column( + Integer, + ForeignKey('CsOm.order_id'), + ) + org_id = Column( + Integer, + ForeignKey('csorg.org_id'), + ) + pat_id = Column( + Integer, + ForeignKey('cppat.pat_id'), + ) + item_id = Column( + Integer, + ForeignKey('item.item_id'), + ) + descr = Column(String) + qty = Column(Numeric) + unit_amt = Column(Numeric) + tax = Column(Numeric) + rxdisp_id = Column( + Integer, + ForeignKey('cprx_disp.rxdisp_id'), + ) + rxdisp_id = Column( + Integer, + ForeignKey('cprx_disp.rxdisp_id'), + ) + replace_rxdisp_id = Column( + Integer, + ForeignKey('cprx_disp.rxdisp_id'), + ) + add_user_id = Column( + Integer, + ForeignKey('csuser.user_id'), + ) + add_date = Column(DateTime) + chg_user_id = Column( + Integer, + ForeignKey('csuser.user_id'), + ) + chg_date = Column(DateTime)
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/models/cph/order_ship.html b/_modules/carepoint/models/cph/order_ship.html new file mode 100644 index 0000000..2979a99 --- /dev/null +++ b/_modules/carepoint/models/cph/order_ship.html @@ -0,0 +1,152 @@ + + + + + + + carepoint.models.cph.order_ship — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.models.cph.order_ship

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+from carepoint import Carepoint
+from sqlalchemy import (Column,
+                        Integer,
+                        String,
+                        )
+
+
+
[docs]class OrderShip(Carepoint.BASE): + __tablename__ = 'csom_ship' + __dbname__ = 'cph' + + order_id = Column( + Integer, + primary_key=True, + autoincrement=False, + ) + processing_flag = Column(Integer) + tracking_code = Column(String) + Bill_Name = Column(String) + bill_addr1 = Column(String) + bill_addr2 = Column(String) + bill_addr3 = Column(String) + bill_city = Column(String) + bill_state_cd = Column(String) + bill_zip = Column(String) + bill_country_cd = Column(String) + ship_name = Column(String) + ship_addr1 = Column(String) + ship_addr2 = Column(String) + ship_addr3 = Column(String) + ship_city = Column(String) + ship_state_cd = Column(String) + ship_zip = Column(String) + ship_country_cd = Column(String) + ship_phone = Column(String) + ship_email = Column(String)
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/models/cph/order_status.html b/_modules/carepoint/models/cph/order_status.html new file mode 100644 index 0000000..8c2fdc3 --- /dev/null +++ b/_modules/carepoint/models/cph/order_status.html @@ -0,0 +1,143 @@ + + + + + + + carepoint.models.cph.order_status — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.models.cph.order_status

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+from carepoint import Carepoint
+from sqlalchemy.types import Enum
+from sqlalchemy import (Column,
+                        Integer,
+                        String
+                        )
+
+from carepoint.models.state import EnumOrderState
+
+
+
[docs]class OrderStatus(Carepoint.BASE): + __tablename__ = 'CsOmStatus' + __dbname__ = 'cph' + + OmStatus = Column( + Integer, + primary_key=True, + autoincrement=False, + ) + state_cn = Column( + Integer, + ) + descr = Column(String) + + @property + def state(self): + return EnumOrderState(self.state_cn)
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/models/cph/organization.html b/_modules/carepoint/models/cph/organization.html new file mode 100644 index 0000000..3b152be --- /dev/null +++ b/_modules/carepoint/models/cph/organization.html @@ -0,0 +1,165 @@ + + + + + + + carepoint.models.cph.organization — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.models.cph.organization

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+from carepoint import Carepoint
+from sqlalchemy import (Column,
+                        Integer,
+                        String,
+                        DateTime,
+                        Boolean,
+                        ForeignKey,
+                        Text,
+                        Numeric,
+                        )
+
+
+
[docs]class Organization(Carepoint.BASE): + __dbname__ = 'cph' + __tablename__ = 'csorg' + + org_id = Column( + Integer, + primary_key=True, + autoincrement=False, + ) + name = Column(String) + name_sdx = Column(String) + url = Column(String) + email = Column(String) + contact = Column(String) + fed_tax_id = Column(String) + clinic_no = Column(String) + cmt = Column(Text) + system_yn = Column(Boolean) + ins_type_cn = Column(Integer) + status_cn = Column(Integer) + app_flags = Column(Integer) + timestmp = Column(DateTime) + cont_id = Column(Integer) + per_diem = Column(Numeric(18, 8)) + external_id = Column(String) + tf_days = Column(Integer) + dea_no = Column(String) + add_user_id = Column( + Integer, + ForeignKey('csuser.user_id'), + ) + add_date = Column(DateTime) + chg_user_id = Column( + Integer, + ForeignKey('csuser.user_id'), + ) + chg_date = Column(DateTime)
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/models/cph/organization_address.html b/_modules/carepoint/models/cph/organization_address.html new file mode 100644 index 0000000..fd60dfa --- /dev/null +++ b/_modules/carepoint/models/cph/organization_address.html @@ -0,0 +1,131 @@ + + + + + + + carepoint.models.cph.organization_address — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.models.cph.organization_address

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+from carepoint import Carepoint
+from carepoint.models.address_mixin import AddressMixin
+from sqlalchemy import (Column,
+                        Integer,
+                        )
+
+
+
[docs]class OrganizationAddress(AddressMixin, Carepoint.BASE): + __dbname__ = 'cph' + __tablename__ = 'csorg_addr' + org_id = Column( + Integer, + primary_key=True, + autoincrement=False, + )
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/models/cph/pathology.html b/_modules/carepoint/models/cph/pathology.html new file mode 100644 index 0000000..15f8bd7 --- /dev/null +++ b/_modules/carepoint/models/cph/pathology.html @@ -0,0 +1,145 @@ + + + + + + + carepoint.models.cph.pathology — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.models.cph.pathology

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+from carepoint import Carepoint
+from sqlalchemy import (Column,
+                        String,
+                        DateTime,
+                        Numeric,
+                        Text,
+                        ForeignKey,
+                        )
+
+
+
[docs]class Pathology(Carepoint.BASE): + __tablename__ = 'fdrfmlinm_10' + __dbname__ = 'cph' + + icd_cd = Column( + String, + primary_key=True, + ) + icd_cd_type = Column( + String, + ForeignKey('fdrfmlitd_10.icd_cd_type'), + primary_key=True, + ) + icd_desc = Column(Text) + icd_desc_source_cd = Column(String) + icd_status_cd = Column(String) + icd_first_dt = Column(DateTime) + icd_last_dt = Column(DateTime) + icd_billable_ind = Column(Numeric(1, 0))
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/models/cph/pathology_code_type.html b/_modules/carepoint/models/cph/pathology_code_type.html new file mode 100644 index 0000000..7244044 --- /dev/null +++ b/_modules/carepoint/models/cph/pathology_code_type.html @@ -0,0 +1,133 @@ + + + + + + + carepoint.models.cph.pathology_code_type — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.models.cph.pathology_code_type

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+from carepoint import Carepoint
+from sqlalchemy import (Column,
+                        String,
+                        )
+
+
+
[docs]class PathologyCodeType(Carepoint.BASE): + __tablename__ = 'fdrfmlitd_10' + __dbname__ = 'cph' + + icd_cd_type = Column( + String, + primary_key=True, + ) + icd_cd_type_desc = Column( + String, + )
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/models/cph/patient.html b/_modules/carepoint/models/cph/patient.html new file mode 100644 index 0000000..f7d345d --- /dev/null +++ b/_modules/carepoint/models/cph/patient.html @@ -0,0 +1,243 @@ + + + + + + + carepoint.models.cph.patient — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.models.cph.patient

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+from carepoint import Carepoint
+from sqlalchemy import (Column,
+                        Integer,
+                        String,
+                        DateTime,
+                        Boolean,
+                        ForeignKey,
+                        Text,
+                        SmallInteger)
+
+
+
[docs]class Patient(Carepoint.BASE): + __dbname__ = 'cph' + __tablename__ = 'cppat' + + pat_id = Column( + Integer, + primary_key=True, + autoincrement=False, + ) + cmt_id = Column(Integer) + pat_status_cn = Column(Integer) + pat_type_cn = Column(Integer) + nh_pat_id = Column(String) + chart_id = Column(String) + lname = Column(String) + lname_sdx = Column(String) + fname = Column(String) + fname_sdx = Column(String) + mname = Column(String) + title_lu = Column(String) + suffix_lu = Column(String) + alias = Column(String) + mmname = Column(String) + alt1_id = Column(String) + pref_meth_cont_cn = Column(String) + best_cont_time = Column(String) + ssn = Column(String) + dln = Column(String) + dln_state_cd = Column(String) + email = Column(String) + gender_cd = Column(String) + birth_date = Column(DateTime) + death_date = Column(DateTime) + no_safety_caps_yn = Column(Boolean) + generics_yn = Column(Boolean) + label_style_cn = Column(Integer) + primary_md_id = Column( + Integer, + ForeignKey('cpmd.md_id') + ) + secondary_md_id = Column( + Integer, + ForeignKey('cpmd.md_id') + ) + edu_level_cn = Column(Integer) + ethnicity_cd = Column(String) + marital_status_cd = Column(String) + religion_cn = Column(Integer) + name_spouse = Column(String) + primary_lang_cd = Column(String) + rec_release_status_cn = Column(Integer) + rec_release_date = Column(DateTime) + hh_relation_cn = Column(Integer) + hh_pat_id = Column( + Integer, + ForeignKey('cppat.pat_id'), + ) + fam_relation_cn = Column(String) + fam_pat_id = Column( + Integer, + ForeignKey('cppat.pat_id'), + ) + primary_store_id = Column( + Integer, + ForeignKey('csstore.store_id'), + ) + bad_check_yn = Column(Boolean) + price_formula_id = Column(Integer) + cmt = Column(Text) + status_cn = Column(Integer) + facility_pat_yn = Column(Boolean) + conv_code = Column(String) + app_flags = Column(Integer) + timestmp = Column(DateTime) + comp_cn = Column(Integer) + hp_blnAdmExt = Column(SmallInteger) + hp_ExtAtt = Column(SmallInteger) + user_def_1 = Column(String) + user_def_2 = Column(String) + user_def_3 = Column(String) + user_def_4 = Column(String) + sc_pat_id = Column( + Integer, + ForeignKey('cppat.pat_id'), + ) + resp_party_id = Column(Integer) + auto_refill_cn = Column(Integer) + fill_yn = Column(Boolean) + fill_stop_date = Column(DateTime) + fill_resume_date = Column(DateTime) + fill_stop_reason_cn = Column(Integer) + fill_stop_user_id = Column( + Integer, + ForeignKey('csuser.user_id'), + ) + registration_date = Column(DateTime) + anonymous_yn = Column(Boolean) + market_yn = Column(Boolean) + representative = Column(String) + discharge_date = Column(DateTime) + do_not_resuscitate_yn = Column(Boolean) + discharge_exp_date = Column(DateTime) + pat_loc_cn = Column(Integer) + rx_priority_default_cn = Column(Integer) + ship_cn = Column(Integer) + residence_cn = Column(Integer) + add_user_id = Column( + Integer, + ForeignKey('csuser.user_id'), + ) + add_date = Column(DateTime) + chg_user_id = Column( + Integer, + ForeignKey('csuser.user_id'), + ) + chg_date = Column(DateTime)
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/models/cph/patient_address.html b/_modules/carepoint/models/cph/patient_address.html new file mode 100644 index 0000000..7804ebc --- /dev/null +++ b/_modules/carepoint/models/cph/patient_address.html @@ -0,0 +1,131 @@ + + + + + + + carepoint.models.cph.patient_address — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.models.cph.patient_address

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+from carepoint import Carepoint
+from carepoint.models.address_mixin import AddressMixin
+from sqlalchemy import (Column,
+                        Integer,
+                        )
+
+
+
[docs]class PatientAddress(AddressMixin, Carepoint.BASE): + __dbname__ = 'cph' + __tablename__ = 'cppat_addr' + pat_id = Column( + Integer, + primary_key=True, + autoincrement=False, + )
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/models/cph/patient_allergy.html b/_modules/carepoint/models/cph/patient_allergy.html new file mode 100644 index 0000000..159b741 --- /dev/null +++ b/_modules/carepoint/models/cph/patient_allergy.html @@ -0,0 +1,195 @@ + + + + + + + carepoint.models.cph.patient_allergy — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.models.cph.patient_allergy

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+from carepoint import Carepoint
+from sqlalchemy import (Column,
+                        Integer,
+                        String,
+                        Text,
+                        DateTime,
+                        ForeignKey,
+                        )
+
+
+
[docs]class PatientAllergy(Carepoint.BASE): + __tablename__ = 'cppat_alr' + __dbname__ = 'cph' + + ptalr_id = Column( + Integer, + primary_key=True, + ) + pat_id = Column( + Integer, + ForeignKey('cppat.pat_id'), + ) + name = Column( + String(60), + ) + hicl_seqno = Column( + Integer, + ForeignKey('fdrhiclsq.hicl_seqno'), + ) + hic = Column( + String(6), + ForeignKey('fdrhicd.hic'), + ) + dam_agcsp = Column( + Integer, + ForeignKey('fdrdamagd.dam_agcsp'), + ) + alr_type_cn = Column( + Integer, + ) + onset_date = Column( + DateTime, + ) + resolution_status_cn = Column( + Integer, + ) + resolution_date = Column( + DateTime, + ) + screen_yn = Column( + Integer, + ) + cmt = Column( + Text, + ) + status_cn = Column( + Integer, + ) + app_flags = Column( + Integer, + ) + timestmp = Column( + DateTime, + ) + ncd = Column( + String(11), + ) + add_user_id = Column( + Integer, + ForeignKey('csuser.user_id'), + ) + add_date = Column(DateTime) + chg_user_id = Column( + Integer, + ForeignKey('csuser.user_id'), + ) + chg_date = Column( + DateTime, + )
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/models/cph/patient_disease.html b/_modules/carepoint/models/cph/patient_disease.html new file mode 100644 index 0000000..e59a77c --- /dev/null +++ b/_modules/carepoint/models/cph/patient_disease.html @@ -0,0 +1,169 @@ + + + + + + + carepoint.models.cph.patient_disease — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.models.cph.patient_disease

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+from carepoint import Carepoint
+from sqlalchemy import (Column,
+                        Integer,
+                        String,
+                        DateTime,
+                        ForeignKey,
+                        Text,
+                        )
+
+
+
[docs]class PatientDisease(Carepoint.BASE): + __tablename__ = 'cppat_dx' + __dbname__ = 'cph' + + ptdx_id = Column( + Integer, + primary_key=True, + autoincrement=False, + ) + pat_id = Column( + Integer, + ForeignKey('cppat.pat_id'), + ) + fdbdx = Column(String) + icd9 = Column(String) + name = Column(String) + dx_date = Column(DateTime) + caring_md_id = Column( + Integer, + ForeignKey('cpmd.md_id'), + ) + onset_date = Column(DateTime) + resolution_status_cn = Column(Integer) + screen_yn = Column(Integer) + mar_cmt = Column(Text) + cmt = Column(Text) + status_cn = Column(Integer) + app_flags = Column(Integer) + timestmp = Column(DateTime) + primary_yn = Column(Integer) + dxid = Column(Integer) + icd10 = Column(String) + icd10_name = Column(String) + add_user_id = Column( + Integer, + ForeignKey('csuser.user_id'), + ) + add_date = Column(DateTime) + chg_user_id = Column( + Integer, + ForeignKey('csuser.user_id'), + ) + chg_date = Column(DateTime)
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/models/cph/patient_phone.html b/_modules/carepoint/models/cph/patient_phone.html new file mode 100644 index 0000000..7800911 --- /dev/null +++ b/_modules/carepoint/models/cph/patient_phone.html @@ -0,0 +1,131 @@ + + + + + + + carepoint.models.cph.patient_phone — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.models.cph.patient_phone

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+from carepoint import Carepoint
+from carepoint.models.phone_mixin import PhoneMixin
+from sqlalchemy import (Column,
+                        Integer,
+                        )
+
+
+
[docs]class PatientPhone(PhoneMixin, Carepoint.BASE): + __dbname__ = 'cph' + __tablename__ = 'cppat_phone' + pat_id = Column( + Integer, + primary_key=True, + autoincrement=False, + )
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/models/cph/phone.html b/_modules/carepoint/models/cph/phone.html new file mode 100644 index 0000000..434f17d --- /dev/null +++ b/_modules/carepoint/models/cph/phone.html @@ -0,0 +1,158 @@ + + + + + + + carepoint.models.cph.phone — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.models.cph.phone

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+from carepoint import Carepoint
+from sqlalchemy import (Column,
+                        Integer,
+                        String,
+                        DateTime,
+                        Boolean,
+                        ForeignKey,
+                        )
+
+
+
[docs]class Phone(Carepoint.BASE): + __tablename__ = 'csphone' + __dbname__ = 'cph' + + phone_id = Column( + Integer, + primary_key=True, + autoincrement=False, + ) + parent_phone_id = Column( + Integer, + ForeignKey('csphone.phone_id'), + ) + inherited_yn = Column(Boolean) + owner_type_cn = Column(Integer) + area_code = Column(String) + phone_no = Column(String) + extension = Column(String) + when_in_use = Column(String) + anote = Column(String) + app_flags = Column(Integer) + timestmp = Column(DateTime) + add_user_id = Column( + Integer, + ForeignKey('csuser.user_id'), + ) + add_date = Column(DateTime) + chg_user_id = Column( + Integer, + ForeignKey('csuser.user_id'), + ) + chg_date = Column(DateTime)
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/models/cph/prescription.html b/_modules/carepoint/models/cph/prescription.html new file mode 100644 index 0000000..659e7c7 --- /dev/null +++ b/_modules/carepoint/models/cph/prescription.html @@ -0,0 +1,260 @@ + + + + + + + carepoint.models.cph.prescription — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.models.cph.prescription

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+from carepoint import Carepoint
+from sqlalchemy import (Column,
+                        Integer,
+                        String,
+                        DateTime,
+                        Boolean,
+                        ForeignKey,
+                        Numeric,
+                        Text,
+                        )
+
+
+
[docs]class Prescription(Carepoint.BASE): + __tablename__ = 'cprx' + __dbname__ = 'cph' + + rx_id = Column( + Integer, + primary_key=True, + autoincrement=False, + ) + script_no = Column(String) + old_script_no = Column(String) + pat_id = Column( + Integer, + ForeignKey('cppat.pat_id'), + ) + store_id = Column( + Integer, + ForeignKey('csstore.store_id'), + ) + md_id = Column( + Integer, + ForeignKey('cpmd.md_id'), + ) + ndc = Column(String) + gcn_seqno = Column(Integer) + mfg = Column(String) + drug_name = Column(String) + input_src_cn = Column(Integer) + src_pat_meds_cn = Column(Integer) + start_date = Column(DateTime) + expire_date = Column(DateTime) + stop_date = Column(DateTime) + sig_code = Column(String) + sig_text = Column(String) + written_qty = Column(Numeric) + starter_qty = Column(Numeric) + days_supply = Column(Numeric) + pkg_size = Column(Numeric) + units_per_dose = Column(Numeric) + units_entered = Column(String) + awp = Column(Numeric) + udef = Column(Numeric) + ful = Column(Numeric) + mac = Column(Numeric) + aac = Column(Numeric) + freq_entered = Column(String) + freq_of_admin = Column(Numeric) + sched_of_admin_cn = Column(Integer) + daw_yn = Column(Boolean) + refills_orig = Column(Numeric) + refills_left = Column(Numeric) + last_rxdisp_id = Column( + Integer, + ForeignKey('cprx_disp.rxdisp_id'), + ) + last_refill_qty = Column(Numeric) + last_refill_date = Column(DateTime) + refill_date = Column(DateTime) + src_org_id = Column( + Integer, + ForeignKey('csorg.org_id'), + ) + cmt = Column(Text) + exit_state_cn = Column(Integer) + script_status_cn = Column(Integer) + sched_date = Column(DateTime) + sched_time = Column(DateTime) + scheduled_yn = Column(Boolean) + drug_dea_class = Column(String) + manual_add_yn = Column(Boolean) + status_cn = Column(Integer) + life_date = Column(DateTime) + self_prescribed_yn = Column(Boolean) + last_transfer_type_io = Column(String) + last_disp_prod = Column(String) + transfer_cnt = Column(Numeric) + wc_claim_id = Column(String) + injury_date = Column(DateTime) + gpi_rx = Column(Integer) + auth_by = Column(String) + orig_disp_date = Column(DateTime) + short_term_yn = Column(Integer) + orig_date = Column(DateTime) + refills_used = Column(Numeric) + wc_emp_id = Column(Integer) + dose_unit = Column(String) + dosage_multiplier = Column(Numeric) + df = Column(String) + uu = Column(String) + app_flags = Column(Integer) + timestmp = Column(DateTime) + sched2_no = Column(String) + orig_expire_date = Column(DateTime) + rxq_status_cn = Column(Integer) + IVRCmt = Column(String) + wc_bodypart = Column(String) + comp_ndc = Column(String) + treatment_yn = Column(Boolean) + ivr_callback = Column(String) + autofill_yn = Column(Boolean) + autofill_resume_date = Column(DateTime) + workflow_status_cn = Column(Integer) + extern_process_cn = Column(Integer) + md_fac_id = Column(Integer) + owner_store_id = Column(Integer) + study_id = Column(Integer) + min_days_until_refill = Column(Integer) + sig_text_english = Column(String) + order_fullfillment_cn = Column(Integer) + taxable = Column(Integer) + MAR_flag = Column(Integer) + FreeFormStrength = Column(String) + priority_cn = Column(Integer) + ecs_yn = Column(Boolean) + edit_locked_yn = Column(Boolean) + locked_yn = Column(Boolean) + locked_id = Column(Integer) + locked_user_id = Column( + Integer, + ForeignKey('csuser.user_id'), + ) + daw_rx_cn = Column(Integer) + add_user_id = Column( + Integer, + ForeignKey('csuser.user_id'), + ) + add_date = Column(DateTime) + chg_user_id = Column( + Integer, + ForeignKey('csuser.user_id'), + ) + chg_date = Column(DateTime)
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/models/cph/store.html b/_modules/carepoint/models/cph/store.html new file mode 100644 index 0000000..1fe3f76 --- /dev/null +++ b/_modules/carepoint/models/cph/store.html @@ -0,0 +1,166 @@ + + + + + + + carepoint.models.cph.store — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.models.cph.store

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+from carepoint import Carepoint
+from sqlalchemy import (Column,
+                        Integer,
+                        String,
+                        DateTime,
+                        Boolean,
+                        ForeignKey,
+                        Text,
+                        )
+
+
+
[docs]class Store(Carepoint.BASE): + __tablename__ = 'csstore' + __dbname__ = 'cph' + + store_id = Column( + Integer, + primary_key=True, + autoincrement=False, + ) + store_type_cn = Column(Integer) + name = Column(String) + store_hours = Column(String) + store_no = Column(String) + fed_tax_id = Column(String) + url = Column(String) + email = Column(String) + mgr_cont_id = Column(Integer) + cont_id = Column(Integer) + carepoint_acct_no = Column(String) + cmt = Column(Text) + status_cn = Column(Integer) + app_flags = Column(Integer) + nabp = Column(String) + medicaid_no = Column(String) + timestmp = Column(DateTime) + region_id = Column(Integer) + NPI = Column(String) + pharmacy_service_type_cn = Column(Integer) + web_refill_yn = Column(Boolean) + add_user_id = Column( + Integer, + ForeignKey('csuser.user_id'), + ) + add_date = Column(DateTime) + chg_user_id = Column( + Integer, + ForeignKey('csuser.user_id'), + ) + chg_date = Column(DateTime)
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/models/cph/store_address.html b/_modules/carepoint/models/cph/store_address.html new file mode 100644 index 0000000..d6ae36b --- /dev/null +++ b/_modules/carepoint/models/cph/store_address.html @@ -0,0 +1,131 @@ + + + + + + + carepoint.models.cph.store_address — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.models.cph.store_address

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+from carepoint import Carepoint
+from carepoint.models.address_mixin import AddressMixin
+from sqlalchemy import (Column,
+                        Integer,
+                        )
+
+
+
[docs]class StoreAddress(AddressMixin, Carepoint.BASE): + __dbname__ = 'cph' + __tablename__ = 'csstore_addr' + store_id = Column( + Integer, + primary_key=True, + autoincrement=False, + )
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/models/cph/store_param.html b/_modules/carepoint/models/cph/store_param.html new file mode 100644 index 0000000..1663691 --- /dev/null +++ b/_modules/carepoint/models/cph/store_param.html @@ -0,0 +1,138 @@ + + + + + + + carepoint.models.cph.store_param — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.models.cph.store_param

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+from carepoint import Carepoint
+from sqlalchemy import (Column,
+                        Integer,
+                        String,
+                        DateTime,
+                        ForeignKey,
+                        )
+
+
+
[docs]class StoreParam(Carepoint.BASE): + __tablename__ = 'csstore_param' + __dbname__ = 'cph' + + param_code = Column(String, primary_key=True) + store_id = Column( + Integer, + ForeignKey('csstore.store_id'), + ) + descr = Column(String) + data_value = Column(String) + app_flags = Column(Integer) + timestmp = Column(DateTime)
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/models/cph/store_phone.html b/_modules/carepoint/models/cph/store_phone.html new file mode 100644 index 0000000..696e149 --- /dev/null +++ b/_modules/carepoint/models/cph/store_phone.html @@ -0,0 +1,131 @@ + + + + + + + carepoint.models.cph.store_phone — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.models.cph.store_phone

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+from carepoint import Carepoint
+from carepoint.models.phone_mixin import PhoneMixin
+from sqlalchemy import (Column,
+                        Integer,
+                        )
+
+
+
[docs]class StorePhone(PhoneMixin, Carepoint.BASE): + __dbname__ = 'cph' + __tablename__ = 'csstore_phone' + store_id = Column( + Integer, + primary_key=True, + autoincrement=False, + )
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/models/cph/user.html b/_modules/carepoint/models/cph/user.html new file mode 100644 index 0000000..1f3956c --- /dev/null +++ b/_modules/carepoint/models/cph/user.html @@ -0,0 +1,185 @@ + + + + + + + carepoint.models.cph.user — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.models.cph.user

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+import enum
+
+from carepoint import Carepoint
+from sqlalchemy import (Column,
+                        Integer,
+                        String,
+                        DateTime,
+                        ForeignKey,
+                        Text,
+                        )
+
+
+
[docs]class EnumUserType(enum.Enum): + """ It provides PEP-0435 compliant Carepoint User Type Enumerable """ + + user = 'U' + group = 'G' + machine = 'M'
+ + +
[docs]class User(Carepoint.BASE): + __tablename__ = 'csuser' + __dbname__ = 'cph' + + user_id = Column( + Integer, + primary_key=True, + autoincrement=False, + ) + user_type_cd = Column(String) + login_name = Column(String) + lname = Column(String) + fname = Column(String) + mname = Column(String) + title_lu = Column(String) + suffix_lu = Column(String) + degree_lu = Column(String) + initials = Column(String) + job_title_lu = Column(String) + anote = Column(String) + employee_no = Column(String) + ssn = Column(String) + last_login_date = Column(DateTime) + email = Column(String) + db_password = Column(String) + es_password = Column(String) + cmt = Column(Text) + system_yn = Column(Integer) + license_no = Column(String) + license_state_cd = Column(String) + status_cn = Column(Integer) + app_flags = Column(Integer) + timestmp = Column(DateTime) + must_change_password_yn = Column(Integer) + password_date = Column(DateTime) + add_user_id = Column( + Integer, + ForeignKey('csuser.user_id'), + ) + add_date = Column(DateTime) + chg_user_id = Column( + Integer, + ForeignKey('csuser.user_id'), + ) + chg_date = Column(DateTime) + + @property + def user_type(self): + return EnumUserType(self.user_type_cd)
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/models/cph/vendor.html b/_modules/carepoint/models/cph/vendor.html new file mode 100644 index 0000000..961354c --- /dev/null +++ b/_modules/carepoint/models/cph/vendor.html @@ -0,0 +1,171 @@ + + + + + + + carepoint.models.cph.vendor — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.models.cph.vendor

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+from carepoint import Carepoint
+from sqlalchemy import (Column,
+                        Integer,
+                        String,
+                        DateTime,
+                        ForeignKey,
+                        )
+
+
+
[docs]class Vendor(Carepoint.BASE): + __dbname__ = 'cph' + __tablename__ = 'VEND' + + ID = Column( + Integer, + primary_key=True, + autoincrement=False, + ) + COMPANY = Column(String) + ADDR1 = Column(String) + ADDR2 = Column(String) + CITY = Column(String) + STATE = Column(String) + ZIP = Column(String) + FEDID = Column(String) + CONTACT = Column(String) + PHONE = Column(String) + ISSUE1099 = Column(String) + ONETIME = Column(String) + FAX = Column(String) + ACCT = Column(String) + TERMS = Column(String) + COSTTYPE = Column(Integer) + compound_vendor_yn = Column(String) + POPrefix = Column(String) + po_alpha_align_cn = Column(Integer) + po_alpha_used = Column(String) + po_next_id_int = Column(Integer) + DocumentNumber = Column(String) + NumberOfDigits = Column(Integer) + LastPODate = Column(DateTime) + DocCounter = Column(Integer) + grid_color = Column(Integer) + bold_yn = Column(Integer) + italic_yn = Column(Integer) + add_user_id = Column( + Integer, + ForeignKey('csuser.user_id'), + ) + add_date = Column(DateTime) + chg_user_id = Column( + Integer, + ForeignKey('csuser.user_id'), + ) + chg_date = Column(DateTime)
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/models/phone_mixin.html b/_modules/carepoint/models/phone_mixin.html new file mode 100644 index 0000000..3287aa0 --- /dev/null +++ b/_modules/carepoint/models/phone_mixin.html @@ -0,0 +1,162 @@ + + + + + + + carepoint.models.phone_mixin — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.models.phone_mixin

+# -*- coding: utf-8 -*-
+# Copyright 2016 LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+import enum
+
+from sqlalchemy import (Column,
+                        Integer,
+                        DateTime,
+                        ForeignKey,
+                        )
+from sqlalchemy.types import Enum
+from sqlalchemy.ext.declarative import declared_attr
+
+
+
[docs]class EnumPhoneType(enum.Enum): + """ It provides PEP-0435 compliant Carepoint Phone Type Enumerable """ + + assistant = 1 + business = 2 + business_2 = 3 + business_fax = 4 + car = 5 + home = 6 + home_2 = 7 + home_fax = 8 + mobile = 9 + beeper = 10 + other_fax = 11
+ + +
[docs]class PhoneMixin(object): + """ This is a mixin for Phone Many2Many bindings """ + + priority = Column(Integer) + phone_type_cn = Column(Integer) + app_flags = Column(Integer) + timestmp = Column(DateTime) + + @declared_attr + def phone_id(cls): + return Column( + Integer, + ForeignKey('csphone.phone_id'), + primary_key=True, + ) + + @property + def phone_type(self): + return EnumPhoneType(self.phone_type_cn)
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/models/state.html b/_modules/carepoint/models/state.html new file mode 100644 index 0000000..39fde17 --- /dev/null +++ b/_modules/carepoint/models/state.html @@ -0,0 +1,129 @@ + + + + + + + carepoint.models.state — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.models.state

+# -*- coding: utf-8 -*-
+# Copyright 2016 LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+import enum
+
+
+
[docs]class EnumOrderState(enum.Enum): + """ It provides PEP-0435 compliant Carepoint State Enumerable """ + + entered = 10 + verified = 20 + adjudicated = 30 + processed = 35 + approved = 40 + shipped = 50 + returned = 60
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/tests/db/db.html b/_modules/carepoint/tests/db/db.html new file mode 100644 index 0000000..83f9ad5 --- /dev/null +++ b/_modules/carepoint/tests/db/db.html @@ -0,0 +1,143 @@ + + + + + + + carepoint.tests.db.db — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.tests.db.db

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+import unittest
+from carepoint.db import Db, Carepoint
+from sqlalchemy.orm.session import Session
+
+
+
[docs]class DatabaseTest(unittest.TestCase): + +
[docs] @classmethod + def setUpClass(cls, ): + cls.engine = Db(drv=Db.SQLITE) + cls.connection = cls.engine.connect() + cls.transaction = cls.connection.begin() + Carepoint.BASE.metadata.create_all(cls.connection)
+ +
[docs] @classmethod + def tearDownClass(cls, ): + # cls.transaction.rollback() + cls.connection.close() + cls.engine.dispose()
+ +
[docs] def setUp(self, ): + self.__transaction = self.connection.begin_nested() + self.session = Session(self.connection)
+ +
[docs] def tearDown(self, ): + self.session.close()
+ # self.__transaction.rollback() +
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/tests/db/test_carepoint.html b/_modules/carepoint/tests/db/test_carepoint.html new file mode 100644 index 0000000..925e067 --- /dev/null +++ b/_modules/carepoint/tests/db/test_carepoint.html @@ -0,0 +1,773 @@ + + + + + + + carepoint.tests.db.test_carepoint — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.tests.db.test_carepoint

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+import os
+import unittest
+import mock
+from contextlib import contextmanager
+
+from carepoint import Carepoint
+
+
+
[docs]class EndTestException(Exception): + pass
+ + +
[docs]class CarepointTest(unittest.TestCase): + + MODEL_DIR = os.path.join(os.path.dirname(__file__), 'test_models') + +
[docs] @mock.patch('carepoint.db.carepoint.Db') + def setUp(self, db_mock): + self.cp_args = { + 'user': 'User', + 'passwd': 'Passwd', + 'server': 'Server', + } + cp = Carepoint(**self.cp_args) + cp.register_model_dir(self.MODEL_DIR) + self.carepoint = cp + self.db_mock = db_mock
+ + def __get_model_obj(self): + self.carepoint.find_models() + model_obj = self.carepoint['TestModel'] + return model_obj + + @contextmanager + def __get_mock_session(self, unwrapped=True): + with mock.patch.object(self.carepoint, '_get_model_session') as mk: + enter, session = mock.MagicMock(), mock.MagicMock() + enter.return_value = enter + mk.return_value = session + session.__enter__.return_value = enter + yield enter if unwrapped else mk + + # + # Test Initializations and other core stuff + # + +
[docs] @mock.patch('carepoint.db.carepoint.Db') + @mock.patch('carepoint.db.carepoint.super') + def test_carepoint_init(self, sup_mk, db_mk): + cp = Carepoint(**self.cp_args) + sup_mk.assert_called_once_with(Carepoint, cp)
+ +
[docs] def test_carepoint_initial_iter_refresh(self): + self.assertFalse( + self.carepoint.iter_refresh + )
+ +
[docs] def test_carepoint_assigns_instance_env(self): + self.assertTrue( + self.carepoint.env['cph'], + )
+ +
[docs] def test_cph_db_init(self): + self.assertTrue( + self.carepoint.dbs['cph'] + )
+ +
[docs] def test_cph_db_assign(self): + self.carepoint.dbs['cph'] = self.db_mock
+ +
[docs] def test_carepoint_assigns_db_params(self): + """ It should assign the database params as an instance var """ + self.assertIsInstance(self.carepoint.db_params, dict)
+ +
[docs] def test_non_dir(self): + ''' + Test to make sure that an EnvironmentError is raised with an + invalid model dir + ''' + with self.assertRaises(EnvironmentError): + self.carepoint.register_model_dir( + os.path.join(self.MODEL_DIR, 'not_a_dir'))
+ +
[docs] def test_model_import_getitem(self): + ''' Test if model is correctly initialized ''' + self.carepoint.find_models() + result = self.carepoint.get('TestModel', None) + self.assertNotEqual(result, None)
+ +
[docs] def test_model_import_getattr(self): + ''' Test if model is correctly initialized ''' + self.carepoint.find_models() + self.assertIn('TestModel', self.carepoint)
+ +
[docs] def test_model_methods(self): + ''' Test if model is correctly initialized ''' + self.carepoint.set_iter_refresh() + model_obj = self.carepoint['TestModel'] + self.assertTrue(model_obj.run()) # < classmethods are exposed
+ +
[docs] def test_init_env_clear(self): + """ It should clear the global environment when True """ + with mock.patch.object(self.carepoint, 'dbs') as dbs: + dbs.clear.side_effect = EndTestException + with self.assertRaises(EndTestException): + self.carepoint._init_env(True)
+ + # + # Test the session handler + # + +
[docs] def test_get_model_session_gets_session(self): + """ It should get session for the database """ + model_obj = self.__get_model_obj() + with mock.patch.object(self.carepoint, 'env') as env: + with self.carepoint._get_model_session(model_obj): + pass + env[model_obj.__dbname__].assert_called_once_with()
+ +
[docs] def test_get_model_session_yields_session(self): + """ It should yield session for the database """ + model_obj = self.__get_model_obj() + with mock.patch.object(self.carepoint, 'env') as env: + with self.carepoint._get_model_session(model_obj) as res: + self.assertEqual( + env[model_obj.__dbname__](), + res, + )
+ +
[docs] def test_get_model_session_commit(self): + """ It should commit session after yield """ + model_obj = self.__get_model_obj() + with mock.patch.object(self.carepoint, 'env') as env: + with self.carepoint._get_model_session(model_obj): + pass + env[model_obj.__dbname__]().commit.assert_called_once_with()
+ +
[docs] def test_get_model_session_rollback(self): + """ It should roll session back on error """ + model_obj = self.__get_model_obj() + with mock.patch.object(self.carepoint, 'env') as env: + env[model_obj.__dbname__]().commit.side_effect = EndTestException + with self.assertRaises(EndTestException): + with self.carepoint._get_model_session(model_obj): + pass + env[model_obj.__dbname__]().rollback.assert_called_once_with()
+ +
[docs] def test_get_model_session_close(self): + """ It should always close session """ + model_obj = self.__get_model_obj() + with mock.patch.object(self.carepoint, 'env') as env: + with self.carepoint._get_model_session(model_obj): + pass + env[model_obj.__dbname__]().close.assert_called_once_with()
+ + # + # Test the SMB handlers + # + +
[docs] def test_smb_prefix(self): + expect = 'smb://%s:%s@' % (self.cp_args['user'], + self.cp_args['passwd']) + self.assertEqual( + expect, self.carepoint._smb_prefix, + 'SMB prefix not correct. Expect %s - Got %s' % ( + expect, self.carepoint._smb_prefix, + ) + )
+ +
[docs] @mock.patch('carepoint.db.carepoint.urllib2') + @mock.patch('carepoint.db.carepoint.SMBHandler') + def test_get_file_builds_opener(self, smb_mk, url_mk): + self.carepoint.get_file('expect') + url_mk.build_opener.assert_called_once_with(smb_mk)
+ +
[docs] @mock.patch('carepoint.db.carepoint.urllib2') + @mock.patch('carepoint.db.carepoint.SMBHandler') + def test_get_file_opens_uri(self, smb_mk, url_mk): + expect = 'Test' + self.carepoint.get_file(expect) + url_mk.build_opener().open.assert_called_once_with( + '%s%s' % (self.carepoint._smb_prefix, expect) + )
+ +
[docs] @mock.patch('carepoint.db.carepoint.urllib2') + @mock.patch('carepoint.db.carepoint.SMBHandler') + def test_get_file_returns_opened_handler(self, smb_mk, url_mk): + expect = 'Test' + res = self.carepoint.get_file(expect) + self.assertEqual( + url_mk.build_opener().open(), res, + )
+ +
[docs] @mock.patch('carepoint.db.carepoint.urllib2') + @mock.patch('carepoint.db.carepoint.SMBHandler') + def test_send_file_builds_opener(self, smb_mk, url_mk): + self.carepoint.send_file('expect', '') + url_mk.build_opener.assert_called_once_with(smb_mk)
+ +
[docs] @mock.patch('carepoint.db.carepoint.urllib2') + @mock.patch('carepoint.db.carepoint.SMBHandler') + def test_send_file_sends_file(self, smb_mk, url_mk): + expect = 'Test' + data = 'data' + self.carepoint.send_file(expect, data) + url_mk.build_opener().__enter__().open.assert_called_once_with( + '%s%s' % (self.carepoint._smb_prefix, expect), data=data, + )
+ +
[docs] @mock.patch('carepoint.db.carepoint.urllib2') + @mock.patch('carepoint.db.carepoint.SMBHandler') + def test_send_file_returns_true(self, smb_mk, url_mk): + res = self.carepoint.send_file('expect', '') + self.assertTrue(res)
+ + # + # Test the database convenience handlers + # + + # Read + +
[docs] def test_read_calls_query_with_model_obj(self): + model_obj = self.__get_model_obj() + record_id = 1 + with self.__get_mock_session() as mk: + self.carepoint.read(model_obj, record_id) + mk.query.assert_called_once_with(model_obj)
+ +
[docs] def test_read_calls_get_with_record_id(self): + model_obj = self.__get_model_obj() + record_id = 1 + with self.__get_mock_session() as mk: + mk.query.return_value = query_mk = mock.MagicMock() + self.carepoint.read(model_obj, record_id) + query_mk.get.assert_called_once_with(record_id)
+ +
[docs] def test_read_returns_response(self): + model_obj = self.__get_model_obj() + record_id = 1 + expect = 'Response' + with self.__get_mock_session() as mk: + mk.query.return_value = query_mk = mock.MagicMock() + query_mk.get.return_value = expect + response = self.carepoint.read(model_obj, record_id) + self.assertEqual(response, expect)
+ + # Search +
[docs] def test_search_calls_query_with_model_obj(self): + filters = {'test_col': 'Test'} + with self.__get_mock_session() as mk: + model_obj = self.__get_model_obj() + self.carepoint.search(model_obj, filters) + mk.query.assert_called_once_with(model_obj)
+ +
[docs] def test_search_calls_filter_with_filters(self): + model_obj = self.__get_model_obj() + filters = {'test_col': 'Test'} + with self.__get_mock_session() as mk: + mk.query.return_value = query_mk = mock.MagicMock() + self.carepoint.search(model_obj, filters) + query_mk.filter.assert_called_once_with( + *self.carepoint._unwrap_filters(model_obj, filters) + )
+ +
[docs] def test_search_calls_filter_when_no_filters(self): + model_obj = self.__get_model_obj() + with self.__get_mock_session() as mk: + mk.query.return_value = query_mk = mock.MagicMock() + self.carepoint.search(model_obj) + query_mk.filter.assert_called_once_with(**{})
+ +
[docs] def test_search_returns_response(self): + model_obj = self.__get_model_obj() + filters = {'test_col': 'Test'} + with self.__get_mock_session() as mk: + with mock.patch.object(self.carepoint, 'read') as read_mk: + response = self.carepoint.read(model_obj, filters) + self.assertEqual( + read_mk(), + response, + )
+ + # Get Next Sequence + +
[docs] def test_get_next_sequence_session(self): + """ It should get session for db """ + expect = 'expect' + with mock.patch.object(self.carepoint, '_get_session') as mk: + res = self.carepoint.get_next_sequence(None, expect) + mk.assert_called_once_with(expect)
+ +
[docs] @mock.patch('carepoint.db.carepoint.text') + def test_get_next_sequence_execute(self, text): + """ It should execute stored procedure on connection """ + expect = 'expect' + with mock.patch.object(self.carepoint, '_get_session') as mk: + self.carepoint.get_next_sequence(expect) + mk().__enter__().connection().execute.assert_called_once_with( + text(), seq_name=expect, + )
+ +
[docs] def test_get_next_sequence_fetch(self): + """ It should return result of fetch """ + with mock.patch.object(self.carepoint, '_get_session') as mk: + res = self.carepoint.get_next_sequence(None) + expect = mk().__enter__().connection().execute().fetchall()[0][0] + self.assertEqual( + expect, res, + )
+ + # Create +
[docs] def test_create_calls_get_model_session_with_model_obj(self): + model_obj = mock.MagicMock() + with self.__get_mock_session(False) as mk: + self.carepoint.create(model_obj, {}) + mk.assert_called_once_with(model_obj)
+ +
[docs] def test_create_initializes_new_model_obj_with_vals(self): + model_obj = mock.MagicMock() + vals = {'test_col': 'Test'} + with self.__get_mock_session() as mk: + self.carepoint.create(model_obj, vals) + model_obj.assert_called_once_with(**vals)
+ +
[docs] def test_create_adds_new_record_to_session(self): + model_obj = mock.MagicMock() + response_expect = 'ResponseExpect' + model_obj.return_value = response_expect + vals = {'test_col': 'Test'} + with self.__get_mock_session() as mk: + self.carepoint.create(model_obj, vals) + mk.add.assert_called_once_with(response_expect)
+ +
[docs] def test_create_returns_new_record(self): + model_obj = mock.MagicMock() + response_expect = 'ResponseExpect' + model_obj.return_value = response_expect + vals = {'test_col': 'Test'} + with self.__get_mock_session() as mk: + response = self.carepoint.create(model_obj, vals) + self.assertEqual(response, response_expect)
+ + # Update +
[docs] def test_update_calls_get_model_session_with_model_obj(self): + model_obj = self.__get_model_obj() + record_id = 1 + with self.__get_mock_session(False) as mk: + with mock.patch.object(self.carepoint, 'read'): + self.carepoint.update(model_obj, record_id, {}) + mk.assert_called_once_with(model_obj)
+ +
[docs] def test_update_calls_read_with_model_and_record_id(self): + model_obj = self.__get_model_obj() + record_id = 1 + vals = {'test_col': 'Test'} + with self.__get_mock_session(): + with mock.patch.object(self.carepoint, 'read') as read_mk: + self.carepoint.update(model_obj, record_id, vals) + read_mk.assert_called_once_with(model_obj, record_id)
+ +
[docs] def test_update_calls_update_with_vals(self): + model_obj = self.__get_model_obj() + record_id = 1 + vals = {'test_col': 'Test'} + with self.__get_mock_session() as mk: + mk.query.return_value = query_mk = mock.MagicMock() + query_mk.get.return_value = get_mk = mock.MagicMock() + self.carepoint.update(model_obj, record_id, vals) + self.assertEqual( + mk().query().get().test_col, + get_mk.test_col, + 'Record attribute was not updated. Expect Test, Got %s' % ( + get_mk.test_col, + ) + )
+ +
[docs] def test_update_returns_record(self): + model_obj = self.__get_model_obj() + record_id = 1 + vals = {'test_col': 'Test'} + with self.__get_mock_session() as mk: + with mock.patch.object(self.carepoint, 'read') as read: + response = self.carepoint.update(model_obj, record_id, vals) + self.assertEqual(read(), response)
+ + # Delete +
[docs] def test_delete_calls_get_model_session_with_model_obj(self): + model_obj = self.__get_model_obj() + record_id = 1 + with self.__get_mock_session(False) as mk: + with mock.patch.object(self.carepoint, 'read') as read_mk: + read_mk.return_value = read_mk + read_mk.count.return_value = 0 + self.carepoint.delete(model_obj, record_id) + mk.assert_called_once_with(model_obj)
+ +
[docs] def test_delete_calls_read_with_model_and_record_id(self): + model_obj = self.__get_model_obj() + record_id = 1 + with self.__get_mock_session(): + with mock.patch.object(self.carepoint, 'read') as read_mk: + read_mk.return_value = read_mk + read_mk.count.return_value = 0 + self.carepoint.delete(model_obj, record_id) + read_mk.assert_called_once_with(model_obj, record_id)
+ +
[docs] def test_delete_asserts_result_count_eq_1(self): + model_obj = self.__get_model_obj() + record_id = 1 + with self.__get_mock_session(): + with mock.patch.object(self.carepoint, 'read') as read_mk: + read_mk.return_value = read_mk + read_mk.count.return_value = 2 + with self.assertRaises(AssertionError): + self.carepoint.delete(model_obj, record_id)
+ +
[docs] def test_delete_calls_session_delete_with_record_result(self): + model_obj = self.__get_model_obj() + record_id = 1 + expect_return = mock.MagicMock() + with self.__get_mock_session() as mk: + with mock.patch.object(self.carepoint, 'read') as read_mk: + read_mk.return_value = expect_return + expect_return.count.return_value = 1 + self.carepoint.delete(model_obj, record_id) + mk.delete.assert_called_once_with(expect_return)
+ +
[docs] def test_delete_returns_false_on_no_records(self): + model_obj = self.__get_model_obj() + record_id = 1 + with self.__get_mock_session(): + with mock.patch.object(self.carepoint, 'read') as read_mk: + read_mk.return_value = read_mk + read_mk.count.return_value = 0 + response = self.carepoint.delete(model_obj, record_id) + self.assertFalse(response)
+ +
[docs] def test_delete_returns_true_on_delete(self): + model_obj = self.__get_model_obj() + record_id = 1 + with self.__get_mock_session(): + with mock.patch.object(self.carepoint, 'read') as read_mk: + read_mk.return_value = read_mk + read_mk.count.return_value = 1 + response = self.carepoint.delete(model_obj, record_id) + self.assertTrue(response)
+ + # + # Test filter criterion generators + # + + def __setup_criterion_test(self, operator, query='Query'): + self.carepoint.find_models() + model_obj = self.carepoint['TestModel'] + attr_name = 'test_col' + col_obj = getattr(model_obj, attr_name) + return [col_obj, model_obj, attr_name, operator, query] + +
[docs] def test_create_criterion_returns_correct_double_eq(self): + args = self.__setup_criterion_test('==') + self.assertEqual( + self.carepoint._create_criterion(*args[1:]), + args[0] == args[-1] + )
+ +
[docs] def test_create_criterion_returns_correct_eq(self): + args = self.__setup_criterion_test('=') + self.assertEqual( + self.carepoint._create_criterion(*args[1:]), + args[0] == args[-1] + )
+ +
[docs] def test_create_criterion_returns_correct_lt(self): + args = self.__setup_criterion_test('<') + self.assertEqual( + self.carepoint._create_criterion(*args[1:]), + args[0] < args[-1] + )
+ +
[docs] def test_create_criterion_returns_correct_le(self): + args = self.__setup_criterion_test('<=') + self.assertEqual( + self.carepoint._create_criterion(*args[1:]), + args[0] <= args[-1] + )
+ +
[docs] def test_create_criterion_returns_correct_gt(self): + args = self.__setup_criterion_test('>') + self.assertEqual( + self.carepoint._create_criterion(*args[1:]), + args[0] > args[-1] + )
+ +
[docs] def test_create_criterion_returns_correct_ge(self): + args = self.__setup_criterion_test('>=') + self.assertEqual( + self.carepoint._create_criterion(*args[1:]), + args[0] >= args[-1] + )
+ +
[docs] def test_create_criterion_raises_not_implemented_error(self): + args = self.__setup_criterion_test('===') + with self.assertRaises(KeyError): + self.carepoint._create_criterion(*args[1:])
+ +
[docs] def test_create_criterion_raises_attribute_error(self): + args = self.__setup_criterion_test('==') + args[2] = 'Nope' + with self.assertRaises(AttributeError): + self.carepoint._create_criterion(*args[1:])
+ + # + # Test filter dictionary unwrapping + # + +
[docs] def test_unwrap_filters_empty(self): + model_obj = self.__get_model_obj() + expect = [] + self.assertEqual( + self.carepoint._unwrap_filters(model_obj, {}), expect, + )
+ +
[docs] def test_unwrap_filters_none(self): + model_obj = self.__get_model_obj() + expect = [] + self.assertEqual( + self.carepoint._unwrap_filters(model_obj), expect, + )
+ +
[docs] def test_unwrap_filters_dict(self): + model_obj = self.__get_model_obj() + col_expect = 'test_col' + query_expect = ['test_1', 'test_2', ] + ops_expect = ['>=', '==', ] + filters = { + col_expect: { + ops_expect[0]: query_expect[0], + ops_expect[1]: query_expect[1], + } + } + expect = [ + mock.call(model_obj, col_expect, ops_expect[0], query_expect[0]), + mock.call(model_obj, col_expect, ops_expect[1], query_expect[1]), + ] + with mock.patch.object(self.carepoint, '_create_criterion') as mk: + self.carepoint._unwrap_filters(model_obj, filters) + mk.assert_has_calls(expect, any_order=True)
+ +
[docs] @mock.patch('carepoint.db.carepoint.or_') + def test_unwrap_filters_list(self, or_): + """ It should create a proper or query for lists. """ + model_obj = self.__get_model_obj() + col_expect = 'test_col' + query_expect = ['test_1', 'test_2'] + filters = { + col_expect: query_expect + } + expect = [ + mock.call(model_obj, col_expect, '==', query_expect[0]), + mock.call(model_obj, col_expect, '==', query_expect[1]), + ] + criterion_return = 'Criterion' + with mock.patch.object(self.carepoint, '_create_criterion') as mk: + mk.return_value = criterion_return + self.carepoint._unwrap_filters(model_obj, filters) + mk.assert_has_calls(expect, any_order=True) + or_.assert_called_once_with(criterion_return, criterion_return)
+ +
[docs] def test_unwrap_filters_str(self): + model_obj = self.__get_model_obj() + col_expect = 'test_col' + query_expect = 'test_1' + op_expect = '==' + filters = {col_expect: query_expect} + with mock.patch.object(self.carepoint, '_create_criterion') as mk: + self.carepoint._unwrap_filters(model_obj, filters) + mk.assert_called_once_with( + model_obj, col_expect, op_expect, query_expect + )
+ +
[docs] def test_unwrap_filters_returns_list(self): + model_obj = self.__get_model_obj() + self.assertIsInstance( + self.carepoint._unwrap_filters(model_obj), list + )
+ + # + # Test dictionary overrides for model lookups + # + +
[docs] def test_iter_init_empty(self): + self.assertEqual(len([i for i in self.carepoint]), 0)
+ +
[docs] def test_values_init_empty(self): + self.assertEqual(len(self.carepoint.values()), 0)
+ +
[docs] def test_keys_init_empty(self): + self.assertEqual(len(self.carepoint.keys()), 0)
+ +
[docs] def test_items_init_empty(self): + self.assertEqual(len(self.carepoint.items()), 0)
+ +
[docs] def test_iteritems_init_empty(self): + self.assertEqual(len([i for i in self.carepoint.iteritems()]), 0)
+ +
[docs] def test_itervalues_init_empty(self): + self.assertEqual(len([i for i in self.carepoint.itervalues()]), 0)
+ +
[docs] def test_iterkeys_init_empty(self): + self.assertEqual(len([i for i in self.carepoint.iterkeys()]), 0)
+ +
[docs] def test_set_iter_refresh(self): + self.carepoint.set_iter_refresh() + self.assertTrue(self.carepoint.iter_refresh)
+ +
[docs] def test_iter_after_refresh(self): + self.carepoint.set_iter_refresh() + self.assertEqual(len([i for i in self.carepoint]), 1)
+ +
[docs] def test_values_after_refresh(self): + self.carepoint.set_iter_refresh() + self.assertEqual(len(self.carepoint.values()), 1)
+ +
[docs] def test_keys_after_refresh(self): + self.carepoint.set_iter_refresh() + self.assertEqual(len(self.carepoint.keys()), 1)
+ +
[docs] def test_items_after_refresh(self): + self.carepoint.set_iter_refresh() + self.assertEqual(len(self.carepoint.items()), 1)
+ +
[docs] def test_iteritems_after_refresh(self): + self.carepoint.set_iter_refresh() + self.assertEqual(len([i for i in self.carepoint.iteritems()]), 1)
+ +
[docs] def test_itervalues_after_refresh(self): + self.carepoint.set_iter_refresh() + self.assertEqual(len([i for i in self.carepoint.itervalues()]), 1)
+ +
[docs] def test_iterkeys_after_refresh(self): + self.carepoint.set_iter_refresh() + self.assertEqual(len([i for i in self.carepoint.iterkeys()]), 1)
+ +
[docs] def test_wrong_model_getitem(self): + ''' Test to verify that a KeyError is raised for invalid model name ''' + with self.assertRaises(KeyError): + self.carepoint.set_iter_refresh() + self.carepoint['ThisIsNotAModelThatExists']
+ +
[docs] def test_wrong_model_getattr(self): + ''' Test to verify that a KeyError is raised for invalid model name ''' + with self.assertRaises(AttributeError): + self.carepoint.set_iter_refresh() + self.carepoint.ThisIsNotAModelThatExists
+ +if __name__ == '__main__': + unittest.main() +
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/tests/db/test_db.html b/_modules/carepoint/tests/db/test_db.html new file mode 100644 index 0000000..cda75f9 --- /dev/null +++ b/_modules/carepoint/tests/db/test_db.html @@ -0,0 +1,170 @@ + + + + + + + carepoint.tests.db.test_db — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.tests.db.test_db

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+import unittest
+import mock
+from urllib import quote_plus as urlquote
+from carepoint.db import Db
+
+
+
[docs]class TestDb(unittest.TestCase): + +
[docs] def setUp(self, ): + self.params = { + 'usr': 'This is a user', + 'pass': '23243dsc dxcsdkc ewr239Copyright', + 'srv': 'server', + 'drv': 'drv', + 'db': 'db', + 'prt': 'port', + } + self.dsn = 'mssql+pyodbc://{usr}:{pass}@{srv}:{prt}/{db}?driver={drv}'
+ +
[docs] @mock.patch('carepoint.db.db.create_engine') + def test_mssql_dsn(self, mk): + Db( + self.params['srv'], + self.params['usr'], + self.params['pass'], + self.params['db'], + self.params['prt'], + self.params['drv'], + ) + self.params['usr'] = urlquote(self.params['usr']) + self.params['pass'] = urlquote(self.params['pass']) + mk.assert_called_once_with(self.dsn.format(**self.params))
+ +
[docs] @mock.patch('carepoint.db.db.create_engine') + def test_mssql_dsn_return(self, mk): + res = Db( + self.params['srv'], + self.params['usr'], + self.params['pass'], + self.params['db'], + self.params['prt'], + self.params['drv'], + ) + self.assertEqual(mk(), res)
+ +
[docs] @mock.patch('carepoint.db.db.create_engine') + def test_sqlite_dsn(self, mk): + Db(drv='sqlite') + mk.assert_called_once_with('sqlite://')
+ +
[docs] @mock.patch('carepoint.db.db.create_engine') + def test_sqlite_dsn_return(self, mk): + res = Db(drv='sqlite') + self.assertEqual(mk(), res)
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/tests/db/test_models/test_model.html b/_modules/carepoint/tests/db/test_models/test_model.html new file mode 100644 index 0000000..ea30bfa --- /dev/null +++ b/_modules/carepoint/tests/db/test_models/test_model.html @@ -0,0 +1,125 @@ + + + + + + + carepoint.tests.db.test_models.test_model — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.tests.db.test_models.test_model

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+
+
[docs]class TestModel(object): + __tablename__ = '__test__' + __dbname__ = 'cph' + test_col = 'Test' + +
[docs] @classmethod + def run(self): + return True
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/tests/models/cph/fixtures/address.html b/_modules/carepoint/tests/models/cph/fixtures/address.html new file mode 100644 index 0000000..bb1c9e7 --- /dev/null +++ b/_modules/carepoint/tests/models/cph/fixtures/address.html @@ -0,0 +1,152 @@ + + + + + + + carepoint.tests.models.cph.fixtures.address — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.tests.models.cph.fixtures.address

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+from mixer.backend.sqlalchemy import mixer
+from datetime import datetime
+
+
+dt_now = datetime.now()
+__model__ = 'carepoint.models.cph.address.Address'
+
+
+address_default = mixer.blend(
+    __model__,
+    addr_id=1,
+    parent_addr_id=None,
+    inherited_yn=False,
+    owner_type_cn=1,
+    alt_name='Alt Name',
+    addr1='Addr1',
+    addr2='Addr2',
+    addr3='Addr3',
+    city='City',
+    state_cd='StateCd',
+    zip='Zip',
+    zip_plus4='ZipPlus4',
+    country_cd='CountryCd',
+    mailing_yn=False,
+    anote='ANote',
+    app_flags=1,
+    timestmp=dt_now,
+    add_user_id=1,
+    add_date=dt_now,
+    chd_user_id=1,
+    chg_date=dt_now,
+)
+
+
+
[docs]def addresses_rnd(cnt): + return mixer.cycle(cnt).blend(__model__)
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/tests/models/cph/fixtures/dispense.html b/_modules/carepoint/tests/models/cph/fixtures/dispense.html new file mode 100644 index 0000000..c7a08fd --- /dev/null +++ b/_modules/carepoint/tests/models/cph/fixtures/dispense.html @@ -0,0 +1,241 @@ + + + + + + + carepoint.tests.models.cph.fixtures.dispense — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.tests.models.cph.fixtures.dispense

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+from mixer.backend.sqlalchemy import mixer
+from datetime import datetime
+
+dt_now = datetime.now()
+__model__ = 'carepoint.models.cph.dispense.Dispense'
+
+
+dispense_default = mixer.blend(
+    __model__,
+    rx_id=1,
+    store_id=1,
+    disp_ndc='DispNdc',
+    disp_drug_name='DispDrugName',
+    prod_expire_date=dt_now,
+    mfg='Mfg',
+    orig_mfg='OrifMfg',
+    pkg_size=1,
+    rxdisp_id=1,
+    fill_no=1,
+    dispense_date=dt_now,
+    dispense_qty=1,
+    disp_days_supply=1,
+    sig_text='SigText',
+    sched_of_admin_cn=1,
+    freq_of_admin=1,
+    units_per_dose=1,
+    lot_number='LotNumber',
+    disp_awp=1,
+    disp_aac=1,
+    disp_mac=1,
+    disp_ful=1,
+    disp_udef=1,
+    tech_initials='TechInitials',
+    rph_initials='RphInitials',
+    cnsl_initials='CnslInitials',
+    icd9='Icd',
+    daw_disp_cn=1,
+    level_of_service=1,
+    cmt='cmt',
+    status_cn=1,
+    alt_pick_up_id=1,
+    alt_pick_up_cn=1,
+    clarification_fill=1,
+    trip_no=1,
+    gpi_disp=1,
+    label_3pty_yn=False,
+    reject_3pty_yn=False,
+    pay_type_cn=1,
+    price_differs_yn=False,
+    pat_loc_cn=1,
+    billing_units='BillingUnits',
+    price_table_id=1,
+    app_flags=1,
+    timestmp=dt_now,
+    price_meth_cn=1,
+    uu='UU',
+    p_tbl_override_yn=False,
+    label_id=1,
+    billing_hold=1,
+    post_bal_yn=False,
+    inv_no='InvNo',
+    disp_qty_delta=1,
+    brand_med_nec_yn=False,
+    Other_coverage_cd=1,
+    epsdt_yn=False,
+    exempt_cd=1,
+    num_labels=1,
+    location='Location',
+    qty_override=1,
+    dur_summary='DurSummary',
+    cov_overrides=1,
+    use_secondary_ins_yn=False,
+    hp_blnRxExtr=1,
+    item_id=1,
+    ud_override='UdOverride',
+    disp_status_cn=1,
+    order_id=1,
+    sig_id=1,
+    counsel_yn=1,
+    processing_date=dt_now,
+    hcpcs_mod_cn=1,
+    acct_id=1,
+    track_pat_resp_yn=1,
+    track_org_resp_yn=1,
+    label_fac_id=1,
+    extern_process_cn=1,
+    price_ovr_user_id=1,
+    price_ovr_reason_cn=1,
+    wf_status_cn=1,
+    verify_user_id=1,
+    verify_timestamp=dt_now,
+    ar_hold=1,
+    disp_type_cn=1,
+    own_use_pricing_yn=1,
+    pos_processed_yn=1,
+    prescriber_cn=1,
+    visit_nbr='VisitNbr',
+    disp_udef2=1,
+    SecondaryICD9='SecondaryIcd',
+    uandc_pricing_used_yn=1,
+    special_pkg_ind_cn=1,
+    delay_reason_cn=1,
+    place_of_service_cn=1,
+    pat_residence_cn=1,
+    compound_type_cn=1,
+    pharmacy_service_type_cn=1,
+    admin_start_date=dt_now,
+    ClariFill_2=1,
+    ClariFill_3=1,
+    other_coverage_cd_2=1,
+    pat_assign_ind_yn=1,
+    prov_assign_ind_yn=1,
+    route_of_admin_ovr='RouteAdmin',
+    csr_pickup_id=1,
+    icd10='icd',
+    secondaryicd10='secondaryicd',
+    add_user_id=1,
+    add_date=dt_now,
+    chg_user_id=1,
+    chg_date=dt_now,
+)
+
+
+
[docs]def dispense_rnd(cnt): + return mixer.cycle(cnt).blend(__model__)
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/tests/models/cph/fixtures/doctor.html b/_modules/carepoint/tests/models/cph/fixtures/doctor.html new file mode 100644 index 0000000..1066b37 --- /dev/null +++ b/_modules/carepoint/tests/models/cph/fixtures/doctor.html @@ -0,0 +1,186 @@ + + + + + + + carepoint.tests.models.cph.fixtures.doctor — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.tests.models.cph.fixtures.doctor

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+from mixer.backend.sqlalchemy import mixer
+from datetime import datetime
+
+dt_now = datetime.now()
+__model__ = 'carepoint.models.cph.doctor.Doctor'
+
+
+doctor_default = mixer.blend(
+    __model__,
+    md_id=1,
+    lname='LName',
+    lname_sdx='LName',
+    fname='FName',
+    fname_sdx='FName',
+    mname='MName',
+    title_lu='TitlaLu',
+    suffix_lu='SuffixLu',
+    degree_lu='DgreeLu',
+    prescriber_type_cn=1,
+    email='Email',
+    url='Url',
+    pref_meth_contact_cn=1,
+    best_cont_time='BestContTime',
+    specialty_cd='SpecialtyCd',
+    dea_no='DeaNo',
+    dea_suffix='DeaSuffix',
+    spin_no='SpinNo',
+    upin_no='UpinNo',
+    other_id='OtherId',
+    fed_tax_id='FedTaxId',
+    hin_id='HiId',
+    champus_id='ChampusId',
+    state_lic_id='StateLicId',
+    ncpdp_id='NcpdpId',
+    medicaid_id='MedicaidId',
+    medicare_id='MedicareId',
+    blue_shield_id='BlueShieldId',
+    blue_cross_id='BlueCrossId',
+    npi_id='NpiId',
+    practice_org_id=1,
+    cmt='cmt',
+    status_cn=1,
+    conv_code='ConvCode',
+    app_flags='AppFlags',
+    timestmp=dt_now,
+    state_issued_id='StateIssuedId',
+    sname='Sname',
+    medicaid_restricted_yn=False,
+    fac_id=1,
+    C2Restricted_yn=False,
+    co_md_id=1,
+    do_not_refer=1,
+    deceased_yn=False,
+    C0restricted_yn=False,
+    C3restricted_yn=False,
+    C4restricted_yn=False,
+    C5restricted_yn=False,
+    study_drugs_yn=False,
+    tracking_cn=1,
+    CTP_no='CTPno',
+    add_user_id=1,
+    add_date=False,
+    chg_user_id=1,
+    chg_date=False,
+)
+
+
+
[docs]def doctor_rnd(cnt): + return + mixer.cycle(cnt).blend(__model__)
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/tests/models/cph/fixtures/fdb_form.html b/_modules/carepoint/tests/models/cph/fixtures/fdb_form.html new file mode 100644 index 0000000..480b541 --- /dev/null +++ b/_modules/carepoint/tests/models/cph/fixtures/fdb_form.html @@ -0,0 +1,133 @@ + + + + + + + carepoint.tests.models.cph.fixtures.fdb_form — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.tests.models.cph.fixtures.fdb_form

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+from mixer.backend.sqlalchemy import mixer
+
+
+__model__ = 'carepoint.models.cph.fdb_form.FdbForm'
+
+
+fdb_form_default = mixer.blend(
+    __model__,
+    gcdf='0A',
+    dose='UNIDENT',
+    gcdf_desc='UNIDENTIFIED',
+    update_yn=False,
+)
+
+
+
[docs]def fdb_form_rnd(cnt): + return mixer.cycle(cnt).blend(__model__)
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/tests/models/cph/fixtures/fdb_gcn.html b/_modules/carepoint/tests/models/cph/fixtures/fdb_gcn.html new file mode 100644 index 0000000..35aae1a --- /dev/null +++ b/_modules/carepoint/tests/models/cph/fixtures/fdb_gcn.html @@ -0,0 +1,134 @@ + + + + + + + carepoint.tests.models.cph.fixtures.fdb_gcn — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.tests.models.cph.fixtures.fdb_gcn

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+from mixer.backend.sqlalchemy import mixer
+from datetime import datetime
+
+
+dt_now = datetime.now()
+__model__ = 'carepoint.models.cph.fdb_gcn.FdbGcn'
+
+
+fdb_gcn_default = mixer.blend(
+    __model__,
+    gcn_seqno=1,
+    gcn=11,
+    update_yn=False,
+)
+
+
+
[docs]def fdb_gcn_rnd(cnt): + return mixer.cycle(cnt).blend(__model__)
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/tests/models/cph/fixtures/fdb_gcn_seq.html b/_modules/carepoint/tests/models/cph/fixtures/fdb_gcn_seq.html new file mode 100644 index 0000000..7b0e6ac --- /dev/null +++ b/_modules/carepoint/tests/models/cph/fixtures/fdb_gcn_seq.html @@ -0,0 +1,145 @@ + + + + + + + carepoint.tests.models.cph.fixtures.fdb_gcn_seq — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.tests.models.cph.fixtures.fdb_gcn_seq

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+from mixer.backend.sqlalchemy import mixer
+from datetime import datetime
+
+
+dt_now = datetime.now()
+__model__ = 'carepoint.models.cph.fdb_gcn_seq.FdbGcnSeq'
+
+
+fdb_gcn_seq_default = mixer.blend(
+    __model__,
+    gcn_seqno=1,
+    hic3='A1A',
+    hicl_seqno=1,
+    gcdf='TA',
+    gcrt=1,
+    str='100 MG',
+    gtc=38,
+    tc=74,
+    dcc=0,
+    gcnseq_gi=1,
+    gender=0,
+    hic3_seqn=139,
+    str60='100 mg',
+    update_yn=0,
+)
+
+
+
[docs]def fdb_gcn_seq_rnd(cnt): + return mixer.cycle(cnt).blend(__model__)
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/tests/models/cph/fixtures/fdb_lbl_rid.html b/_modules/carepoint/tests/models/cph/fixtures/fdb_lbl_rid.html new file mode 100644 index 0000000..51846d5 --- /dev/null +++ b/_modules/carepoint/tests/models/cph/fixtures/fdb_lbl_rid.html @@ -0,0 +1,132 @@ + + + + + + + carepoint.tests.models.cph.fixtures.fdb_lbl_rid — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.tests.models.cph.fixtures.fdb_lbl_rid

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+from mixer.backend.sqlalchemy import mixer
+
+
+__model__ = 'carepoint.models.cph.fdb_lbl_rid.FdbLblRid'
+
+
+fdb_lbl_rid_default = mixer.blend(
+    __model__,
+    lblrid='A00002',
+    mfg='ELI LILLY & CO.',
+    update_yn=False,
+)
+
+
+
[docs]def fdb_lbl_rid_rnd(cnt): + return mixer.cycle(cnt).blend(__model__)
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/tests/models/cph/fixtures/fdb_ndc.html b/_modules/carepoint/tests/models/cph/fixtures/fdb_ndc.html new file mode 100644 index 0000000..4611d75 --- /dev/null +++ b/_modules/carepoint/tests/models/cph/fixtures/fdb_ndc.html @@ -0,0 +1,214 @@ + + + + + + + carepoint.tests.models.cph.fixtures.fdb_ndc — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.tests.models.cph.fixtures.fdb_ndc

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+from mixer.backend.sqlalchemy import mixer
+from datetime import datetime
+
+
+dt_now = datetime.now()
+__model__ = 'carepoint.models.cph.fdb_ndc.FdbNdc'
+
+
+fdb_ndc_default = mixer.blend(
+    __model__,
+    id=1,
+    ncd=2032902,
+    lblrid='A00002',
+    gcn_seqno=8879,
+    ps=100,
+    df=1,
+    ad='PEDIATRIC',
+    ln='V-CILLIN K 250MG TABLET',
+    bn='V-CILLIN K',
+    pndc=777050324,
+    repndc=66591065141,
+    ndcfi=1,
+    daddnc=19820101,
+    dupdc=20001102,
+    desi=None,  # All Blank in test DB
+    desdtec=0,  # All 0 in test DB
+    desi2=None,  # All Blank in test DB
+    des2dtec=0,  # All 0 in test DB
+    dea=0,  # 0,1,2,3,4 (Scheduled Substance)
+    cl='F',  # T, F in Test DB - likely Bool conversion
+    gpi=2,  # 0,1,2,3
+    hosp=1,  # 0,1
+    innov=1,  # 0,1
+    ipi=0,  # 0,1
+    mini=1,  # 0,1
+    maint=None,  # 1 or NULL
+    obc='AB',
+    obsdtec=19971224,
+    ppi=None,  # 1 or NULL
+    stpk=1,  # 0,1
+    repack=0,  # 0,1
+    top200=0,  # 0,1
+    ud=0,  # 0,1
+    csp=1,
+    color='WHITE',
+    flavor='CHERRY',
+    shape='ELLIPTICAL',
+    ndl_gdge=0,  # 0
+    ndl_lngth=0,  # 0
+    syr_cpcty=3,  # 0,1,2,3
+    shlf_pck=24,
+    shipper=1,
+    skey=200476000000000000000000,
+    hcfa_fda='AB',
+    hcfa_unit='TAB',
+    hcfa_ps=1,
+    hcfa_appc=19580926,
+    hcfa_mrkc=19580926,
+    hcfa_trmc=19971001,
+    hcfa_typ=2,
+    hcfa_desc1=19930101,
+    hcfa_desi1=2,
+    uu=0,  # 0,1
+    pd='BOTTLE',
+    ln25='V-CILLIN K  250MG TABLILL',
+    ln25i=0,
+    gpidc=19940101,
+    bbdc=19970108,
+    home=0,  # 0,1
+    inpcki=0,  # 0,1
+    outpcki=0,  # 0,1
+    obc_exp='AB',
+    ps_equiv=100,
+    plblr=0,  # 0,1
+    hcpc='J3260',
+    top50gen=0,
+    obc3='AB',
+    gmi=2,  # 0,1,2
+    gni=3,  # 0,1,2,3
+    gsi=9,
+    gti=2,
+    ndcgi1=1,
+    user_gcdf=None,  # All blank
+    user_str=None,  # All blank
+    real_product_yn=None,  # All blank
+    no_update_yn=None,  # All blank
+    no_prc_update_yn=None,  # All blank
+    user_product_yn=0,  # 0 & Blank
+    cpname_short=None,  # All blank
+    status_cn=None,  # All blank
+    update_yn=None,  # All blank
+    active_yn=0,  # 0,1
+    ln60='DARVOCET-N 50 TABLET',
+)
+
+
+
[docs]def fdb_ndc_rnd(cnt): + return mixer.cycle(cnt).blend(__model__)
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/tests/models/cph/fixtures/fdb_ndc_cs_ext.html b/_modules/carepoint/tests/models/cph/fixtures/fdb_ndc_cs_ext.html new file mode 100644 index 0000000..3071adb --- /dev/null +++ b/_modules/carepoint/tests/models/cph/fixtures/fdb_ndc_cs_ext.html @@ -0,0 +1,177 @@ + + + + + + + carepoint.tests.models.cph.fixtures.fdb_ndc_cs_ext — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.tests.models.cph.fixtures.fdb_ndc_cs_ext

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+from mixer.backend.sqlalchemy import mixer
+from datetime import datetime
+
+
+dt_now = datetime.now()
+__model__ = 'carepoint.models.cph.fdb_ndc_cs_ext.FdbNdcCsExt'
+
+
+fdb_ndc_cs_ext_default = mixer.blend(
+    __model__,
+    ndc='0002032902',
+    short_name='An item',
+    lot_no='A lot',
+    orig_mfg='Orig Mfg',
+    pref_gen_yn=True,
+    active_yn=True,
+    drug_expire_days='Drug Expire Days',
+    formulary_yn=True,
+    compound_yn=True,
+    sup_upd_gen_yn=True,
+    sup_upd_phys_yn=True,
+    sup_upd_clin_yn=True,
+    sup_upd_fin_yn=True,
+    sup_upd_med_yn=True,
+    dn_form='TABLET',
+    dn_str='250 MG',
+    dn_route='ORAL',
+    rx_only_yn=True,
+    manual_yn=True,
+    brand_ndc='0002032902',
+    add_user_id=1,
+    add_date=dt_now,
+    chg_user_id=1,
+    app_flags='',
+    timestmp=dt_now,
+    comp_yn=True,
+    dea='Dea Num',
+    dea_chg_user=1,
+    dea_chg_date=dt_now,
+    ln='Ln ',
+    ln_chg_user=1,
+    ln_chg_date=dt_now,
+    fdb_chg_date=dt_now,
+    ud_svc_code='Ud Svc Code',
+    gpi='Gpi',
+    gpi_chg_user=1,
+    gpi_chg_date=dt_now,
+    bill_increment=1,
+    formula_id=1,
+    alt_iptside1='Alt IptSide1',
+    alt_iptside2='Alt IptSide2',
+    dose_multiplier='Dose Multiplier',
+    default_daw_override='Daw Override',
+    manual_price_yn=True,
+    compound_type_cn=1,
+    refrig_cn=1,
+)
+
+
+
[docs]def fdb_ndc_cs_ext_rnd(cnt): + return mixer.cycle(cnt).blend(__model__)
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/tests/models/cph/fixtures/fdb_route.html b/_modules/carepoint/tests/models/cph/fixtures/fdb_route.html new file mode 100644 index 0000000..bcaca74 --- /dev/null +++ b/_modules/carepoint/tests/models/cph/fixtures/fdb_route.html @@ -0,0 +1,135 @@ + + + + + + + carepoint.tests.models.cph.fixtures.fdb_route — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.tests.models.cph.fixtures.fdb_route

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+from mixer.backend.sqlalchemy import mixer
+
+
+__model__ = 'carepoint.models.cph.fdb_route.FdbRoute'
+
+
+fdb_route_default = mixer.blend(
+    __model__,
+    gcrt='K',
+    rt='INTRAARTIC',
+    gcrt2='UI',
+    gcrt_desc='INTRAARTICULAR',
+    systemic='S',
+    update_yn=False,
+)
+
+
+
[docs]def fdb_route_rnd(cnt): + return mixer.cycle(cnt).blend(__model__)
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/tests/models/cph/fixtures/item.html b/_modules/carepoint/tests/models/cph/fixtures/item.html new file mode 100644 index 0000000..4fea450 --- /dev/null +++ b/_modules/carepoint/tests/models/cph/fixtures/item.html @@ -0,0 +1,177 @@ + + + + + + + carepoint.tests.models.cph.fixtures.item — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.tests.models.cph.fixtures.item

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+from mixer.backend.sqlalchemy import mixer
+from datetime import datetime
+
+
+dt_now = datetime.now()
+__model__ = 'carepoint.models.cph.item.Item'
+
+
+item_default = mixer.blend(
+    __model__,
+    ITEMMSTR='ItmeStr',
+    DESCR='Descr',
+    TAXABLE='Taxable',
+    CLASS='Class',
+    UOFMSALES='UofmSales',
+    UOFMORDERS='UofmOrders',
+    FACTOR=1.1,
+    ONHAND=1,
+    ONORDER=1,
+    VENDOR='Vendor',
+    COST=1,
+    INQTY=1,
+    INDATE=dt_now,
+    OUTQTY=1,
+    OUTDATE=dt_now,
+    ADJQTY=1,
+    ADJDATE=dt_now,
+    MTD_ISSUE=1,
+    MTD_RCPTS=1,
+    MTD_ADJ=1,
+    COMMENTS='Comments',
+    IMIN=1,
+    IMAX=1,
+    UPCCODE='UpcCode',
+    POSLOC='PosLoc',
+    VENDITEMNO='VendItemMo',
+    EXCLUDE='Exclude',
+    NDC='Ndc',
+    SKU='Sku',
+    AUTO_ORD=1,
+    FIXED_QTY=1,
+    ACTIVE_YN=1,
+    AVG_UNIT_COST=1,
+    location='location',
+    item_id=1,
+    store_id=1,
+    chemical_id=1,
+    allocated=1,
+    machine_id=1,
+    special_pkg_ind_cn=1,
+    refrig_cn=1,
+    order_multiples_of=1,
+    add_user_id=1,
+    add_date=dt_now,
+    chg_user_id=1,
+    chg_date=dt_now,
+)
+
+
+
[docs]def item_rnd(cnt): + return mixer.cycle(cnt).blend(__model__)
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/tests/models/cph/fixtures/patient.html b/_modules/carepoint/tests/models/cph/fixtures/patient.html new file mode 100644 index 0000000..59c1f73 --- /dev/null +++ b/_modules/carepoint/tests/models/cph/fixtures/patient.html @@ -0,0 +1,210 @@ + + + + + + + carepoint.tests.models.cph.fixtures.patient — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.tests.models.cph.fixtures.patient

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+from mixer.backend.sqlalchemy import mixer
+from datetime import datetime
+
+
+dt_now = datetime.now()
+__model__ = 'carepoint.models.cph.patient.Patient'
+
+
+patient_default = mixer.blend(
+    __model__,
+    pat_id=1,
+    cmt_id=1,
+    pat_status_cn=1,
+    pat_type_cn=1,
+    nh_pat_id='NhPatId',
+    chart_id='ChartId',
+    lname='LName',
+    lname_sdx='LNameSdx',
+    mname='Mname',
+    title_lu='TitleLu',
+    suffix_lu='SuffixLu',
+    alias='Alias',
+    mmname='MmName',
+    alt1_id='AltId',
+    pref_meth_cont_cn='PrefMeth',
+    best_cont_time='BestCon',
+    ssn='Social',
+    dln='Dln',
+    dln_state_cd='DlnStateCd',
+    email='Email',
+    gender_cd='Gender',
+    birth_date=dt_now,
+    death_date=dt_now,
+    no_safety_caps_yn=False,
+    generics_yn=False,
+    label_style_cn=1,
+    primary_md_id=1,
+    secondary_md_id=1,
+    edu_level_cn=1,
+    ethnicity_cd='Ethnicity',
+    marital_status_cd='MaritalStatus',
+    religion_cn=1,
+    name_spouse='NameSpous',
+    primary_lang_cd='PrimaryLang',
+    rec_release_status_cn=1,
+    rec_release_date=dt_now,
+    hh_relation_cn=1,
+    hh_pat_id=1,
+    fam_relation_cn='FamRelation',
+    fam_pat_id=1,
+    primary_store_id=1,
+    bad_check_yn=False,
+    price_formula_id=1,
+    cmt='Cmt',
+    status_cn=1,
+    facility_pat_yn=False,
+    conv_code='ConvCode',
+    app_flags=1,
+    timestmp=dt_now,
+    comp_cn=1,
+    hp_blnAdmExt=1,
+    hp_ExtAtt=1,
+    user_def_1='UserDef',
+    user_def_2='UserDef',
+    user_def_3='UserDef',
+    user_def_4='UserDef',
+    sc_pat_id=1,
+    resp_party_id=1,
+    auto_refill_cn=1,
+    fill_yn=False,
+    fill_stop_date=dt_now,
+    fill_resume_date=dt_now,
+    fill_stop_reason_cn=1,
+    fill_stop_user_id=1,
+    registration_date=dt_now,
+    anonymous_yn=False,
+    market_yn=False,
+    representative='Represent',
+    discharge_date=dt_now,
+    do_not_resuscitate_yn=False,
+    discharge_exp_date=dt_now,
+    pat_loc_cn=1,
+    rx_priority_default_cn=1,
+    ship_cn=1,
+    residence_cn=1,
+    add_user_id=1,
+    add_date=dt_now,
+    chg_user_id=1,
+    chg_date=dt_now,
+)
+
+
+
[docs]def patient_rnd(cnt): + return mixer.cycle(cnt).blend(__model__)
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/tests/models/cph/fixtures/prescription.html b/_modules/carepoint/tests/models/cph/fixtures/prescription.html new file mode 100644 index 0000000..632a859 --- /dev/null +++ b/_modules/carepoint/tests/models/cph/fixtures/prescription.html @@ -0,0 +1,231 @@ + + + + + + + carepoint.tests.models.cph.fixtures.prescription — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.tests.models.cph.fixtures.prescription

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+from mixer.backend.sqlalchemy import mixer
+from datetime import datetime
+
+
+dt_now = datetime.now()
+__model__ = 'carepoint.models.cph.prescription.Prescription'
+
+
+presription_default = mixer.blend(
+    __model__,
+    rx_id=1,
+    script_no='ScriptNo',
+    old_script_no='OldScriptNo',
+    pat_id=1,
+    store_id=1,
+    md_id=1,
+    ndc='Ndc',
+    gcn_seqno=1,
+    mfg='Mfg',
+    drug_name='DrugName',
+    input_src_cn=1,
+    src_pat_meds_cn=1,
+    start_date=dt_now,
+    expire_date=dt_now,
+    stop_date=dt_now,
+    sig_code='SigCode',
+    sig_text='SigText',
+    written_qty=1,
+    starter_qty=1,
+    days_supply=1,
+    pkg_size=1,
+    units_per_dose=1,
+    units_entered='UnitsEntered',
+    awp=1,
+    udef=1,
+    ful=1,
+    mac=1,
+    aac=1,
+    freq_entered='FreqEntered',
+    freq_of_admin=1,
+    sched_of_admin_cn=1,
+    daw_yn=False,
+    refills_orig=1,
+    refills_left=1,
+    last_rxdisp_id=1,
+    last_refill_qty=1,
+    last_refill_date=dt_now,
+    refill_date=dt_now,
+    src_org_id=1,
+    cmt='Cmt',
+    exit_state_cn=1,
+    script_status_cn=1,
+    sched_date=dt_now,
+    sched_time=dt_now,
+    scheduled_yn=False,
+    drug_dea_class='DrugDeaClass',
+    manual_add_yn=False,
+    status_cn=1,
+    life_date=dt_now,
+    self_prescribed_yn=False,
+    last_transfer_type_io='LastTransferType',
+    last_disp_prod='LastDsipProd',
+    transfer_cnt=1,
+    wc_claim_id='WcClaimId',
+    injury_date=dt_now,
+    gpi_rx=1,
+    auth_by='AuthBy',
+    orig_disp_date=dt_now,
+    short_term_yn=1,
+    orig_date=dt_now,
+    refills_used=1,
+    wc_emp_id=1,
+    dose_unit='DoseUnit',
+    dosage_multiplier=1,
+    df='Df',
+    uu='Uu',
+    app_flags=1,
+    timestmp=dt_now,
+    sched2_no='SchedTwo',
+    orig_expire_date=dt_now,
+    rxq_status_cn=1,
+    IVRCmt='IVRCmt',
+    wc_bodypart='WcBodypart',
+    comp_ndc='CompNdc',
+    treatment_yn=False,
+    ivr_callback='IvrCallback',
+    autofill_yn=False,
+    autofill_resume_date=dt_now,
+    workflow_status_cn=1,
+    extern_process_cn=1,
+    md_fac_id=1,
+    owner_store_id=1,
+    study_id=1,
+    min_days_until_refill=1,
+    sig_text_english='SigTextEnglish',
+    order_fullfillment_cn=1,
+    taxable=1,
+    MAR_flag=1,
+    FreeFormStrength='FreeFormStrength',
+    priority_cn=1,
+    # ecs_yn=False,
+    # edit_locked_yn=False,
+    # locked_yn=False,
+    # locked_id=1,
+    # locked_user_id=1,
+    daw_rx_cn=1,
+    add_user_id=1,
+    add_date=dt_now,
+    chg_user_id=1,
+    chg_date=dt_now,
+)
+
+
+
[docs]def prescription_rnd(cnt): + return mixer.cycle(cnt).blend(__model__)
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/tests/models/cph/fixtures/store.html b/_modules/carepoint/tests/models/cph/fixtures/store.html new file mode 100644 index 0000000..16cdebf --- /dev/null +++ b/_modules/carepoint/tests/models/cph/fixtures/store.html @@ -0,0 +1,156 @@ + + + + + + + carepoint.tests.models.cph.fixtures.store — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.tests.models.cph.fixtures.store

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+from mixer.backend.sqlalchemy import mixer
+from datetime import datetime
+
+
+dt_now = datetime.now()
+__model__ = 'carepoint.models.cph.store.Store'
+
+
+store_default = mixer.blend(
+    __model__,
+    store_id=1,
+    store_type_cn=1,
+    name='Name',
+    store_hours='StoreHours',
+    store_no='StoreNo',
+    fed_tax_id='FedTaxId',
+    url='Url',
+    email='Email',
+    mgr_cont_id=1,
+    cont_id=1,
+    carepoint_acct_no='CarepointAcctNo',
+    cmt='Cmt',
+    status_cn=1,
+    app_flags=1,
+    nabp='Nabp',
+    medicaid_no='Medicaid',
+    timestmp=dt_now,
+    region_id=1,
+    NPI='Npi',
+    pharmacy_service_type_cn=1,
+    web_refill_yn=False,
+    add_user_id=1,
+    add_date=dt_now,
+    chg_user_id=1,
+    chg_date=dt_now,
+)
+
+
+
[docs]def store_rnd(cnt): + return mixer.cycle(cnt).blend(__model__)
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/tests/models/cph/fixtures/store_param.html b/_modules/carepoint/tests/models/cph/fixtures/store_param.html new file mode 100644 index 0000000..59be18c --- /dev/null +++ b/_modules/carepoint/tests/models/cph/fixtures/store_param.html @@ -0,0 +1,137 @@ + + + + + + + carepoint.tests.models.cph.fixtures.store_param — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.tests.models.cph.fixtures.store_param

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+from mixer.backend.sqlalchemy import mixer
+from datetime import datetime
+
+
+dt_now = datetime.now()
+__model__ = 'carepoint.models.cph.store_param.StoreParam'
+
+
+store_param_default = mixer.blend(
+    __model__,
+    store_id=1,
+    param_code='SC_MOD_RD_PROD_IMAGE_DIR',
+    descr='SC_MOD_RD_PROD_IMAGE_DIR',
+    data_value='\\GRXServer\images',
+    app_flags=0,
+    timestmp=dt_now
+)
+
+
+
[docs]def store_param_rnd(cnt): + return mixer.cycle(cnt).blend(__model__)
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/tests/models/cph/fixtures/user.html b/_modules/carepoint/tests/models/cph/fixtures/user.html new file mode 100644 index 0000000..10107a1 --- /dev/null +++ b/_modules/carepoint/tests/models/cph/fixtures/user.html @@ -0,0 +1,162 @@ + + + + + + + carepoint.tests.models.cph.fixtures.user — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.tests.models.cph.fixtures.user

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+from mixer.backend.sqlalchemy import mixer
+from datetime import datetime
+
+
+dt_now = datetime.now()
+__model__ = 'carepoint.models.cph.user.User'
+
+
+user_default = mixer.blend(
+    __model__,
+    user_id=1,
+    user_type_cd='UserType',
+    login_name='LoginName',
+    lname='Lname',
+    fname='Fname',
+    mname='Mname',
+    title_lu='TitleLu',
+    suffix_lu='SuffixLu',
+    degree_lu='Degree',
+    initials='Initials',
+    job_title_lu='JobTitle',
+    anote='Anote',
+    employee_no='EmployeeNo',
+    ssn='Social',
+    last_login_date=dt_now,
+    email='Email',
+    db_password='DbPassword',
+    es_password='EsPassword',
+    cmt='Cmt',
+    system_yn=1,
+    license_no='LicenseNo',
+    license_state_cd='LicenseStateCd',
+    status_cn=1,
+    app_flags=1,
+    timestmp=dt_now,
+    must_change_password_yn=1,
+    password_date=dt_now,
+    add_user_id=1,
+    add_date=dt_now,
+    chg_user_id=1,
+    chg_date=dt_now,
+)
+
+
+
[docs]def user_rnd(cnt): + return mixer.cycle(cnt).blend(__model__)
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/tests/models/cph/test_account.html b/_modules/carepoint/tests/models/cph/test_account.html new file mode 100644 index 0000000..dcc20c9 --- /dev/null +++ b/_modules/carepoint/tests/models/cph/test_account.html @@ -0,0 +1,130 @@ + + + + + + + carepoint.tests.models.cph.test_account — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.tests.models.cph.test_account

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+import unittest
+from sqlalchemy.schema import Table
+from carepoint.tests.db.db import DatabaseTest
+from carepoint.models.cph.account import Account
+
+
+
[docs]class TestModelsCphAccount(DatabaseTest): + +
[docs] def test_table_initialization(self, ): + self.assertIsInstance(Account.__table__, Table)
+ + +if __name__ == '__main__': + unittest.main() +
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/tests/models/cph/test_account_activity.html b/_modules/carepoint/tests/models/cph/test_account_activity.html new file mode 100644 index 0000000..bfb524a --- /dev/null +++ b/_modules/carepoint/tests/models/cph/test_account_activity.html @@ -0,0 +1,130 @@ + + + + + + + carepoint.tests.models.cph.test_account_activity — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.tests.models.cph.test_account_activity

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+import unittest
+from sqlalchemy.schema import Table
+from carepoint.tests.db.db import DatabaseTest
+from carepoint.models.cph.account_activity import AccountActivity
+
+
+
[docs]class TestModelsCphAccountActivity(DatabaseTest): + +
[docs] def test_table_initialization(self, ): + self.assertIsInstance(AccountActivity.__table__, Table)
+ + +if __name__ == '__main__': + unittest.main() +
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/tests/models/cph/test_address.html b/_modules/carepoint/tests/models/cph/test_address.html new file mode 100644 index 0000000..982f43b --- /dev/null +++ b/_modules/carepoint/tests/models/cph/test_address.html @@ -0,0 +1,130 @@ + + + + + + + carepoint.tests.models.cph.test_address — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.tests.models.cph.test_address

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+import unittest
+from sqlalchemy.schema import Table
+from carepoint.tests.db.db import DatabaseTest
+from carepoint.models.cph.address import Address
+
+
+
[docs]class TestModelsCphAddress(DatabaseTest): + +
[docs] def test_table_initialization(self, ): + self.assertIsInstance(Address.__table__, Table)
+ + +if __name__ == '__main__': + unittest.main() +
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/tests/models/cph/test_dispense.html b/_modules/carepoint/tests/models/cph/test_dispense.html new file mode 100644 index 0000000..95eee1c --- /dev/null +++ b/_modules/carepoint/tests/models/cph/test_dispense.html @@ -0,0 +1,130 @@ + + + + + + + carepoint.tests.models.cph.test_dispense — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.tests.models.cph.test_dispense

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+import unittest
+from sqlalchemy.schema import Table
+from carepoint.tests.db.db import DatabaseTest
+from carepoint.models.cph.dispense import Dispense
+
+
+
[docs]class TestModelsCphDispense(DatabaseTest): + +
[docs] def test_table_initialization(self, ): + self.assertIsInstance(Dispense.__table__, Table)
+ + +if __name__ == '__main__': + unittest.main() +
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/tests/models/cph/test_dispense_price.html b/_modules/carepoint/tests/models/cph/test_dispense_price.html new file mode 100644 index 0000000..bde3637 --- /dev/null +++ b/_modules/carepoint/tests/models/cph/test_dispense_price.html @@ -0,0 +1,130 @@ + + + + + + + carepoint.tests.models.cph.test_dispense_price — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.tests.models.cph.test_dispense_price

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+import unittest
+from sqlalchemy.schema import Table
+from carepoint.tests.db.db import DatabaseTest
+from carepoint.models.cph.dispense_price import DispensePrice
+
+
+
[docs]class TestModelsCphDispensePrice(DatabaseTest): + +
[docs] def test_table_initialization(self, ): + self.assertIsInstance(DispensePrice.__table__, Table)
+ + +if __name__ == '__main__': + unittest.main() +
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/tests/models/cph/test_doctor.html b/_modules/carepoint/tests/models/cph/test_doctor.html new file mode 100644 index 0000000..1f33f4e --- /dev/null +++ b/_modules/carepoint/tests/models/cph/test_doctor.html @@ -0,0 +1,130 @@ + + + + + + + carepoint.tests.models.cph.test_doctor — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.tests.models.cph.test_doctor

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+import unittest
+from sqlalchemy.schema import Table
+from carepoint.tests.db.db import DatabaseTest
+from carepoint.models.cph.doctor import Doctor
+
+
+
[docs]class TestModelsCphDoctor(DatabaseTest): + +
[docs] def test_table_initialization(self, ): + self.assertIsInstance(Doctor.__table__, Table)
+ + +if __name__ == '__main__': + unittest.main() +
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/tests/models/cph/test_doctor_address.html b/_modules/carepoint/tests/models/cph/test_doctor_address.html new file mode 100644 index 0000000..a6765fb --- /dev/null +++ b/_modules/carepoint/tests/models/cph/test_doctor_address.html @@ -0,0 +1,135 @@ + + + + + + + carepoint.tests.models.cph.test_doctor_address — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.tests.models.cph.test_doctor_address

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+import unittest
+from sqlalchemy.schema import Table
+from carepoint.tests.db.db import DatabaseTest
+from carepoint.models.cph.doctor_address import DoctorAddress
+
+
+
[docs]class TestModelsCphDoctorAddress(DatabaseTest): + +
[docs] def test_table_initialization(self): + self.assertIsInstance(DoctorAddress.__table__, Table)
+ +
[docs] def test_addr_mixin_col(self): + self.assertTrue( + hasattr(DoctorAddress, 'addr_id') + )
+ + +if __name__ == '__main__': + unittest.main() +
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/tests/models/cph/test_doctor_phone.html b/_modules/carepoint/tests/models/cph/test_doctor_phone.html new file mode 100644 index 0000000..aecb158 --- /dev/null +++ b/_modules/carepoint/tests/models/cph/test_doctor_phone.html @@ -0,0 +1,134 @@ + + + + + + + carepoint.tests.models.cph.test_doctor_phone — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.tests.models.cph.test_doctor_phone

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+import unittest
+from sqlalchemy.schema import Table
+from carepoint.tests.db.db import DatabaseTest
+from carepoint.models.cph.doctor_phone import DoctorPhone
+
+
+
[docs]class TestModelsCphDoctorPhone(DatabaseTest): + +
[docs] def test_table_initialization(self): + self.assertIsInstance(DoctorPhone.__table__, Table)
+ +
[docs] def test_phone_mixin_col(self): + self.assertTrue( + hasattr(DoctorPhone, 'phone_id') + )
+ +if __name__ == '__main__': + unittest.main() +
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/tests/models/cph/test_fdb_allergen.html b/_modules/carepoint/tests/models/cph/test_fdb_allergen.html new file mode 100644 index 0000000..0234aa7 --- /dev/null +++ b/_modules/carepoint/tests/models/cph/test_fdb_allergen.html @@ -0,0 +1,130 @@ + + + + + + + carepoint.tests.models.cph.test_fdb_allergen — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.tests.models.cph.test_fdb_allergen

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+import unittest
+from sqlalchemy.schema import Table
+from carepoint.tests.db.db import DatabaseTest
+from carepoint.models.cph.fdb_allergen import FdbAllergen
+
+
+
[docs]class TestModelsCphFdbAllergen(DatabaseTest): + +
[docs] def test_table_initialization(self, ): + self.assertIsInstance(FdbAllergen.__table__, Table)
+ + +if __name__ == '__main__': + unittest.main() +
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/tests/models/cph/test_fdb_allergen_desc.html b/_modules/carepoint/tests/models/cph/test_fdb_allergen_desc.html new file mode 100644 index 0000000..f774770 --- /dev/null +++ b/_modules/carepoint/tests/models/cph/test_fdb_allergen_desc.html @@ -0,0 +1,130 @@ + + + + + + + carepoint.tests.models.cph.test_fdb_allergen_desc — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.tests.models.cph.test_fdb_allergen_desc

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+import unittest
+from sqlalchemy.schema import Table
+from carepoint.tests.db.db import DatabaseTest
+from carepoint.models.cph.fdb_allergen_desc import FdbAllergenDesc
+
+
+
[docs]class TestModelsCphFdbAllergenDesc(DatabaseTest): + +
[docs] def test_table_initialization(self, ): + self.assertIsInstance(FdbAllergenDesc.__table__, Table)
+ + +if __name__ == '__main__': + unittest.main() +
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/tests/models/cph/test_fdb_allergen_group.html b/_modules/carepoint/tests/models/cph/test_fdb_allergen_group.html new file mode 100644 index 0000000..9df677e --- /dev/null +++ b/_modules/carepoint/tests/models/cph/test_fdb_allergen_group.html @@ -0,0 +1,130 @@ + + + + + + + carepoint.tests.models.cph.test_fdb_allergen_group — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.tests.models.cph.test_fdb_allergen_group

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+import unittest
+from sqlalchemy.schema import Table
+from carepoint.tests.db.db import DatabaseTest
+from carepoint.models.cph.fdb_allergen_group import FdbAllergenGroup
+
+
+
[docs]class TestModelsCphFdbAllergenGroup(DatabaseTest): + +
[docs] def test_table_initialization(self, ): + self.assertIsInstance(FdbAllergenGroup.__table__, Table)
+ + +if __name__ == '__main__': + unittest.main() +
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/tests/models/cph/test_fdb_allergen_rel.html b/_modules/carepoint/tests/models/cph/test_fdb_allergen_rel.html new file mode 100644 index 0000000..f7649b5 --- /dev/null +++ b/_modules/carepoint/tests/models/cph/test_fdb_allergen_rel.html @@ -0,0 +1,130 @@ + + + + + + + carepoint.tests.models.cph.test_fdb_allergen_rel — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.tests.models.cph.test_fdb_allergen_rel

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+import unittest
+from sqlalchemy.schema import Table
+from carepoint.tests.db.db import DatabaseTest
+from carepoint.models.cph.fdb_allergen_rel import FdbAllergenRel
+
+
+
[docs]class TestModelsCphFdbAllergenRel(DatabaseTest): + +
[docs] def test_table_initialization(self, ): + self.assertIsInstance(FdbAllergenRel.__table__, Table)
+ + +if __name__ == '__main__': + unittest.main() +
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/tests/models/cph/test_fdb_attr.html b/_modules/carepoint/tests/models/cph/test_fdb_attr.html new file mode 100644 index 0000000..08aa4de --- /dev/null +++ b/_modules/carepoint/tests/models/cph/test_fdb_attr.html @@ -0,0 +1,130 @@ + + + + + + + carepoint.tests.models.cph.test_fdb_attr — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.tests.models.cph.test_fdb_attr

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+import unittest
+from sqlalchemy.schema import Table
+from carepoint.tests.db.db import DatabaseTest
+from carepoint.models.cph.fdb_attr import FdbAttr
+
+
+
[docs]class TestModelsCphFdbAttr(DatabaseTest): + +
[docs] def test_table_initialization(self, ): + self.assertIsInstance(FdbAttr.__table__, Table)
+ + +if __name__ == '__main__': + unittest.main() +
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/tests/models/cph/test_fdb_attr_base.html b/_modules/carepoint/tests/models/cph/test_fdb_attr_base.html new file mode 100644 index 0000000..60986f7 --- /dev/null +++ b/_modules/carepoint/tests/models/cph/test_fdb_attr_base.html @@ -0,0 +1,130 @@ + + + + + + + carepoint.tests.models.cph.test_fdb_attr_base — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.tests.models.cph.test_fdb_attr_base

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+import unittest
+from sqlalchemy.schema import Table
+from carepoint.tests.db.db import DatabaseTest
+from carepoint.models.cph.fdb_attr_base import FdbAttrBase
+
+
+
[docs]class TestModelsCphFdbAttrBase(DatabaseTest): + +
[docs] def test_table_initialization(self, ): + self.assertIsInstance(FdbAttrBase.__table__, Table)
+ + +if __name__ == '__main__': + unittest.main() +
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/tests/models/cph/test_fdb_attr_type.html b/_modules/carepoint/tests/models/cph/test_fdb_attr_type.html new file mode 100644 index 0000000..32ef7fa --- /dev/null +++ b/_modules/carepoint/tests/models/cph/test_fdb_attr_type.html @@ -0,0 +1,130 @@ + + + + + + + carepoint.tests.models.cph.test_fdb_attr_type — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.tests.models.cph.test_fdb_attr_type

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+import unittest
+from sqlalchemy.schema import Table
+from carepoint.tests.db.db import DatabaseTest
+from carepoint.models.cph.fdb_attr_type import FdbAttrType
+
+
+
[docs]class TestModelsCphFdbAttrType(DatabaseTest): + +
[docs] def test_table_initialization(self, ): + self.assertIsInstance(FdbAttrType.__table__, Table)
+ + +if __name__ == '__main__': + unittest.main() +
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/tests/models/cph/test_fdb_form.html b/_modules/carepoint/tests/models/cph/test_fdb_form.html new file mode 100644 index 0000000..7a967ce --- /dev/null +++ b/_modules/carepoint/tests/models/cph/test_fdb_form.html @@ -0,0 +1,130 @@ + + + + + + + carepoint.tests.models.cph.test_fdb_form — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.tests.models.cph.test_fdb_form

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+import unittest
+from sqlalchemy.schema import Table
+from carepoint.tests.db.db import DatabaseTest
+from carepoint.models.cph.fdb_form import FdbForm
+
+
+
[docs]class TestModelsCphFdbForm(DatabaseTest): + +
[docs] def test_table_initialization(self, ): + self.assertIsInstance(FdbForm.__table__, Table)
+ + +if __name__ == '__main__': + unittest.main() +
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/tests/models/cph/test_fdb_gcn.html b/_modules/carepoint/tests/models/cph/test_fdb_gcn.html new file mode 100644 index 0000000..8f3363f --- /dev/null +++ b/_modules/carepoint/tests/models/cph/test_fdb_gcn.html @@ -0,0 +1,130 @@ + + + + + + + carepoint.tests.models.cph.test_fdb_gcn — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.tests.models.cph.test_fdb_gcn

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+import unittest
+from sqlalchemy.schema import Table
+from carepoint.tests.db.db import DatabaseTest
+from carepoint.models.cph.fdb_gcn import FdbGcn
+
+
+
[docs]class TestModelsCphFdbGcn(DatabaseTest): + +
[docs] def test_table_initialization(self, ): + self.assertIsInstance(FdbGcn.__table__, Table)
+ + +if __name__ == '__main__': + unittest.main() +
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/tests/models/cph/test_fdb_gcn_seq.html b/_modules/carepoint/tests/models/cph/test_fdb_gcn_seq.html new file mode 100644 index 0000000..26a7a93 --- /dev/null +++ b/_modules/carepoint/tests/models/cph/test_fdb_gcn_seq.html @@ -0,0 +1,130 @@ + + + + + + + carepoint.tests.models.cph.test_fdb_gcn_seq — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.tests.models.cph.test_fdb_gcn_seq

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+import unittest
+from sqlalchemy.schema import Table
+from carepoint.tests.db.db import DatabaseTest
+from carepoint.models.cph.fdb_gcn_seq import FdbGcnSeq
+
+
+
[docs]class TestModelsCphFdbGcnSeq(DatabaseTest): + +
[docs] def test_table_initialization(self, ): + self.assertIsInstance(FdbGcnSeq.__table__, Table)
+ + +if __name__ == '__main__': + unittest.main() +
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/tests/models/cph/test_fdb_img.html b/_modules/carepoint/tests/models/cph/test_fdb_img.html new file mode 100644 index 0000000..656ba95 --- /dev/null +++ b/_modules/carepoint/tests/models/cph/test_fdb_img.html @@ -0,0 +1,130 @@ + + + + + + + carepoint.tests.models.cph.test_fdb_img — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.tests.models.cph.test_fdb_img

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+import unittest
+from sqlalchemy.schema import Table
+from carepoint.tests.db.db import DatabaseTest
+from carepoint.models.cph.fdb_img import FdbImg
+
+
+
[docs]class TestModelsCphFdbImg(DatabaseTest): + +
[docs] def test_table_initialization(self, ): + self.assertIsInstance(FdbImg.__table__, Table)
+ + +if __name__ == '__main__': + unittest.main() +
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/tests/models/cph/test_fdb_img_date.html b/_modules/carepoint/tests/models/cph/test_fdb_img_date.html new file mode 100644 index 0000000..febe2d4 --- /dev/null +++ b/_modules/carepoint/tests/models/cph/test_fdb_img_date.html @@ -0,0 +1,130 @@ + + + + + + + carepoint.tests.models.cph.test_fdb_img_date — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.tests.models.cph.test_fdb_img_date

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+import unittest
+from sqlalchemy.schema import Table
+from carepoint.tests.db.db import DatabaseTest
+from carepoint.models.cph.fdb_img_date import FdbImgDate
+
+
+
[docs]class TestModelsCphFdbImgDate(DatabaseTest): + +
[docs] def test_table_initialization(self, ): + self.assertIsInstance(FdbImgDate.__table__, Table)
+ + +if __name__ == '__main__': + unittest.main() +
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/tests/models/cph/test_fdb_img_id.html b/_modules/carepoint/tests/models/cph/test_fdb_img_id.html new file mode 100644 index 0000000..089386d --- /dev/null +++ b/_modules/carepoint/tests/models/cph/test_fdb_img_id.html @@ -0,0 +1,130 @@ + + + + + + + carepoint.tests.models.cph.test_fdb_img_id — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.tests.models.cph.test_fdb_img_id

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+import unittest
+from sqlalchemy.schema import Table
+from carepoint.tests.db.db import DatabaseTest
+from carepoint.models.cph.fdb_img_id import FdbImgId
+
+
+
[docs]class TestModelsCphFdbImgId(DatabaseTest): + +
[docs] def test_table_initialization(self, ): + self.assertIsInstance(FdbImgId.__table__, Table)
+ + +if __name__ == '__main__': + unittest.main() +
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/tests/models/cph/test_fdb_img_mfg.html b/_modules/carepoint/tests/models/cph/test_fdb_img_mfg.html new file mode 100644 index 0000000..290b5c9 --- /dev/null +++ b/_modules/carepoint/tests/models/cph/test_fdb_img_mfg.html @@ -0,0 +1,130 @@ + + + + + + + carepoint.tests.models.cph.test_fdb_img_mfg — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.tests.models.cph.test_fdb_img_mfg

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+import unittest
+from sqlalchemy.schema import Table
+from carepoint.tests.db.db import DatabaseTest
+from carepoint.models.cph.fdb_img_mfg import FdbImgMfg
+
+
+
[docs]class TestModelsCphFdbImgMfg(DatabaseTest): + +
[docs] def test_table_initialization(self, ): + self.assertIsInstance(FdbImgMfg.__table__, Table)
+ + +if __name__ == '__main__': + unittest.main() +
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/tests/models/cph/test_fdb_lbl_rid.html b/_modules/carepoint/tests/models/cph/test_fdb_lbl_rid.html new file mode 100644 index 0000000..6cc50ed --- /dev/null +++ b/_modules/carepoint/tests/models/cph/test_fdb_lbl_rid.html @@ -0,0 +1,130 @@ + + + + + + + carepoint.tests.models.cph.test_fdb_lbl_rid — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.tests.models.cph.test_fdb_lbl_rid

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+import unittest
+from sqlalchemy.schema import Table
+from carepoint.tests.db.db import DatabaseTest
+from carepoint.models.cph.fdb_lbl_rid import FdbLblRid
+
+
+
[docs]class TestModelsCphFdbLblRid(DatabaseTest): + +
[docs] def test_table_initialization(self, ): + self.assertIsInstance(FdbLblRid.__table__, Table)
+ + +if __name__ == '__main__': + unittest.main() +
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/tests/models/cph/test_fdb_ndc.html b/_modules/carepoint/tests/models/cph/test_fdb_ndc.html new file mode 100644 index 0000000..d9cd833 --- /dev/null +++ b/_modules/carepoint/tests/models/cph/test_fdb_ndc.html @@ -0,0 +1,130 @@ + + + + + + + carepoint.tests.models.cph.test_fdb_ndc — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.tests.models.cph.test_fdb_ndc

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+import unittest
+from sqlalchemy.schema import Table
+from carepoint.tests.db.db import DatabaseTest
+from carepoint.models.cph.fdb_ndc import FdbNdc
+
+
+
[docs]class TestModelsCphFdbNdc(DatabaseTest): + +
[docs] def test_table_initialization(self, ): + self.assertIsInstance(FdbNdc.__table__, Table)
+ + +if __name__ == '__main__': + unittest.main() +
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/tests/models/cph/test_fdb_ndc_cs_ext.html b/_modules/carepoint/tests/models/cph/test_fdb_ndc_cs_ext.html new file mode 100644 index 0000000..9e9b882 --- /dev/null +++ b/_modules/carepoint/tests/models/cph/test_fdb_ndc_cs_ext.html @@ -0,0 +1,130 @@ + + + + + + + carepoint.tests.models.cph.test_fdb_ndc_cs_ext — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.tests.models.cph.test_fdb_ndc_cs_ext

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+import unittest
+from sqlalchemy.schema import Table
+from carepoint.tests.db.db import DatabaseTest
+from carepoint.models.cph.fdb_ndc_cs_ext import FdbNdcCsExt
+
+
+
[docs]class TestModelsCphFdbNdcCsExt(DatabaseTest): + +
[docs] def test_table_initialization(self, ): + self.assertIsInstance(FdbNdcCsExt.__table__, Table)
+ + +if __name__ == '__main__': + unittest.main() +
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/tests/models/cph/test_fdb_pem_moe.html b/_modules/carepoint/tests/models/cph/test_fdb_pem_moe.html new file mode 100644 index 0000000..cf7afa0 --- /dev/null +++ b/_modules/carepoint/tests/models/cph/test_fdb_pem_moe.html @@ -0,0 +1,130 @@ + + + + + + + carepoint.tests.models.cph.test_fdb_pem_moe — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.tests.models.cph.test_fdb_pem_moe

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+import unittest
+from sqlalchemy.schema import Table
+from carepoint.tests.db.db import DatabaseTest
+from carepoint.models.cph.fdb_pem_moe import FdbPemMoe
+
+
+
[docs]class TestModelsCphFdbPemMoe(DatabaseTest): + +
[docs] def test_table_initialization(self, ): + self.assertIsInstance(FdbPemMoe.__table__, Table)
+ + +if __name__ == '__main__': + unittest.main() +
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/tests/models/cph/test_fdb_pem_mogc.html b/_modules/carepoint/tests/models/cph/test_fdb_pem_mogc.html new file mode 100644 index 0000000..68f069b --- /dev/null +++ b/_modules/carepoint/tests/models/cph/test_fdb_pem_mogc.html @@ -0,0 +1,130 @@ + + + + + + + carepoint.tests.models.cph.test_fdb_pem_mogc — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.tests.models.cph.test_fdb_pem_mogc

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+import unittest
+from sqlalchemy.schema import Table
+from carepoint.tests.db.db import DatabaseTest
+from carepoint.models.cph.fdb_pem_mogc import FdbPemMogc
+
+
+
[docs]class TestModelsCphFdbPemMogc(DatabaseTest): + +
[docs] def test_table_initialization(self, ): + self.assertIsInstance(FdbPemMogc.__table__, Table)
+ + +if __name__ == '__main__': + unittest.main() +
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/tests/models/cph/test_fdb_price.html b/_modules/carepoint/tests/models/cph/test_fdb_price.html new file mode 100644 index 0000000..0eb2195 --- /dev/null +++ b/_modules/carepoint/tests/models/cph/test_fdb_price.html @@ -0,0 +1,130 @@ + + + + + + + carepoint.tests.models.cph.test_fdb_price — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.tests.models.cph.test_fdb_price

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+import unittest
+from sqlalchemy.schema import Table
+from carepoint.tests.db.db import DatabaseTest
+from carepoint.models.cph.fdb_price import FdbPrice
+
+
+
[docs]class TestModelsCphFdbPrice(DatabaseTest): + +
[docs] def test_table_initialization(self, ): + self.assertIsInstance(FdbPrice.__table__, Table)
+ + +if __name__ == '__main__': + unittest.main() +
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/tests/models/cph/test_fdb_price_type.html b/_modules/carepoint/tests/models/cph/test_fdb_price_type.html new file mode 100644 index 0000000..b599ed8 --- /dev/null +++ b/_modules/carepoint/tests/models/cph/test_fdb_price_type.html @@ -0,0 +1,130 @@ + + + + + + + carepoint.tests.models.cph.test_fdb_price_type — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.tests.models.cph.test_fdb_price_type

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+import unittest
+from sqlalchemy.schema import Table
+from carepoint.tests.db.db import DatabaseTest
+from carepoint.models.cph.fdb_price_type import FdbPriceType
+
+
+
[docs]class TestModelsCphFdbPriceType(DatabaseTest): + +
[docs] def test_table_initialization(self, ): + self.assertIsInstance(FdbPriceType.__table__, Table)
+ + +if __name__ == '__main__': + unittest.main() +
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/tests/models/cph/test_fdb_route.html b/_modules/carepoint/tests/models/cph/test_fdb_route.html new file mode 100644 index 0000000..b430ffe --- /dev/null +++ b/_modules/carepoint/tests/models/cph/test_fdb_route.html @@ -0,0 +1,130 @@ + + + + + + + carepoint.tests.models.cph.test_fdb_route — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.tests.models.cph.test_fdb_route

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+import unittest
+from sqlalchemy.schema import Table
+from carepoint.tests.db.db import DatabaseTest
+from carepoint.models.cph.fdb_route import FdbRoute
+
+
+
[docs]class TestModelsCphFdbRoute(DatabaseTest): + +
[docs] def test_table_initialization(self, ): + self.assertIsInstance(FdbRoute.__table__, Table)
+ + +if __name__ == '__main__': + unittest.main() +
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/tests/models/cph/test_fdb_unit.html b/_modules/carepoint/tests/models/cph/test_fdb_unit.html new file mode 100644 index 0000000..b2f675d --- /dev/null +++ b/_modules/carepoint/tests/models/cph/test_fdb_unit.html @@ -0,0 +1,130 @@ + + + + + + + carepoint.tests.models.cph.test_fdb_unit — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.tests.models.cph.test_fdb_unit

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+import unittest
+from sqlalchemy.schema import Table
+from carepoint.tests.db.db import DatabaseTest
+from carepoint.models.cph.fdb_unit import FdbUnit
+
+
+
[docs]class TestModelsCphFdbUnit(DatabaseTest): + +
[docs] def test_table_initialization(self, ): + self.assertIsInstance(FdbUnit.__table__, Table)
+ + +if __name__ == '__main__': + unittest.main() +
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/tests/models/cph/test_image_data.html b/_modules/carepoint/tests/models/cph/test_image_data.html new file mode 100644 index 0000000..ebdd7fe --- /dev/null +++ b/_modules/carepoint/tests/models/cph/test_image_data.html @@ -0,0 +1,137 @@ + + + + + + + carepoint.tests.models.cph.test_image_data — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.tests.models.cph.test_image_data

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+import unittest
+from sqlalchemy.schema import Table
+from carepoint.tests.db.db import DatabaseTest
+from carepoint.models.cph.image_data import ImageData
+
+
+
[docs]class TestImageData(DatabaseTest): + +
[docs] def test_table_initialization(self): + self.assertIsInstance(ImageData.__table__, Table)
+ +
[docs] def test_compute_image_path(self): + image = ImageData( + RootFolderName='root', + FullFileName='file', + ) + self.assertEqual(image.image_path, 'root/file')
+ + +if __name__ == '__main__': + unittest.main() +
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/tests/models/cph/test_item.html b/_modules/carepoint/tests/models/cph/test_item.html new file mode 100644 index 0000000..b7216e4 --- /dev/null +++ b/_modules/carepoint/tests/models/cph/test_item.html @@ -0,0 +1,130 @@ + + + + + + + carepoint.tests.models.cph.test_item — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.tests.models.cph.test_item

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+import unittest
+from sqlalchemy.schema import Table
+from carepoint.tests.db.db import DatabaseTest
+from carepoint.models.cph.item import Item
+
+
+
[docs]class TestModelsCphItem(DatabaseTest): + +
[docs] def test_table_initialization(self, ): + self.assertIsInstance(Item.__table__, Table)
+ + +if __name__ == '__main__': + unittest.main() +
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/tests/models/cph/test_order.html b/_modules/carepoint/tests/models/cph/test_order.html new file mode 100644 index 0000000..5dd06c2 --- /dev/null +++ b/_modules/carepoint/tests/models/cph/test_order.html @@ -0,0 +1,144 @@ + + + + + + + carepoint.tests.models.cph.test_order — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.tests.models.cph.test_order

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+import unittest
+from sqlalchemy.schema import Table
+from carepoint.tests.db.db import DatabaseTest
+from carepoint.models.cph.order import Order, EnumOrderState
+
+
+
[docs]class TestModelsCphOrder(DatabaseTest): + +
[docs] def test_table_initialization(self, ): + self.assertIsInstance(Order.__table__, Table)
+ +
[docs] def new_record(self): + self.type_cn = 20 + obj = Order() + obj.order_state_cn = self.type_cn + return obj
+ +
[docs] def test_order_state(self): + """ It should return proper Enum for state cn """ + obj = self.new_record() + self.assertEqual( + EnumOrderState(self.type_cn), + obj.order_state, + )
+ + +if __name__ == '__main__': + unittest.main() +
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/tests/models/cph/test_order_line.html b/_modules/carepoint/tests/models/cph/test_order_line.html new file mode 100644 index 0000000..93f76be --- /dev/null +++ b/_modules/carepoint/tests/models/cph/test_order_line.html @@ -0,0 +1,130 @@ + + + + + + + carepoint.tests.models.cph.test_order_line — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.tests.models.cph.test_order_line

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+import unittest
+from sqlalchemy.schema import Table
+from carepoint.tests.db.db import DatabaseTest
+from carepoint.models.cph.order_line import OrderLine
+
+
+
[docs]class TestModelsCphOrderLine(DatabaseTest): + +
[docs] def test_table_initialization(self, ): + self.assertIsInstance(OrderLine.__table__, Table)
+ + +if __name__ == '__main__': + unittest.main() +
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/tests/models/cph/test_order_line_non_rx.html b/_modules/carepoint/tests/models/cph/test_order_line_non_rx.html new file mode 100644 index 0000000..b3f3c75 --- /dev/null +++ b/_modules/carepoint/tests/models/cph/test_order_line_non_rx.html @@ -0,0 +1,130 @@ + + + + + + + carepoint.tests.models.cph.test_order_line_non_rx — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.tests.models.cph.test_order_line_non_rx

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+import unittest
+from sqlalchemy.schema import Table
+from carepoint.tests.db.db import DatabaseTest
+from carepoint.models.cph.order_line_non_rx import OrderLineNonRx
+
+
+
[docs]class TestModelsCphOrderLineNonRx(DatabaseTest): + +
[docs] def test_table_initialization(self, ): + self.assertIsInstance(OrderLineNonRx.__table__, Table)
+ + +if __name__ == '__main__': + unittest.main() +
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/tests/models/cph/test_order_ship.html b/_modules/carepoint/tests/models/cph/test_order_ship.html new file mode 100644 index 0000000..7c0d25b --- /dev/null +++ b/_modules/carepoint/tests/models/cph/test_order_ship.html @@ -0,0 +1,130 @@ + + + + + + + carepoint.tests.models.cph.test_order_ship — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.tests.models.cph.test_order_ship

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+import unittest
+from sqlalchemy.schema import Table
+from carepoint.tests.db.db import DatabaseTest
+from carepoint.models.cph.order_ship import OrderShip
+
+
+
[docs]class TestModelsCphOrderShip(DatabaseTest): + +
[docs] def test_table_initialization(self, ): + self.assertIsInstance(OrderShip.__table__, Table)
+ + +if __name__ == '__main__': + unittest.main() +
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/tests/models/cph/test_order_status.html b/_modules/carepoint/tests/models/cph/test_order_status.html new file mode 100644 index 0000000..bcc4e15 --- /dev/null +++ b/_modules/carepoint/tests/models/cph/test_order_status.html @@ -0,0 +1,144 @@ + + + + + + + carepoint.tests.models.cph.test_order_status — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.tests.models.cph.test_order_status

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+import unittest
+from sqlalchemy.schema import Table
+from carepoint.tests.db.db import DatabaseTest
+from carepoint.models.cph.order_status import OrderStatus, EnumOrderState
+
+
+
[docs]class TestModelsCphOrderStatus(DatabaseTest): + +
[docs] def test_table_initialization(self, ): + self.assertIsInstance(OrderStatus.__table__, Table)
+ +
[docs] def new_record(self): + self.type_cn = 20 + obj = OrderStatus() + obj.state_cn = self.type_cn + return obj
+ +
[docs] def test_state(self): + """ It should return proper Enum for state cn """ + obj = self.new_record() + self.assertEqual( + EnumOrderState(self.type_cn), + obj.state, + )
+ + +if __name__ == '__main__': + unittest.main() +
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/tests/models/cph/test_organization.html b/_modules/carepoint/tests/models/cph/test_organization.html new file mode 100644 index 0000000..4f53c65 --- /dev/null +++ b/_modules/carepoint/tests/models/cph/test_organization.html @@ -0,0 +1,130 @@ + + + + + + + carepoint.tests.models.cph.test_organization — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.tests.models.cph.test_organization

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+import unittest
+from sqlalchemy.schema import Table
+from carepoint.tests.db.db import DatabaseTest
+from carepoint.models.cph.organization import Organization
+
+
+
[docs]class TestModelsCphOrganization(DatabaseTest): + +
[docs] def test_table_initialization(self, ): + self.assertIsInstance(Organization.__table__, Table)
+ + +if __name__ == '__main__': + unittest.main() +
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/tests/models/cph/test_organization_address.html b/_modules/carepoint/tests/models/cph/test_organization_address.html new file mode 100644 index 0000000..4aacf26 --- /dev/null +++ b/_modules/carepoint/tests/models/cph/test_organization_address.html @@ -0,0 +1,134 @@ + + + + + + + carepoint.tests.models.cph.test_organization_address — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.tests.models.cph.test_organization_address

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+import unittest
+from sqlalchemy.schema import Table
+from carepoint.tests.db.db import DatabaseTest
+from carepoint.models.cph.organization_address import OrganizationAddress
+
+
+
[docs]class TestModelsCphOrganizationAddress(DatabaseTest): + +
[docs] def test_table_initialization(self): + self.assertIsInstance(OrganizationAddress.__table__, Table)
+ +
[docs] def test_addr_mixin_col(self): + self.assertTrue( + hasattr(OrganizationAddress, 'addr_id') + )
+ +if __name__ == '__main__': + unittest.main() +
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/tests/models/cph/test_pathology.html b/_modules/carepoint/tests/models/cph/test_pathology.html new file mode 100644 index 0000000..c3d3063 --- /dev/null +++ b/_modules/carepoint/tests/models/cph/test_pathology.html @@ -0,0 +1,130 @@ + + + + + + + carepoint.tests.models.cph.test_pathology — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.tests.models.cph.test_pathology

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+import unittest
+from sqlalchemy.schema import Table
+from carepoint.tests.db.db import DatabaseTest
+from carepoint.models.cph.pathology import Pathology
+
+
+
[docs]class TestModelsCphPathology(DatabaseTest): + +
[docs] def test_table_initialization(self, ): + self.assertIsInstance(Pathology.__table__, Table)
+ + +if __name__ == '__main__': + unittest.main() +
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/tests/models/cph/test_pathology_code_type.html b/_modules/carepoint/tests/models/cph/test_pathology_code_type.html new file mode 100644 index 0000000..4545ce6 --- /dev/null +++ b/_modules/carepoint/tests/models/cph/test_pathology_code_type.html @@ -0,0 +1,130 @@ + + + + + + + carepoint.tests.models.cph.test_pathology_code_type — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.tests.models.cph.test_pathology_code_type

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+import unittest
+from sqlalchemy.schema import Table
+from carepoint.tests.db.db import DatabaseTest
+from carepoint.models.cph.pathology_code_type import PathologyCodeType
+
+
+
[docs]class TestModelsCphPathologyCodeType(DatabaseTest): + +
[docs] def test_table_initialization(self, ): + self.assertIsInstance(PathologyCodeType.__table__, Table)
+ + +if __name__ == '__main__': + unittest.main() +
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/tests/models/cph/test_patient.html b/_modules/carepoint/tests/models/cph/test_patient.html new file mode 100644 index 0000000..272532d --- /dev/null +++ b/_modules/carepoint/tests/models/cph/test_patient.html @@ -0,0 +1,130 @@ + + + + + + + carepoint.tests.models.cph.test_patient — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.tests.models.cph.test_patient

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+import unittest
+from sqlalchemy.schema import Table
+from carepoint.tests.db.db import DatabaseTest
+from carepoint.models.cph.patient import Patient
+
+
+
[docs]class TestModelsCphPatient(DatabaseTest): + +
[docs] def test_table_initialization(self, ): + self.assertIsInstance(Patient.__table__, Table)
+ + +if __name__ == '__main__': + unittest.main() +
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/tests/models/cph/test_patient_address.html b/_modules/carepoint/tests/models/cph/test_patient_address.html new file mode 100644 index 0000000..74b7e76 --- /dev/null +++ b/_modules/carepoint/tests/models/cph/test_patient_address.html @@ -0,0 +1,134 @@ + + + + + + + carepoint.tests.models.cph.test_patient_address — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.tests.models.cph.test_patient_address

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+import unittest
+from sqlalchemy.schema import Table
+from carepoint.tests.db.db import DatabaseTest
+from carepoint.models.cph.patient_address import PatientAddress
+
+
+
[docs]class TestModelsCphPatientAddress(DatabaseTest): + +
[docs] def test_table_initialization(self): + self.assertIsInstance(PatientAddress.__table__, Table)
+ +
[docs] def test_addr_mixin_col(self): + self.assertTrue( + hasattr(PatientAddress, 'addr_id') + )
+ +if __name__ == '__main__': + unittest.main() +
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/tests/models/cph/test_patient_allergy.html b/_modules/carepoint/tests/models/cph/test_patient_allergy.html new file mode 100644 index 0000000..da9c473 --- /dev/null +++ b/_modules/carepoint/tests/models/cph/test_patient_allergy.html @@ -0,0 +1,130 @@ + + + + + + + carepoint.tests.models.cph.test_patient_allergy — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.tests.models.cph.test_patient_allergy

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+import unittest
+from sqlalchemy.schema import Table
+from carepoint.tests.db.db import DatabaseTest
+from carepoint.models.cph.patient_allergy import PatientAllergy
+
+
+
[docs]class TestModelsCphPatientAllergy(DatabaseTest): + +
[docs] def test_table_initialization(self, ): + self.assertIsInstance(PatientAllergy.__table__, Table)
+ + +if __name__ == '__main__': + unittest.main() +
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/tests/models/cph/test_patient_disease.html b/_modules/carepoint/tests/models/cph/test_patient_disease.html new file mode 100644 index 0000000..8011edc --- /dev/null +++ b/_modules/carepoint/tests/models/cph/test_patient_disease.html @@ -0,0 +1,130 @@ + + + + + + + carepoint.tests.models.cph.test_patient_disease — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.tests.models.cph.test_patient_disease

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+import unittest
+from sqlalchemy.schema import Table
+from carepoint.tests.db.db import DatabaseTest
+from carepoint.models.cph.patient_disease import PatientDisease
+
+
+
[docs]class TestModelsCphPatientDisease(DatabaseTest): + +
[docs] def test_table_initialization(self, ): + self.assertIsInstance(PatientDisease.__table__, Table)
+ + +if __name__ == '__main__': + unittest.main() +
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/tests/models/cph/test_patient_phone.html b/_modules/carepoint/tests/models/cph/test_patient_phone.html new file mode 100644 index 0000000..d2227ec --- /dev/null +++ b/_modules/carepoint/tests/models/cph/test_patient_phone.html @@ -0,0 +1,134 @@ + + + + + + + carepoint.tests.models.cph.test_patient_phone — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.tests.models.cph.test_patient_phone

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+import unittest
+from sqlalchemy.schema import Table
+from carepoint.tests.db.db import DatabaseTest
+from carepoint.models.cph.patient_phone import PatientPhone
+
+
+
[docs]class TestModelsCphPatientPhone(DatabaseTest): + +
[docs] def test_table_initialization(self): + self.assertIsInstance(PatientPhone.__table__, Table)
+ +
[docs] def test_phone_mixin_col(self): + self.assertTrue( + hasattr(PatientPhone, 'phone_id') + )
+ +if __name__ == '__main__': + unittest.main() +
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/tests/models/cph/test_phone.html b/_modules/carepoint/tests/models/cph/test_phone.html new file mode 100644 index 0000000..02a03dc --- /dev/null +++ b/_modules/carepoint/tests/models/cph/test_phone.html @@ -0,0 +1,130 @@ + + + + + + + carepoint.tests.models.cph.test_phone — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.tests.models.cph.test_phone

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+import unittest
+from sqlalchemy.schema import Table
+from carepoint.tests.db.db import DatabaseTest
+from carepoint.models.cph.phone import Phone
+
+
+
[docs]class TestModelsCphPhone(DatabaseTest): + +
[docs] def test_table_initialization(self, ): + self.assertIsInstance(Phone.__table__, Table)
+ + +if __name__ == '__main__': + unittest.main() +
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/tests/models/cph/test_prescription.html b/_modules/carepoint/tests/models/cph/test_prescription.html new file mode 100644 index 0000000..1758323 --- /dev/null +++ b/_modules/carepoint/tests/models/cph/test_prescription.html @@ -0,0 +1,130 @@ + + + + + + + carepoint.tests.models.cph.test_prescription — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.tests.models.cph.test_prescription

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+import unittest
+from sqlalchemy.schema import Table
+from carepoint.tests.db.db import DatabaseTest
+from carepoint.models.cph.prescription import Prescription
+
+
+
[docs]class TestModelsCphPrescription(DatabaseTest): + +
[docs] def test_table_initialization(self, ): + self.assertIsInstance(Prescription.__table__, Table)
+ + +if __name__ == '__main__': + unittest.main() +
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/tests/models/cph/test_store.html b/_modules/carepoint/tests/models/cph/test_store.html new file mode 100644 index 0000000..ab7bc09 --- /dev/null +++ b/_modules/carepoint/tests/models/cph/test_store.html @@ -0,0 +1,130 @@ + + + + + + + carepoint.tests.models.cph.test_store — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.tests.models.cph.test_store

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+import unittest
+from sqlalchemy.schema import Table
+from carepoint.tests.db.db import DatabaseTest
+from carepoint.models.cph.store import Store
+
+
+
[docs]class TestModelsCphStore(DatabaseTest): + +
[docs] def test_table_initialization(self, ): + self.assertIsInstance(Store.__table__, Table)
+ + +if __name__ == '__main__': + unittest.main() +
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/tests/models/cph/test_store_address.html b/_modules/carepoint/tests/models/cph/test_store_address.html new file mode 100644 index 0000000..6acf8a2 --- /dev/null +++ b/_modules/carepoint/tests/models/cph/test_store_address.html @@ -0,0 +1,134 @@ + + + + + + + carepoint.tests.models.cph.test_store_address — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.tests.models.cph.test_store_address

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+import unittest
+from sqlalchemy.schema import Table
+from carepoint.tests.db.db import DatabaseTest
+from carepoint.models.cph.store_address import StoreAddress
+
+
+
[docs]class TestModelsCphStoreAddress(DatabaseTest): + +
[docs] def test_table_initialization(self): + self.assertIsInstance(StoreAddress.__table__, Table)
+ +
[docs] def test_addr_mixin_col(self): + self.assertTrue( + hasattr(StoreAddress, 'addr_id') + )
+ +if __name__ == '__main__': + unittest.main() +
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/tests/models/cph/test_store_param.html b/_modules/carepoint/tests/models/cph/test_store_param.html new file mode 100644 index 0000000..5ab740a --- /dev/null +++ b/_modules/carepoint/tests/models/cph/test_store_param.html @@ -0,0 +1,130 @@ + + + + + + + carepoint.tests.models.cph.test_store_param — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.tests.models.cph.test_store_param

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+import unittest
+from sqlalchemy.schema import Table
+from carepoint.tests.db.db import DatabaseTest
+from carepoint.models.cph.store_param import StoreParam
+
+
+
[docs]class TestModelsCphStoreParam(DatabaseTest): + +
[docs] def test_table_initialization(self, ): + self.assertIsInstance(StoreParam.__table__, Table)
+ + +if __name__ == '__main__': + unittest.main() +
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/tests/models/cph/test_store_phone.html b/_modules/carepoint/tests/models/cph/test_store_phone.html new file mode 100644 index 0000000..172c52e --- /dev/null +++ b/_modules/carepoint/tests/models/cph/test_store_phone.html @@ -0,0 +1,134 @@ + + + + + + + carepoint.tests.models.cph.test_store_phone — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.tests.models.cph.test_store_phone

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+import unittest
+from sqlalchemy.schema import Table
+from carepoint.tests.db.db import DatabaseTest
+from carepoint.models.cph.store_phone import StorePhone
+
+
+
[docs]class TestModelsCphStorePhone(DatabaseTest): + +
[docs] def test_table_initialization(self): + self.assertIsInstance(StorePhone.__table__, Table)
+ +
[docs] def test_phone_mixin_col(self): + self.assertTrue( + hasattr(StorePhone, 'phone_id') + )
+ +if __name__ == '__main__': + unittest.main() +
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/tests/models/cph/test_user.html b/_modules/carepoint/tests/models/cph/test_user.html new file mode 100644 index 0000000..94ab16b --- /dev/null +++ b/_modules/carepoint/tests/models/cph/test_user.html @@ -0,0 +1,144 @@ + + + + + + + carepoint.tests.models.cph.test_user — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.tests.models.cph.test_user

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+import unittest
+from sqlalchemy.schema import Table
+from carepoint.tests.db.db import DatabaseTest
+from carepoint.models.cph.user import EnumUserType, User
+
+
+
[docs]class TestModelsCphUser(DatabaseTest): + +
[docs] def new_record(self, type_cd='U'): + self.type_cd = type_cd + obj = User() + obj.user_type_cd = type_cd + return obj
+ +
[docs] def test_table_initialization(self, ): + self.assertIsInstance(User.__table__, Table)
+ +
[docs] def test_user_type(self): + """ It should return proper Enum for user type cd """ + obj = self.new_record() + self.assertEqual( + obj.user_type, + EnumUserType(self.type_cd), + )
+ + +if __name__ == '__main__': + unittest.main() +
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/tests/models/cph/test_vendor.html b/_modules/carepoint/tests/models/cph/test_vendor.html new file mode 100644 index 0000000..df6a9ed --- /dev/null +++ b/_modules/carepoint/tests/models/cph/test_vendor.html @@ -0,0 +1,130 @@ + + + + + + + carepoint.tests.models.cph.test_vendor — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.tests.models.cph.test_vendor

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+import unittest
+from sqlalchemy.schema import Table
+from carepoint.tests.db.db import DatabaseTest
+from carepoint.models.cph.vendor import Vendor
+
+
+
[docs]class TestModelsCphVendor(DatabaseTest): + +
[docs] def test_table_initialization(self, ): + self.assertIsInstance(Vendor.__table__, Table)
+ + +if __name__ == '__main__': + unittest.main() +
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/tests/models/test_address_mixin.html b/_modules/carepoint/tests/models/test_address_mixin.html new file mode 100644 index 0000000..da6439c --- /dev/null +++ b/_modules/carepoint/tests/models/test_address_mixin.html @@ -0,0 +1,140 @@ + + + + + + + carepoint.tests.models.test_address_mixin — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.tests.models.test_address_mixin

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+import unittest
+from sqlalchemy.schema import Table
+from carepoint.tests.db.db import DatabaseTest
+from carepoint.models.address_mixin import AddressMixin, EnumAddressType
+
+
+
[docs]class TestAddressMixin(DatabaseTest): + +
[docs] def setUp(self): + super(TestAddressMixin, self).setUp() + self.type_cn = 2 + self.obj = AddressMixin() + self.obj.addr_type_cn = self.type_cn
+ +
[docs] def test_addr_type(self): + """ It should return proper Enum for type cn """ + self.assertEqual( + EnumAddressType(self.type_cn), + self.obj.addr_type, + )
+ + +if __name__ == '__main__': + unittest.main() +
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/carepoint/tests/models/test_phone_mixin.html b/_modules/carepoint/tests/models/test_phone_mixin.html new file mode 100644 index 0000000..e50d96c --- /dev/null +++ b/_modules/carepoint/tests/models/test_phone_mixin.html @@ -0,0 +1,140 @@ + + + + + + + carepoint.tests.models.test_phone_mixin — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for carepoint.tests.models.test_phone_mixin

+# -*- coding: utf-8 -*-
+# Copyright 2015-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+import unittest
+from sqlalchemy.schema import Table
+from carepoint.tests.db.db import DatabaseTest
+from carepoint.models.phone_mixin import PhoneMixin, EnumPhoneType
+
+
+
[docs]class TestPhoneMixin(DatabaseTest): + +
[docs] def setUp(self): + super(TestPhoneMixin, self).setUp() + self.type_cn = 2 + self.obj = PhoneMixin() + self.obj.phone_type_cn = self.type_cn
+ +
[docs] def test_addr_type(self): + """ It should return proper Enum for type cn """ + self.assertEqual( + EnumPhoneType(self.type_cn), + self.obj.phone_type, + )
+ + +if __name__ == '__main__': + unittest.main() +
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/index.html b/_modules/index.html new file mode 100644 index 0000000..e1955c5 --- /dev/null +++ b/_modules/index.html @@ -0,0 +1,253 @@ + + + + + + + Overview: module code — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

All modules for which code is available

+ + +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/setup.html b/_modules/setup.html new file mode 100644 index 0000000..e494f59 --- /dev/null +++ b/_modules/setup.html @@ -0,0 +1,203 @@ + + + + + + + setup — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for setup

+# -*- coding: utf-8 -*-
+# Copyright 2016-TODAY LasLabs Inc.
+# License MIT (https://opensource.org/licenses/MIT).
+
+from setuptools import Command, setup
+from setuptools import find_packages
+from unittest import TestLoader, TextTestRunner
+
+from os import environ, path
+
+
+PROJECT = 'carepoint'
+SHORT_DESC = (
+    'This library will allow you to interact with a remote CarePoint '
+    'instance using Python.'
+)
+README_FILE = 'README.rst'
+
+version = environ.get('RELEASE') or environ.get('VERSION') or '0.0.0'
+
+if environ.get('TRAVIS_BUILD_NUMBER'):
+    version += 'b%s' % environ.get('TRAVIS_BUILD_NUMBER')
+
+
+setup_vals = {
+    'name': PROJECT,
+    'author': 'LasLabs Inc.',
+    'author_email': 'support@laslabs.com',
+    'description': SHORT_DESC,
+    'url': 'https://laslabs.github.io/python-%s' % PROJECT,
+    'download_url': 'https://github.com/LasLabs/python-%s' % PROJECT,
+    'license': 'MIT',
+    'classifiers': [
+        'Development Status :: 4 - Beta',
+        'Environment :: Console',
+        'Intended Audience :: Developers',
+        'Intended Audience :: Healthcare Industry',
+        'License :: OSI Approved :: MIT License',
+        'Operating System :: POSIX :: Linux',
+        'Programming Language :: Python',
+        'Topic :: Software Development :: Libraries :: Python Modules',
+    ],
+    'version': version,
+}
+
+
+if path.exists(README_FILE):
+    with open(README_FILE) as fh:
+        setup_vals['long_description'] = fh.read()
+
+
+install_requires = []
+if path.exists('requirements.txt'):
+    with open('requirements.txt') as fh:
+        install_requires = fh.read().splitlines()
+
+
+
[docs]class FailTestException(Exception): + """ It provides a failing build """ + pass
+ + +
[docs]class Tests(Command): + ''' Run test & coverage, save reports as XML ''' + + user_options = [] # < For Command API compatibility + +
[docs] def initialize_options(self, ): + pass
+ +
[docs] def finalize_options(self, ): + pass
+ +
[docs] def run(self, ): + loader = TestLoader() + tests = loader.discover('.', 'test_*.py') + t = TextTestRunner(verbosity=1) + res = t.run(tests) + if not res.wasSuccessful(): + raise FailTestException()
+ +if __name__ == "__main__": + setup( + packages=find_packages(exclude=('tests')), + cmdclass={'test': Tests}, + tests_require=[ + 'mock', + ], + install_requires=install_requires, + **setup_vals + ) +
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/sqlalchemy/ext/declarative/api.html b/_modules/sqlalchemy/ext/declarative/api.html new file mode 100644 index 0000000..c23214f --- /dev/null +++ b/_modules/sqlalchemy/ext/declarative/api.html @@ -0,0 +1,808 @@ + + + + + + + sqlalchemy.ext.declarative.api — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for sqlalchemy.ext.declarative.api

+# ext/declarative/api.py
+# Copyright (C) 2005-2017 the SQLAlchemy authors and contributors
+# <see AUTHORS file>
+#
+# This module is part of SQLAlchemy and is released under
+# the MIT License: http://www.opensource.org/licenses/mit-license.php
+"""Public API functions and helpers for declarative."""
+
+
+from ...schema import Table, MetaData, Column
+from ...orm import synonym as _orm_synonym, \
+    comparable_property,\
+    interfaces, properties, attributes
+from ...orm.util import polymorphic_union
+from ...orm.base import _mapper_or_none
+from ...util import OrderedDict, hybridmethod, hybridproperty
+from ... import util
+from ... import exc
+import weakref
+
+from .base import _as_declarative, \
+    _declarative_constructor,\
+    _DeferredMapperConfig, _add_attribute
+from .clsregistry import _class_resolver
+
+
+def instrument_declarative(cls, registry, metadata):
+    """Given a class, configure the class declaratively,
+    using the given registry, which can be any dictionary, and
+    MetaData object.
+
+    """
+    if '_decl_class_registry' in cls.__dict__:
+        raise exc.InvalidRequestError(
+            "Class %r already has been "
+            "instrumented declaratively" % cls)
+    cls._decl_class_registry = registry
+    cls.metadata = metadata
+    _as_declarative(cls, cls.__name__, cls.__dict__)
+
+
+def has_inherited_table(cls):
+    """Given a class, return True if any of the classes it inherits from has a
+    mapped table, otherwise return False.
+
+    This is used in declarative mixins to build attributes that behave
+    differently for the base class vs. a subclass in an inheritance
+    hierarchy.
+
+    .. seealso::
+
+        :ref:`decl_mixin_inheritance`
+
+    """
+    for class_ in cls.__mro__[1:]:
+        if getattr(class_, '__table__', None) is not None:
+            return True
+    return False
+
+
+class DeclarativeMeta(type):
+    def __init__(cls, classname, bases, dict_):
+        if '_decl_class_registry' not in cls.__dict__:
+            _as_declarative(cls, classname, cls.__dict__)
+        type.__init__(cls, classname, bases, dict_)
+
+    def __setattr__(cls, key, value):
+        _add_attribute(cls, key, value)
+
+
+def synonym_for(name, map_column=False):
+    """Decorator, make a Python @property a query synonym for a column.
+
+    A decorator version of :func:`~sqlalchemy.orm.synonym`. The function being
+    decorated is the 'descriptor', otherwise passes its arguments through to
+    synonym()::
+
+      @synonym_for('col')
+      @property
+      def prop(self):
+          return 'special sauce'
+
+    The regular ``synonym()`` is also usable directly in a declarative setting
+    and may be convenient for read/write properties::
+
+      prop = synonym('col', descriptor=property(_read_prop, _write_prop))
+
+    """
+    def decorate(fn):
+        return _orm_synonym(name, map_column=map_column, descriptor=fn)
+    return decorate
+
+
+def comparable_using(comparator_factory):
+    """Decorator, allow a Python @property to be used in query criteria.
+
+    This is a  decorator front end to
+    :func:`~sqlalchemy.orm.comparable_property` that passes
+    through the comparator_factory and the function being decorated::
+
+      @comparable_using(MyComparatorType)
+      @property
+      def prop(self):
+          return 'special sauce'
+
+    The regular ``comparable_property()`` is also usable directly in a
+    declarative setting and may be convenient for read/write properties::
+
+      prop = comparable_property(MyComparatorType)
+
+    """
+    def decorate(fn):
+        return comparable_property(comparator_factory, fn)
+    return decorate
+
+
+class declared_attr(interfaces._MappedAttribute, property):
+    """Mark a class-level method as representing the definition of
+    a mapped property or special declarative member name.
+
+    @declared_attr turns the attribute into a scalar-like
+    property that can be invoked from the uninstantiated class.
+    Declarative treats attributes specifically marked with
+    @declared_attr as returning a construct that is specific
+    to mapping or declarative table configuration.  The name
+    of the attribute is that of what the non-dynamic version
+    of the attribute would be.
+
+    @declared_attr is more often than not applicable to mixins,
+    to define relationships that are to be applied to different
+    implementors of the class::
+
+        class ProvidesUser(object):
+            "A mixin that adds a 'user' relationship to classes."
+
+            @declared_attr
+            def user(self):
+                return relationship("User")
+
+    It also can be applied to mapped classes, such as to provide
+    a "polymorphic" scheme for inheritance::
+
+        class Employee(Base):
+            id = Column(Integer, primary_key=True)
+            type = Column(String(50), nullable=False)
+
+            @declared_attr
+            def __tablename__(cls):
+                return cls.__name__.lower()
+
+            @declared_attr
+            def __mapper_args__(cls):
+                if cls.__name__ == 'Employee':
+                    return {
+                            "polymorphic_on":cls.type,
+                            "polymorphic_identity":"Employee"
+                    }
+                else:
+                    return {"polymorphic_identity":cls.__name__}
+
+    .. versionchanged:: 0.8 :class:`.declared_attr` can be used with
+       non-ORM or extension attributes, such as user-defined attributes
+       or :func:`.association_proxy` objects, which will be assigned
+       to the class at class construction time.
+
+
+    """
+
+    def __init__(self, fget, cascading=False):
+        super(declared_attr, self).__init__(fget)
+        self.__doc__ = fget.__doc__
+        self._cascading = cascading
+
+    def __get__(desc, self, cls):
+        reg = cls.__dict__.get('_sa_declared_attr_reg', None)
+        if reg is None:
+            manager = attributes.manager_of_class(cls)
+            if manager is None:
+                util.warn(
+                    "Unmanaged access of declarative attribute %s from "
+                    "non-mapped class %s" %
+                    (desc.fget.__name__, cls.__name__))
+            return desc.fget(cls)
+        elif desc in reg:
+            return reg[desc]
+        else:
+            reg[desc] = obj = desc.fget(cls)
+            return obj
+
+    @hybridmethod
+    def _stateful(cls, **kw):
+        return _stateful_declared_attr(**kw)
+
+    @hybridproperty
+    def cascading(cls):
+        """Mark a :class:`.declared_attr` as cascading.
+
+        This is a special-use modifier which indicates that a column
+        or MapperProperty-based declared attribute should be configured
+        distinctly per mapped subclass, within a mapped-inheritance scenario.
+
+        Below, both MyClass as well as MySubClass will have a distinct
+        ``id`` Column object established::
+
+            class HasIdMixin(object):
+                @declared_attr.cascading
+                def id(cls):
+                    if has_inherited_table(cls):
+                        return Column(ForeignKey('myclass.id'), primary_key=True)
+                    else:
+                        return Column(Integer, primary_key=True)
+
+            class MyClass(HasIdMixin, Base):
+                __tablename__ = 'myclass'
+                # ...
+
+            class MySubClass(MyClass):
+                ""
+                # ...
+
+        The behavior of the above configuration is that ``MySubClass``
+        will refer to both its own ``id`` column as well as that of
+        ``MyClass`` underneath the attribute named ``some_id``.
+
+        .. seealso::
+
+            :ref:`declarative_inheritance`
+
+            :ref:`mixin_inheritance_columns`
+
+
+        """
+        return cls._stateful(cascading=True)
+
+
+class _stateful_declared_attr(declared_attr):
+    def __init__(self, **kw):
+        self.kw = kw
+
+    def _stateful(self, **kw):
+        new_kw = self.kw.copy()
+        new_kw.update(kw)
+        return _stateful_declared_attr(**new_kw)
+
+    def __call__(self, fn):
+        return declared_attr(fn, **self.kw)
+
+
+def declarative_base(bind=None, metadata=None, mapper=None, cls=object,
+                     name='Base', constructor=_declarative_constructor,
+                     class_registry=None,
+                     metaclass=DeclarativeMeta):
+    r"""Construct a base class for declarative class definitions.
+
+    The new base class will be given a metaclass that produces
+    appropriate :class:`~sqlalchemy.schema.Table` objects and makes
+    the appropriate :func:`~sqlalchemy.orm.mapper` calls based on the
+    information provided declaratively in the class and any subclasses
+    of the class.
+
+    :param bind: An optional
+      :class:`~sqlalchemy.engine.Connectable`, will be assigned
+      the ``bind`` attribute on the :class:`~sqlalchemy.schema.MetaData`
+      instance.
+
+    :param metadata:
+      An optional :class:`~sqlalchemy.schema.MetaData` instance.  All
+      :class:`~sqlalchemy.schema.Table` objects implicitly declared by
+      subclasses of the base will share this MetaData.  A MetaData instance
+      will be created if none is provided.  The
+      :class:`~sqlalchemy.schema.MetaData` instance will be available via the
+      `metadata` attribute of the generated declarative base class.
+
+    :param mapper:
+      An optional callable, defaults to :func:`~sqlalchemy.orm.mapper`. Will
+      be used to map subclasses to their Tables.
+
+    :param cls:
+      Defaults to :class:`object`. A type to use as the base for the generated
+      declarative base class. May be a class or tuple of classes.
+
+    :param name:
+      Defaults to ``Base``.  The display name for the generated
+      class.  Customizing this is not required, but can improve clarity in
+      tracebacks and debugging.
+
+    :param constructor:
+      Defaults to
+      :func:`~sqlalchemy.ext.declarative.base._declarative_constructor`, an
+      __init__ implementation that assigns \**kwargs for declared
+      fields and relationships to an instance.  If ``None`` is supplied,
+      no __init__ will be provided and construction will fall back to
+      cls.__init__ by way of the normal Python semantics.
+
+    :param class_registry: optional dictionary that will serve as the
+      registry of class names-> mapped classes when string names
+      are used to identify classes inside of :func:`.relationship`
+      and others.  Allows two or more declarative base classes
+      to share the same registry of class names for simplified
+      inter-base relationships.
+
+    :param metaclass:
+      Defaults to :class:`.DeclarativeMeta`.  A metaclass or __metaclass__
+      compatible callable to use as the meta type of the generated
+      declarative base class.
+
+    .. versionchanged:: 1.1 if :paramref:`.declarative_base.cls` is a single class (rather
+         than a tuple), the constructed base class will inherit its docstring.
+
+    .. seealso::
+
+        :func:`.as_declarative`
+
+    """
+    lcl_metadata = metadata or MetaData()
+    if bind:
+        lcl_metadata.bind = bind
+
+    if class_registry is None:
+        class_registry = weakref.WeakValueDictionary()
+
+    bases = not isinstance(cls, tuple) and (cls,) or cls
+    class_dict = dict(_decl_class_registry=class_registry,
+                      metadata=lcl_metadata)
+
+    if isinstance(cls, type):
+        class_dict['__doc__'] = cls.__doc__
+
+    if constructor:
+        class_dict['__init__'] = constructor
+    if mapper:
+        class_dict['__mapper_cls__'] = mapper
+
+    return metaclass(name, bases, class_dict)
+
+
+def as_declarative(**kw):
+    """
+    Class decorator for :func:`.declarative_base`.
+
+    Provides a syntactical shortcut to the ``cls`` argument
+    sent to :func:`.declarative_base`, allowing the base class
+    to be converted in-place to a "declarative" base::
+
+        from sqlalchemy.ext.declarative import as_declarative
+
+        @as_declarative()
+        class Base(object):
+            @declared_attr
+            def __tablename__(cls):
+                return cls.__name__.lower()
+            id = Column(Integer, primary_key=True)
+
+        class MyMappedClass(Base):
+            # ...
+
+    All keyword arguments passed to :func:`.as_declarative` are passed
+    along to :func:`.declarative_base`.
+
+    .. versionadded:: 0.8.3
+
+    .. seealso::
+
+        :func:`.declarative_base`
+
+    """
+    def decorate(cls):
+        kw['cls'] = cls
+        kw['name'] = cls.__name__
+        return declarative_base(**kw)
+
+    return decorate
+
+
+class ConcreteBase(object):
+    """A helper class for 'concrete' declarative mappings.
+
+    :class:`.ConcreteBase` will use the :func:`.polymorphic_union`
+    function automatically, against all tables mapped as a subclass
+    to this class.   The function is called via the
+    ``__declare_last__()`` function, which is essentially
+    a hook for the :meth:`.after_configured` event.
+
+    :class:`.ConcreteBase` produces a mapped
+    table for the class itself.  Compare to :class:`.AbstractConcreteBase`,
+    which does not.
+
+    Example::
+
+        from sqlalchemy.ext.declarative import ConcreteBase
+
+        class Employee(ConcreteBase, Base):
+            __tablename__ = 'employee'
+            employee_id = Column(Integer, primary_key=True)
+            name = Column(String(50))
+            __mapper_args__ = {
+                            'polymorphic_identity':'employee',
+                            'concrete':True}
+
+        class Manager(Employee):
+            __tablename__ = 'manager'
+            employee_id = Column(Integer, primary_key=True)
+            name = Column(String(50))
+            manager_data = Column(String(40))
+            __mapper_args__ = {
+                            'polymorphic_identity':'manager',
+                            'concrete':True}
+
+    .. seealso::
+
+        :class:`.AbstractConcreteBase`
+
+        :ref:`concrete_inheritance`
+
+        :ref:`inheritance_concrete_helpers`
+
+
+    """
+
+    @classmethod
+    def _create_polymorphic_union(cls, mappers):
+        return polymorphic_union(OrderedDict(
+            (mp.polymorphic_identity, mp.local_table)
+            for mp in mappers
+        ), 'type', 'pjoin')
+
+    @classmethod
+    def __declare_first__(cls):
+        m = cls.__mapper__
+        if m.with_polymorphic:
+            return
+
+        mappers = list(m.self_and_descendants)
+        pjoin = cls._create_polymorphic_union(mappers)
+        m._set_with_polymorphic(("*", pjoin))
+        m._set_polymorphic_on(pjoin.c.type)
+
+
+class AbstractConcreteBase(ConcreteBase):
+    """A helper class for 'concrete' declarative mappings.
+
+    :class:`.AbstractConcreteBase` will use the :func:`.polymorphic_union`
+    function automatically, against all tables mapped as a subclass
+    to this class.   The function is called via the
+    ``__declare_last__()`` function, which is essentially
+    a hook for the :meth:`.after_configured` event.
+
+    :class:`.AbstractConcreteBase` does produce a mapped class
+    for the base class, however it is not persisted to any table; it
+    is instead mapped directly to the "polymorphic" selectable directly
+    and is only used for selecting.  Compare to :class:`.ConcreteBase`,
+    which does create a persisted table for the base class.
+
+    Example::
+
+        from sqlalchemy.ext.declarative import AbstractConcreteBase
+
+        class Employee(AbstractConcreteBase, Base):
+            pass
+
+        class Manager(Employee):
+            __tablename__ = 'manager'
+            employee_id = Column(Integer, primary_key=True)
+            name = Column(String(50))
+            manager_data = Column(String(40))
+
+            __mapper_args__ = {
+                'polymorphic_identity':'manager',
+                'concrete':True}
+
+    The abstract base class is handled by declarative in a special way;
+    at class configuration time, it behaves like a declarative mixin
+    or an ``__abstract__`` base class.   Once classes are configured
+    and mappings are produced, it then gets mapped itself, but
+    after all of its decscendants.  This is a very unique system of mapping
+    not found in any other SQLAlchemy system.
+
+    Using this approach, we can specify columns and properties
+    that will take place on mapped subclasses, in the way that
+    we normally do as in :ref:`declarative_mixins`::
+
+        class Company(Base):
+            __tablename__ = 'company'
+            id = Column(Integer, primary_key=True)
+
+        class Employee(AbstractConcreteBase, Base):
+            employee_id = Column(Integer, primary_key=True)
+
+            @declared_attr
+            def company_id(cls):
+                return Column(ForeignKey('company.id'))
+
+            @declared_attr
+            def company(cls):
+                return relationship("Company")
+
+        class Manager(Employee):
+            __tablename__ = 'manager'
+
+            name = Column(String(50))
+            manager_data = Column(String(40))
+
+            __mapper_args__ = {
+                'polymorphic_identity':'manager',
+                'concrete':True}
+
+    When we make use of our mappings however, both ``Manager`` and
+    ``Employee`` will have an independently usable ``.company`` attribute::
+
+        session.query(Employee).filter(Employee.company.has(id=5))
+
+    .. versionchanged:: 1.0.0 - The mechanics of :class:`.AbstractConcreteBase`
+       have been reworked to support relationships established directly
+       on the abstract base, without any special configurational steps.
+
+    .. seealso::
+
+        :class:`.ConcreteBase`
+
+        :ref:`concrete_inheritance`
+
+        :ref:`inheritance_concrete_helpers`
+
+    """
+
+    __no_table__ = True
+
+    @classmethod
+    def __declare_first__(cls):
+        cls._sa_decl_prepare_nocascade()
+
+    @classmethod
+    def _sa_decl_prepare_nocascade(cls):
+        if getattr(cls, '__mapper__', None):
+            return
+
+        to_map = _DeferredMapperConfig.config_for_cls(cls)
+
+        # can't rely on 'self_and_descendants' here
+        # since technically an immediate subclass
+        # might not be mapped, but a subclass
+        # may be.
+        mappers = []
+        stack = list(cls.__subclasses__())
+        while stack:
+            klass = stack.pop()
+            stack.extend(klass.__subclasses__())
+            mn = _mapper_or_none(klass)
+            if mn is not None:
+                mappers.append(mn)
+        pjoin = cls._create_polymorphic_union(mappers)
+
+        # For columns that were declared on the class, these
+        # are normally ignored with the "__no_table__" mapping,
+        # unless they have a different attribute key vs. col name
+        # and are in the properties argument.
+        # In that case, ensure we update the properties entry
+        # to the correct column from the pjoin target table.
+        declared_cols = set(to_map.declared_columns)
+        for k, v in list(to_map.properties.items()):
+            if v in declared_cols:
+                to_map.properties[k] = pjoin.c[v.key]
+
+        to_map.local_table = pjoin
+
+        m_args = to_map.mapper_args_fn or dict
+
+        def mapper_args():
+            args = m_args()
+            args['polymorphic_on'] = pjoin.c.type
+            return args
+        to_map.mapper_args_fn = mapper_args
+
+        m = to_map.map()
+
+        for scls in cls.__subclasses__():
+            sm = _mapper_or_none(scls)
+            if sm and sm.concrete and cls in scls.__bases__:
+                sm._set_concrete_base(m)
+
+
+class DeferredReflection(object):
+    """A helper class for construction of mappings based on
+    a deferred reflection step.
+
+    Normally, declarative can be used with reflection by
+    setting a :class:`.Table` object using autoload=True
+    as the ``__table__`` attribute on a declarative class.
+    The caveat is that the :class:`.Table` must be fully
+    reflected, or at the very least have a primary key column,
+    at the point at which a normal declarative mapping is
+    constructed, meaning the :class:`.Engine` must be available
+    at class declaration time.
+
+    The :class:`.DeferredReflection` mixin moves the construction
+    of mappers to be at a later point, after a specific
+    method is called which first reflects all :class:`.Table`
+    objects created so far.   Classes can define it as such::
+
+        from sqlalchemy.ext.declarative import declarative_base
+        from sqlalchemy.ext.declarative import DeferredReflection
+        Base = declarative_base()
+
+        class MyClass(DeferredReflection, Base):
+            __tablename__ = 'mytable'
+
+    Above, ``MyClass`` is not yet mapped.   After a series of
+    classes have been defined in the above fashion, all tables
+    can be reflected and mappings created using
+    :meth:`.prepare`::
+
+        engine = create_engine("someengine://...")
+        DeferredReflection.prepare(engine)
+
+    The :class:`.DeferredReflection` mixin can be applied to individual
+    classes, used as the base for the declarative base itself,
+    or used in a custom abstract class.   Using an abstract base
+    allows that only a subset of classes to be prepared for a
+    particular prepare step, which is necessary for applications
+    that use more than one engine.  For example, if an application
+    has two engines, you might use two bases, and prepare each
+    separately, e.g.::
+
+        class ReflectedOne(DeferredReflection, Base):
+            __abstract__ = True
+
+        class ReflectedTwo(DeferredReflection, Base):
+            __abstract__ = True
+
+        class MyClass(ReflectedOne):
+            __tablename__ = 'mytable'
+
+        class MyOtherClass(ReflectedOne):
+            __tablename__ = 'myothertable'
+
+        class YetAnotherClass(ReflectedTwo):
+            __tablename__ = 'yetanothertable'
+
+        # ... etc.
+
+    Above, the class hierarchies for ``ReflectedOne`` and
+    ``ReflectedTwo`` can be configured separately::
+
+        ReflectedOne.prepare(engine_one)
+        ReflectedTwo.prepare(engine_two)
+
+    .. versionadded:: 0.8
+
+    """
+    @classmethod
+    def prepare(cls, engine):
+        """Reflect all :class:`.Table` objects for all current
+        :class:`.DeferredReflection` subclasses"""
+
+        to_map = _DeferredMapperConfig.classes_for_base(cls)
+        for thingy in to_map:
+            cls._sa_decl_prepare(thingy.local_table, engine)
+            thingy.map()
+            mapper = thingy.cls.__mapper__
+            metadata = mapper.class_.metadata
+            for rel in mapper._props.values():
+                if isinstance(rel, properties.RelationshipProperty) and \
+                        rel.secondary is not None:
+                    if isinstance(rel.secondary, Table):
+                        cls._reflect_table(rel.secondary, engine)
+                    elif isinstance(rel.secondary, _class_resolver):
+                        rel.secondary._resolvers += (
+                            cls._sa_deferred_table_resolver(engine, metadata),
+                        )
+
+    @classmethod
+    def _sa_deferred_table_resolver(cls, engine, metadata):
+        def _resolve(key):
+            t1 = Table(key, metadata)
+            cls._reflect_table(t1, engine)
+            return t1
+        return _resolve
+
+    @classmethod
+    def _sa_decl_prepare(cls, local_table, engine):
+        # autoload Table, which is already
+        # present in the metadata.  This
+        # will fill in db-loaded columns
+        # into the existing Table object.
+        if local_table is not None:
+            cls._reflect_table(local_table, engine)
+
+    @classmethod
+    def _reflect_table(cls, table, engine):
+        Table(table.name,
+              table.metadata,
+              extend_existing=True,
+              autoload_replace=False,
+              autoload=True,
+              autoload_with=engine,
+              schema=table.schema)
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/sqlalchemy/orm/attributes.html b/_modules/sqlalchemy/orm/attributes.html new file mode 100644 index 0000000..a3fbfc4 --- /dev/null +++ b/_modules/sqlalchemy/orm/attributes.html @@ -0,0 +1,1729 @@ + + + + + + + sqlalchemy.orm.attributes — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for sqlalchemy.orm.attributes

+# orm/attributes.py
+# Copyright (C) 2005-2017 the SQLAlchemy authors and contributors
+# <see AUTHORS file>
+#
+# This module is part of SQLAlchemy and is released under
+# the MIT License: http://www.opensource.org/licenses/mit-license.php
+
+"""Defines instrumentation for class attributes and their interaction
+with instances.
+
+This module is usually not directly visible to user applications, but
+defines a large part of the ORM's interactivity.
+
+
+"""
+
+import operator
+from .. import util, event, inspection
+from . import interfaces, collections, exc as orm_exc
+
+from .base import instance_state, instance_dict, manager_of_class
+
+from .base import PASSIVE_NO_RESULT, ATTR_WAS_SET, ATTR_EMPTY, NO_VALUE,\
+    NEVER_SET, NO_CHANGE, CALLABLES_OK, SQL_OK, RELATED_OBJECT_OK,\
+    INIT_OK, NON_PERSISTENT_OK, LOAD_AGAINST_COMMITTED, PASSIVE_OFF,\
+    PASSIVE_RETURN_NEVER_SET, PASSIVE_NO_INITIALIZE, PASSIVE_NO_FETCH,\
+    PASSIVE_NO_FETCH_RELATED, PASSIVE_ONLY_PERSISTENT, NO_AUTOFLUSH
+from .base import state_str, instance_str
+
+
+@inspection._self_inspects
+class QueryableAttribute(interfaces._MappedAttribute,
+                         interfaces.InspectionAttr,
+                         interfaces.PropComparator):
+    """Base class for :term:`descriptor` objects that intercept
+    attribute events on behalf of a :class:`.MapperProperty`
+    object.  The actual :class:`.MapperProperty` is accessible
+    via the :attr:`.QueryableAttribute.property`
+    attribute.
+
+
+    .. seealso::
+
+        :class:`.InstrumentedAttribute`
+
+        :class:`.MapperProperty`
+
+        :attr:`.Mapper.all_orm_descriptors`
+
+        :attr:`.Mapper.attrs`
+    """
+
+    is_attribute = True
+
+    def __init__(self, class_, key, impl=None,
+                 comparator=None, parententity=None,
+                 of_type=None):
+        self.class_ = class_
+        self.key = key
+        self.impl = impl
+        self.comparator = comparator
+        self._parententity = parententity
+        self._of_type = of_type
+
+        manager = manager_of_class(class_)
+        # manager is None in the case of AliasedClass
+        if manager:
+            # propagate existing event listeners from
+            # immediate superclass
+            for base in manager._bases:
+                if key in base:
+                    self.dispatch._update(base[key].dispatch)
+
+    @util.memoized_property
+    def _supports_population(self):
+        return self.impl.supports_population
+
+    def get_history(self, instance, passive=PASSIVE_OFF):
+        return self.impl.get_history(instance_state(instance),
+                                     instance_dict(instance), passive)
+
+    def __selectable__(self):
+        # TODO: conditionally attach this method based on clause_element ?
+        return self
+
+    @util.memoized_property
+    def info(self):
+        """Return the 'info' dictionary for the underlying SQL element.
+
+        The behavior here is as follows:
+
+        * If the attribute is a column-mapped property, i.e.
+          :class:`.ColumnProperty`, which is mapped directly
+          to a schema-level :class:`.Column` object, this attribute
+          will return the :attr:`.SchemaItem.info` dictionary associated
+          with the core-level :class:`.Column` object.
+
+        * If the attribute is a :class:`.ColumnProperty` but is mapped to
+          any other kind of SQL expression other than a :class:`.Column`,
+          the attribute will refer to the :attr:`.MapperProperty.info`
+          dictionary associated directly with the :class:`.ColumnProperty`,
+          assuming the SQL expression itself does not have its own ``.info``
+          attribute (which should be the case, unless a user-defined SQL
+          construct has defined one).
+
+        * If the attribute refers to any other kind of
+          :class:`.MapperProperty`, including :class:`.RelationshipProperty`,
+          the attribute will refer to the :attr:`.MapperProperty.info`
+          dictionary associated with that :class:`.MapperProperty`.
+
+        * To access the :attr:`.MapperProperty.info` dictionary of the
+          :class:`.MapperProperty` unconditionally, including for a
+          :class:`.ColumnProperty` that's associated directly with a
+          :class:`.schema.Column`, the attribute can be referred to using
+          :attr:`.QueryableAttribute.property` attribute, as
+          ``MyClass.someattribute.property.info``.
+
+        .. versionadded:: 0.8.0
+
+        .. seealso::
+
+            :attr:`.SchemaItem.info`
+
+            :attr:`.MapperProperty.info`
+
+        """
+        return self.comparator.info
+
+    @util.memoized_property
+    def parent(self):
+        """Return an inspection instance representing the parent.
+
+        This will be either an instance of :class:`.Mapper`
+        or :class:`.AliasedInsp`, depending upon the nature
+        of the parent entity which this attribute is associated
+        with.
+
+        """
+        return inspection.inspect(self._parententity)
+
+    @property
+    def expression(self):
+        return self.comparator.__clause_element__()
+
+    def __clause_element__(self):
+        return self.comparator.__clause_element__()
+
+    def _query_clause_element(self):
+        """like __clause_element__(), but called specifically
+        by :class:`.Query` to allow special behavior."""
+
+        return self.comparator._query_clause_element()
+
+    def adapt_to_entity(self, adapt_to_entity):
+        assert not self._of_type
+        return self.__class__(adapt_to_entity.entity,
+                              self.key, impl=self.impl,
+                              comparator=self.comparator.adapt_to_entity(
+                                  adapt_to_entity),
+                              parententity=adapt_to_entity)
+
+    def of_type(self, cls):
+        return QueryableAttribute(
+            self.class_,
+            self.key,
+            self.impl,
+            self.comparator.of_type(cls),
+            self._parententity,
+            of_type=cls)
+
+    def label(self, name):
+        return self._query_clause_element().label(name)
+
+    def operate(self, op, *other, **kwargs):
+        return op(self.comparator, *other, **kwargs)
+
+    def reverse_operate(self, op, other, **kwargs):
+        return op(other, self.comparator, **kwargs)
+
+    def hasparent(self, state, optimistic=False):
+        return self.impl.hasparent(state, optimistic=optimistic) is not False
+
+    def __getattr__(self, key):
+        try:
+            return getattr(self.comparator, key)
+        except AttributeError:
+            raise AttributeError(
+                'Neither %r object nor %r object associated with %s '
+                'has an attribute %r' % (
+                    type(self).__name__,
+                    type(self.comparator).__name__,
+                    self,
+                    key)
+            )
+
+    def __str__(self):
+        return "%s.%s" % (self.class_.__name__, self.key)
+
+    @util.memoized_property
+    def property(self):
+        """Return the :class:`.MapperProperty` associated with this
+        :class:`.QueryableAttribute`.
+
+
+        Return values here will commonly be instances of
+        :class:`.ColumnProperty` or :class:`.RelationshipProperty`.
+
+
+        """
+        return self.comparator.property
+
+
+class InstrumentedAttribute(QueryableAttribute):
+    """Class bound instrumented attribute which adds basic
+    :term:`descriptor` methods.
+
+    See :class:`.QueryableAttribute` for a description of most features.
+
+
+    """
+
+    def __set__(self, instance, value):
+        self.impl.set(instance_state(instance),
+                      instance_dict(instance), value, None)
+
+    def __delete__(self, instance):
+        self.impl.delete(instance_state(instance), instance_dict(instance))
+
+    def __get__(self, instance, owner):
+        if instance is None:
+            return self
+
+        dict_ = instance_dict(instance)
+        if self._supports_population and self.key in dict_:
+            return dict_[self.key]
+        else:
+            return self.impl.get(instance_state(instance), dict_)
+
+
+def create_proxied_attribute(descriptor):
+    """Create an QueryableAttribute / user descriptor hybrid.
+
+    Returns a new QueryableAttribute type that delegates descriptor
+    behavior and getattr() to the given descriptor.
+    """
+
+    # TODO: can move this to descriptor_props if the need for this
+    # function is removed from ext/hybrid.py
+
+    class Proxy(QueryableAttribute):
+        """Presents the :class:`.QueryableAttribute` interface as a
+        proxy on top of a Python descriptor / :class:`.PropComparator`
+        combination.
+
+        """
+
+        def __init__(self, class_, key, descriptor,
+                     comparator,
+                     adapt_to_entity=None, doc=None,
+                     original_property=None):
+            self.class_ = class_
+            self.key = key
+            self.descriptor = descriptor
+            self.original_property = original_property
+            self._comparator = comparator
+            self._adapt_to_entity = adapt_to_entity
+            self.__doc__ = doc
+
+        @property
+        def property(self):
+            return self.comparator.property
+
+        @util.memoized_property
+        def comparator(self):
+            if util.callable(self._comparator):
+                self._comparator = self._comparator()
+            if self._adapt_to_entity:
+                self._comparator = self._comparator.adapt_to_entity(
+                    self._adapt_to_entity)
+            return self._comparator
+
+        def adapt_to_entity(self, adapt_to_entity):
+            return self.__class__(adapt_to_entity.entity,
+                                  self.key,
+                                  self.descriptor,
+                                  self._comparator,
+                                  adapt_to_entity)
+
+        def __get__(self, instance, owner):
+            if instance is None:
+                return self
+            else:
+                return self.descriptor.__get__(instance, owner)
+
+        def __str__(self):
+            return "%s.%s" % (self.class_.__name__, self.key)
+
+        def __getattr__(self, attribute):
+            """Delegate __getattr__ to the original descriptor and/or
+            comparator."""
+
+            try:
+                return getattr(descriptor, attribute)
+            except AttributeError:
+                try:
+                    return getattr(self.comparator, attribute)
+                except AttributeError:
+                    raise AttributeError(
+                        'Neither %r object nor %r object associated with %s '
+                        'has an attribute %r' % (
+                            type(descriptor).__name__,
+                            type(self.comparator).__name__,
+                            self,
+                            attribute)
+                    )
+
+    Proxy.__name__ = type(descriptor).__name__ + 'Proxy'
+
+    util.monkeypatch_proxied_specials(Proxy, type(descriptor),
+                                      name='descriptor',
+                                      from_instance=descriptor)
+    return Proxy
+
+OP_REMOVE = util.symbol("REMOVE")
+OP_APPEND = util.symbol("APPEND")
+OP_REPLACE = util.symbol("REPLACE")
+
+
+class Event(object):
+    """A token propagated throughout the course of a chain of attribute
+    events.
+
+    Serves as an indicator of the source of the event and also provides
+    a means of controlling propagation across a chain of attribute
+    operations.
+
+    The :class:`.Event` object is sent as the ``initiator`` argument
+    when dealing with the :meth:`.AttributeEvents.append`,
+    :meth:`.AttributeEvents.set`,
+    and :meth:`.AttributeEvents.remove` events.
+
+    The :class:`.Event` object is currently interpreted by the backref
+    event handlers, and is used to control the propagation of operations
+    across two mutually-dependent attributes.
+
+    .. versionadded:: 0.9.0
+
+    :var impl: The :class:`.AttributeImpl` which is the current event
+     initiator.
+
+    :var op: The symbol :attr:`.OP_APPEND`, :attr:`.OP_REMOVE` or
+     :attr:`.OP_REPLACE`, indicating the source operation.
+
+    """
+
+    __slots__ = 'impl', 'op', 'parent_token'
+
+    def __init__(self, attribute_impl, op):
+        self.impl = attribute_impl
+        self.op = op
+        self.parent_token = self.impl.parent_token
+
+    def __eq__(self, other):
+        return isinstance(other, Event) and \
+            other.impl is self.impl and \
+            other.op == self.op
+
+    @property
+    def key(self):
+        return self.impl.key
+
+    def hasparent(self, state):
+        return self.impl.hasparent(state)
+
+
+class AttributeImpl(object):
+    """internal implementation for instrumented attributes."""
+
+    def __init__(self, class_, key,
+                 callable_, dispatch, trackparent=False, extension=None,
+                 compare_function=None, active_history=False,
+                 parent_token=None, expire_missing=True,
+                 send_modified_events=True,
+                 **kwargs):
+        r"""Construct an AttributeImpl.
+
+        \class_
+          associated class
+
+        key
+          string name of the attribute
+
+        \callable_
+          optional function which generates a callable based on a parent
+          instance, which produces the "default" values for a scalar or
+          collection attribute when it's first accessed, if not present
+          already.
+
+        trackparent
+          if True, attempt to track if an instance has a parent attached
+          to it via this attribute.
+
+        extension
+          a single or list of AttributeExtension object(s) which will
+          receive set/delete/append/remove/etc. events.  Deprecated.
+          The event package is now used.
+
+        compare_function
+          a function that compares two values which are normally
+          assignable to this attribute.
+
+        active_history
+          indicates that get_history() should always return the "old" value,
+          even if it means executing a lazy callable upon attribute change.
+
+        parent_token
+          Usually references the MapperProperty, used as a key for
+          the hasparent() function to identify an "owning" attribute.
+          Allows multiple AttributeImpls to all match a single
+          owner attribute.
+
+        expire_missing
+          if False, don't add an "expiry" callable to this attribute
+          during state.expire_attributes(None), if no value is present
+          for this key.
+
+        send_modified_events
+          if False, the InstanceState._modified_event method will have no
+          effect; this means the attribute will never show up as changed in a
+          history entry.
+        """
+        self.class_ = class_
+        self.key = key
+        self.callable_ = callable_
+        self.dispatch = dispatch
+        self.trackparent = trackparent
+        self.parent_token = parent_token or self
+        self.send_modified_events = send_modified_events
+        if compare_function is None:
+            self.is_equal = operator.eq
+        else:
+            self.is_equal = compare_function
+
+        # TODO: pass in the manager here
+        # instead of doing a lookup
+        attr = manager_of_class(class_)[key]
+
+        for ext in util.to_list(extension or []):
+            ext._adapt_listener(attr, ext)
+
+        if active_history:
+            self.dispatch._active_history = True
+
+        self.expire_missing = expire_missing
+
+    __slots__ = (
+        'class_', 'key', 'callable_', 'dispatch', 'trackparent',
+        'parent_token', 'send_modified_events', 'is_equal', 'expire_missing'
+    )
+
+    def __str__(self):
+        return "%s.%s" % (self.class_.__name__, self.key)
+
+    def _get_active_history(self):
+        """Backwards compat for impl.active_history"""
+
+        return self.dispatch._active_history
+
+    def _set_active_history(self, value):
+        self.dispatch._active_history = value
+
+    active_history = property(_get_active_history, _set_active_history)
+
+    def hasparent(self, state, optimistic=False):
+        """Return the boolean value of a `hasparent` flag attached to
+        the given state.
+
+        The `optimistic` flag determines what the default return value
+        should be if no `hasparent` flag can be located.
+
+        As this function is used to determine if an instance is an
+        *orphan*, instances that were loaded from storage should be
+        assumed to not be orphans, until a True/False value for this
+        flag is set.
+
+        An instance attribute that is loaded by a callable function
+        will also not have a `hasparent` flag.
+
+        """
+        msg = "This AttributeImpl is not configured to track parents."
+        assert self.trackparent, msg
+
+        return state.parents.get(id(self.parent_token), optimistic) \
+            is not False
+
+    def sethasparent(self, state, parent_state, value):
+        """Set a boolean flag on the given item corresponding to
+        whether or not it is attached to a parent object via the
+        attribute represented by this ``InstrumentedAttribute``.
+
+        """
+        msg = "This AttributeImpl is not configured to track parents."
+        assert self.trackparent, msg
+
+        id_ = id(self.parent_token)
+        if value:
+            state.parents[id_] = parent_state
+        else:
+            if id_ in state.parents:
+                last_parent = state.parents[id_]
+
+                if last_parent is not False and \
+                        last_parent.key != parent_state.key:
+
+                    if last_parent.obj() is None:
+                        raise orm_exc.StaleDataError(
+                            "Removing state %s from parent "
+                            "state %s along attribute '%s', "
+                            "but the parent record "
+                            "has gone stale, can't be sure this "
+                            "is the most recent parent." %
+                            (state_str(state),
+                             state_str(parent_state),
+                             self.key))
+
+                    return
+
+            state.parents[id_] = False
+
+    def get_history(self, state, dict_, passive=PASSIVE_OFF):
+        raise NotImplementedError()
+
+    def get_all_pending(self, state, dict_, passive=PASSIVE_NO_INITIALIZE):
+        """Return a list of tuples of (state, obj)
+        for all objects in this attribute's current state
+        + history.
+
+        Only applies to object-based attributes.
+
+        This is an inlining of existing functionality
+        which roughly corresponds to:
+
+            get_state_history(
+                        state,
+                        key,
+                        passive=PASSIVE_NO_INITIALIZE).sum()
+
+        """
+        raise NotImplementedError()
+
+    def initialize(self, state, dict_):
+        """Initialize the given state's attribute with an empty value."""
+
+        value = None
+        for fn in self.dispatch.init_scalar:
+            ret = fn(state, value, dict_)
+            if ret is not ATTR_EMPTY:
+                value = ret
+
+        return value
+
+    def get(self, state, dict_, passive=PASSIVE_OFF):
+        """Retrieve a value from the given object.
+        If a callable is assembled on this object's attribute, and
+        passive is False, the callable will be executed and the
+        resulting value will be set as the new value for this attribute.
+        """
+        if self.key in dict_:
+            return dict_[self.key]
+        else:
+            # if history present, don't load
+            key = self.key
+            if key not in state.committed_state or \
+                    state.committed_state[key] is NEVER_SET:
+                if not passive & CALLABLES_OK:
+                    return PASSIVE_NO_RESULT
+
+                if key in state.expired_attributes:
+                    value = state._load_expired(state, passive)
+                elif key in state.callables:
+                    callable_ = state.callables[key]
+                    value = callable_(state, passive)
+                elif self.callable_:
+                    value = self.callable_(state, passive)
+                else:
+                    value = ATTR_EMPTY
+
+                if value is PASSIVE_NO_RESULT or value is NEVER_SET:
+                    return value
+                elif value is ATTR_WAS_SET:
+                    try:
+                        return dict_[key]
+                    except KeyError:
+                        # TODO: no test coverage here.
+                        raise KeyError(
+                            "Deferred loader for attribute "
+                            "%r failed to populate "
+                            "correctly" % key)
+                elif value is not ATTR_EMPTY:
+                    return self.set_committed_value(state, dict_, value)
+
+            if not passive & INIT_OK:
+                return NEVER_SET
+            else:
+                # Return a new, empty value
+                return self.initialize(state, dict_)
+
+    def append(self, state, dict_, value, initiator, passive=PASSIVE_OFF):
+        self.set(state, dict_, value, initiator, passive=passive)
+
+    def remove(self, state, dict_, value, initiator, passive=PASSIVE_OFF):
+        self.set(state, dict_, None, initiator,
+                 passive=passive, check_old=value)
+
+    def pop(self, state, dict_, value, initiator, passive=PASSIVE_OFF):
+        self.set(state, dict_, None, initiator,
+                 passive=passive, check_old=value, pop=True)
+
+    def set(self, state, dict_, value, initiator,
+            passive=PASSIVE_OFF, check_old=None, pop=False):
+        raise NotImplementedError()
+
+    def get_committed_value(self, state, dict_, passive=PASSIVE_OFF):
+        """return the unchanged value of this attribute"""
+
+        if self.key in state.committed_state:
+            value = state.committed_state[self.key]
+            if value in (NO_VALUE, NEVER_SET):
+                return None
+            else:
+                return value
+        else:
+            return self.get(state, dict_, passive=passive)
+
+    def set_committed_value(self, state, dict_, value):
+        """set an attribute value on the given instance and 'commit' it."""
+
+        dict_[self.key] = value
+        state._commit(dict_, [self.key])
+        return value
+
+
+class ScalarAttributeImpl(AttributeImpl):
+    """represents a scalar value-holding InstrumentedAttribute."""
+
+    accepts_scalar_loader = True
+    uses_objects = False
+    supports_population = True
+    collection = False
+
+    __slots__ = '_replace_token', '_append_token', '_remove_token'
+
+    def __init__(self, *arg, **kw):
+        super(ScalarAttributeImpl, self).__init__(*arg, **kw)
+        self._replace_token = self._append_token = None
+        self._remove_token = None
+
+    def _init_append_token(self):
+        self._replace_token = self._append_token = Event(self, OP_REPLACE)
+        return self._replace_token
+
+    _init_append_or_replace_token = _init_append_token
+
+    def _init_remove_token(self):
+        self._remove_token = Event(self, OP_REMOVE)
+        return self._remove_token
+
+    def delete(self, state, dict_):
+
+        # TODO: catch key errors, convert to attributeerror?
+        if self.dispatch._active_history:
+            old = self.get(state, dict_, PASSIVE_RETURN_NEVER_SET)
+        else:
+            old = dict_.get(self.key, NO_VALUE)
+
+        if self.dispatch.remove:
+            self.fire_remove_event(state, dict_, old, self._remove_token)
+        state._modified_event(dict_, self, old)
+        del dict_[self.key]
+
+    def get_history(self, state, dict_, passive=PASSIVE_OFF):
+        if self.key in dict_:
+            return History.from_scalar_attribute(self, state, dict_[self.key])
+        else:
+            if passive & INIT_OK:
+                passive ^= INIT_OK
+            current = self.get(state, dict_, passive=passive)
+            if current is PASSIVE_NO_RESULT:
+                return HISTORY_BLANK
+            else:
+                return History.from_scalar_attribute(self, state, current)
+
+    def set(self, state, dict_, value, initiator,
+            passive=PASSIVE_OFF, check_old=None, pop=False):
+        if self.dispatch._active_history:
+            old = self.get(state, dict_, PASSIVE_RETURN_NEVER_SET)
+        else:
+            old = dict_.get(self.key, NO_VALUE)
+
+        if self.dispatch.set:
+            value = self.fire_replace_event(state, dict_,
+                                            value, old, initiator)
+        state._modified_event(dict_, self, old)
+        dict_[self.key] = value
+
+    def fire_replace_event(self, state, dict_, value, previous, initiator):
+        for fn in self.dispatch.set:
+            value = fn(
+                state, value, previous,
+                initiator or self._replace_token or
+                self._init_append_or_replace_token())
+        return value
+
+    def fire_remove_event(self, state, dict_, value, initiator):
+        for fn in self.dispatch.remove:
+            fn(state, value,
+               initiator or self._remove_token or self._init_remove_token())
+
+    @property
+    def type(self):
+        self.property.columns[0].type
+
+
+class ScalarObjectAttributeImpl(ScalarAttributeImpl):
+    """represents a scalar-holding InstrumentedAttribute,
+       where the target object is also instrumented.
+
+       Adds events to delete/set operations.
+
+    """
+
+    accepts_scalar_loader = False
+    uses_objects = True
+    supports_population = True
+    collection = False
+
+    __slots__ = ()
+
+    def delete(self, state, dict_):
+        old = self.get(state, dict_)
+        self.fire_remove_event(
+            state, dict_, old,
+            self._remove_token or self._init_remove_token())
+        del dict_[self.key]
+
+    def get_history(self, state, dict_, passive=PASSIVE_OFF):
+        if self.key in dict_:
+            return History.from_object_attribute(self, state, dict_[self.key])
+        else:
+            if passive & INIT_OK:
+                passive ^= INIT_OK
+            current = self.get(state, dict_, passive=passive)
+            if current is PASSIVE_NO_RESULT:
+                return HISTORY_BLANK
+            else:
+                return History.from_object_attribute(self, state, current)
+
+    def get_all_pending(self, state, dict_, passive=PASSIVE_NO_INITIALIZE):
+        if self.key in dict_:
+            current = dict_[self.key]
+        elif passive & CALLABLES_OK:
+            current = self.get(state, dict_, passive=passive)
+        else:
+            return []
+
+        # can't use __hash__(), can't use __eq__() here
+        if current is not None and \
+                current is not PASSIVE_NO_RESULT and \
+                current is not NEVER_SET:
+            ret = [(instance_state(current), current)]
+        else:
+            ret = [(None, None)]
+
+        if self.key in state.committed_state:
+            original = state.committed_state[self.key]
+            if original is not None and \
+                    original is not PASSIVE_NO_RESULT and \
+                    original is not NEVER_SET and \
+                    original is not current:
+
+                ret.append((instance_state(original), original))
+        return ret
+
+    def set(self, state, dict_, value, initiator,
+            passive=PASSIVE_OFF, check_old=None, pop=False):
+        """Set a value on the given InstanceState.
+
+        """
+        if self.dispatch._active_history:
+            old = self.get(
+                state, dict_,
+                passive=PASSIVE_ONLY_PERSISTENT |
+                NO_AUTOFLUSH | LOAD_AGAINST_COMMITTED)
+        else:
+            old = self.get(
+                state, dict_, passive=PASSIVE_NO_FETCH ^ INIT_OK |
+                LOAD_AGAINST_COMMITTED)
+
+        if check_old is not None and \
+                old is not PASSIVE_NO_RESULT and \
+                check_old is not old:
+            if pop:
+                return
+            else:
+                raise ValueError(
+                    "Object %s not associated with %s on attribute '%s'" % (
+                        instance_str(check_old),
+                        state_str(state),
+                        self.key
+                    ))
+
+        value = self.fire_replace_event(state, dict_, value, old, initiator)
+        dict_[self.key] = value
+
+    def fire_remove_event(self, state, dict_, value, initiator):
+        if self.trackparent and value is not None:
+            self.sethasparent(instance_state(value), state, False)
+
+        for fn in self.dispatch.remove:
+            fn(state, value, initiator or
+               self._remove_token or self._init_remove_token())
+
+        state._modified_event(dict_, self, value)
+
+    def fire_replace_event(self, state, dict_, value, previous, initiator):
+        if self.trackparent:
+            if (previous is not value and
+                    previous not in (None, PASSIVE_NO_RESULT, NEVER_SET)):
+                self.sethasparent(instance_state(previous), state, False)
+
+        for fn in self.dispatch.set:
+            value = fn(
+                state, value, previous, initiator or
+                self._replace_token or self._init_append_or_replace_token())
+
+        state._modified_event(dict_, self, previous)
+
+        if self.trackparent:
+            if value is not None:
+                self.sethasparent(instance_state(value), state, True)
+
+        return value
+
+
+class CollectionAttributeImpl(AttributeImpl):
+    """A collection-holding attribute that instruments changes in membership.
+
+    Only handles collections of instrumented objects.
+
+    InstrumentedCollectionAttribute holds an arbitrary, user-specified
+    container object (defaulting to a list) and brokers access to the
+    CollectionAdapter, a "view" onto that object that presents consistent bag
+    semantics to the orm layer independent of the user data implementation.
+
+    """
+    accepts_scalar_loader = False
+    uses_objects = True
+    supports_population = True
+    collection = True
+
+    __slots__ = (
+        'copy', 'collection_factory', '_append_token', '_remove_token',
+        '_duck_typed_as'
+    )
+
+    def __init__(self, class_, key, callable_, dispatch,
+                 typecallable=None, trackparent=False, extension=None,
+                 copy_function=None, compare_function=None, **kwargs):
+        super(CollectionAttributeImpl, self).__init__(
+            class_,
+            key,
+            callable_, dispatch,
+            trackparent=trackparent,
+            extension=extension,
+            compare_function=compare_function,
+            **kwargs)
+
+        if copy_function is None:
+            copy_function = self.__copy
+        self.copy = copy_function
+        self.collection_factory = typecallable
+        self._append_token = None
+        self._remove_token = None
+        self._duck_typed_as = util.duck_type_collection(
+            self.collection_factory())
+
+        if getattr(self.collection_factory, "_sa_linker", None):
+
+            @event.listens_for(self, "init_collection")
+            def link(target, collection, collection_adapter):
+                collection._sa_linker(collection_adapter)
+
+            @event.listens_for(self, "dispose_collection")
+            def unlink(target, collection, collection_adapter):
+                collection._sa_linker(None)
+
+    def _init_append_token(self):
+        self._append_token = Event(self, OP_APPEND)
+        return self._append_token
+
+    def _init_remove_token(self):
+        self._remove_token = Event(self, OP_REMOVE)
+        return self._remove_token
+
+    def __copy(self, item):
+        return [y for y in collections.collection_adapter(item)]
+
+    def get_history(self, state, dict_, passive=PASSIVE_OFF):
+        current = self.get(state, dict_, passive=passive)
+        if current is PASSIVE_NO_RESULT:
+            return HISTORY_BLANK
+        else:
+            return History.from_collection(self, state, current)
+
+    def get_all_pending(self, state, dict_, passive=PASSIVE_NO_INITIALIZE):
+        # NOTE: passive is ignored here at the moment
+
+        if self.key not in dict_:
+            return []
+
+        current = dict_[self.key]
+        current = getattr(current, '_sa_adapter')
+
+        if self.key in state.committed_state:
+            original = state.committed_state[self.key]
+            if original not in (NO_VALUE, NEVER_SET):
+                current_states = [((c is not None) and
+                                   instance_state(c) or None, c)
+                                  for c in current]
+                original_states = [((c is not None) and
+                                    instance_state(c) or None, c)
+                                   for c in original]
+
+                current_set = dict(current_states)
+                original_set = dict(original_states)
+
+                return \
+                    [(s, o) for s, o in current_states
+                        if s not in original_set] + \
+                    [(s, o) for s, o in current_states
+                        if s in original_set] + \
+                    [(s, o) for s, o in original_states
+                        if s not in current_set]
+
+        return [(instance_state(o), o) for o in current]
+
+    def fire_append_event(self, state, dict_, value, initiator):
+        for fn in self.dispatch.append:
+            value = fn(
+                state, value,
+                initiator or self._append_token or self._init_append_token())
+
+        state._modified_event(dict_, self, NEVER_SET, True)
+
+        if self.trackparent and value is not None:
+            self.sethasparent(instance_state(value), state, True)
+
+        return value
+
+    def fire_pre_remove_event(self, state, dict_, initiator):
+        state._modified_event(dict_, self, NEVER_SET, True)
+
+    def fire_remove_event(self, state, dict_, value, initiator):
+        if self.trackparent and value is not None:
+            self.sethasparent(instance_state(value), state, False)
+
+        for fn in self.dispatch.remove:
+            fn(state, value,
+               initiator or self._remove_token or self._init_remove_token())
+
+        state._modified_event(dict_, self, NEVER_SET, True)
+
+    def delete(self, state, dict_):
+        if self.key not in dict_:
+            return
+
+        state._modified_event(dict_, self, NEVER_SET, True)
+
+        collection = self.get_collection(state, state.dict)
+        collection.clear_with_event()
+        # TODO: catch key errors, convert to attributeerror?
+        del dict_[self.key]
+
+    def initialize(self, state, dict_):
+        """Initialize this attribute with an empty collection."""
+
+        _, user_data = self._initialize_collection(state)
+        dict_[self.key] = user_data
+        return user_data
+
+    def _initialize_collection(self, state):
+
+        adapter, collection = state.manager.initialize_collection(
+            self.key, state, self.collection_factory)
+
+        self.dispatch.init_collection(state, collection, adapter)
+
+        return adapter, collection
+
+    def append(self, state, dict_, value, initiator, passive=PASSIVE_OFF):
+        collection = self.get_collection(state, dict_, passive=passive)
+        if collection is PASSIVE_NO_RESULT:
+            value = self.fire_append_event(state, dict_, value, initiator)
+            assert self.key not in dict_, \
+                "Collection was loaded during event handling."
+            state._get_pending_mutation(self.key).append(value)
+        else:
+            collection.append_with_event(value, initiator)
+
+    def remove(self, state, dict_, value, initiator, passive=PASSIVE_OFF):
+        collection = self.get_collection(state, state.dict, passive=passive)
+        if collection is PASSIVE_NO_RESULT:
+            self.fire_remove_event(state, dict_, value, initiator)
+            assert self.key not in dict_, \
+                "Collection was loaded during event handling."
+            state._get_pending_mutation(self.key).remove(value)
+        else:
+            collection.remove_with_event(value, initiator)
+
+    def pop(self, state, dict_, value, initiator, passive=PASSIVE_OFF):
+        try:
+            # TODO: better solution here would be to add
+            # a "popper" role to collections.py to complement
+            # "remover".
+            self.remove(state, dict_, value, initiator, passive=passive)
+        except (ValueError, KeyError, IndexError):
+            pass
+
+    def set(self, state, dict_, value, initiator=None,
+            passive=PASSIVE_OFF, pop=False, _adapt=True):
+        iterable = orig_iterable = value
+
+        # pulling a new collection first so that an adaptation exception does
+        # not trigger a lazy load of the old collection.
+        new_collection, user_data = self._initialize_collection(state)
+        if _adapt:
+            if new_collection._converter is not None:
+                iterable = new_collection._converter(iterable)
+            else:
+                setting_type = util.duck_type_collection(iterable)
+                receiving_type = self._duck_typed_as
+
+                if setting_type is not receiving_type:
+                    given = iterable is None and 'None' or \
+                        iterable.__class__.__name__
+                    wanted = self._duck_typed_as.__name__
+                    raise TypeError(
+                        "Incompatible collection type: %s is not %s-like" % (
+                            given, wanted))
+
+                # If the object is an adapted collection, return the (iterable)
+                # adapter.
+                if hasattr(iterable, '_sa_iterator'):
+                    iterable = iterable._sa_iterator()
+                elif setting_type is dict:
+                    if util.py3k:
+                        iterable = iterable.values()
+                    else:
+                        iterable = getattr(
+                            iterable, 'itervalues', iterable.values)()
+                else:
+                    iterable = iter(iterable)
+        new_values = list(iterable)
+
+        old = self.get(state, dict_, passive=PASSIVE_ONLY_PERSISTENT)
+        if old is PASSIVE_NO_RESULT:
+            old = self.initialize(state, dict_)
+        elif old is orig_iterable:
+            # ignore re-assignment of the current collection, as happens
+            # implicitly with in-place operators (foo.collection |= other)
+            return
+
+        # place a copy of "old" in state.committed_state
+        state._modified_event(dict_, self, old, True)
+
+        old_collection = old._sa_adapter
+
+        dict_[self.key] = user_data
+
+        collections.bulk_replace(
+            new_values, old_collection, new_collection)
+
+        del old._sa_adapter
+        self.dispatch.dispose_collection(state, old, old_collection)
+
+    def _invalidate_collection(self, collection):
+        adapter = getattr(collection, '_sa_adapter')
+        adapter.invalidated = True
+
+    def set_committed_value(self, state, dict_, value):
+        """Set an attribute value on the given instance and 'commit' it."""
+
+        collection, user_data = self._initialize_collection(state)
+
+        if value:
+            collection.append_multiple_without_event(value)
+
+        state.dict[self.key] = user_data
+
+        state._commit(dict_, [self.key])
+
+        if self.key in state._pending_mutations:
+            # pending items exist.  issue a modified event,
+            # add/remove new items.
+            state._modified_event(dict_, self, user_data, True)
+
+            pending = state._pending_mutations.pop(self.key)
+            added = pending.added_items
+            removed = pending.deleted_items
+            for item in added:
+                collection.append_without_event(item)
+            for item in removed:
+                collection.remove_without_event(item)
+
+        return user_data
+
+    def get_collection(self, state, dict_,
+                       user_data=None, passive=PASSIVE_OFF):
+        """Retrieve the CollectionAdapter associated with the given state.
+
+        Creates a new CollectionAdapter if one does not exist.
+
+        """
+        if user_data is None:
+            user_data = self.get(state, dict_, passive=passive)
+            if user_data is PASSIVE_NO_RESULT:
+                return user_data
+
+        return getattr(user_data, '_sa_adapter')
+
+
+def backref_listeners(attribute, key, uselist):
+    """Apply listeners to synchronize a two-way relationship."""
+
+    # use easily recognizable names for stack traces
+
+    parent_token = attribute.impl.parent_token
+    parent_impl = attribute.impl
+
+    def _acceptable_key_err(child_state, initiator, child_impl):
+        raise ValueError(
+            "Bidirectional attribute conflict detected: "
+            'Passing object %s to attribute "%s" '
+            'triggers a modify event on attribute "%s" '
+            'via the backref "%s".' % (
+                state_str(child_state),
+                initiator.parent_token,
+                child_impl.parent_token,
+                attribute.impl.parent_token
+            )
+        )
+
+    def emit_backref_from_scalar_set_event(state, child, oldchild, initiator):
+        if oldchild is child:
+            return child
+        if oldchild is not None and \
+                oldchild is not PASSIVE_NO_RESULT and \
+                oldchild is not NEVER_SET:
+            # With lazy=None, there's no guarantee that the full collection is
+            # present when updating via a backref.
+            old_state, old_dict = instance_state(oldchild),\
+                instance_dict(oldchild)
+            impl = old_state.manager[key].impl
+
+            if initiator.impl is not impl or \
+                    initiator.op not in (OP_REPLACE, OP_REMOVE):
+                impl.pop(old_state,
+                         old_dict,
+                         state.obj(),
+                         parent_impl._append_token or
+                            parent_impl._init_append_token(),
+                         passive=PASSIVE_NO_FETCH)
+
+        if child is not None:
+            child_state, child_dict = instance_state(child),\
+                instance_dict(child)
+            child_impl = child_state.manager[key].impl
+            if initiator.parent_token is not parent_token and \
+                    initiator.parent_token is not child_impl.parent_token:
+                _acceptable_key_err(state, initiator, child_impl)
+            elif initiator.impl is not child_impl or \
+                    initiator.op not in (OP_APPEND, OP_REPLACE):
+                child_impl.append(
+                    child_state,
+                    child_dict,
+                    state.obj(),
+                    initiator,
+                    passive=PASSIVE_NO_FETCH)
+        return child
+
+    def emit_backref_from_collection_append_event(state, child, initiator):
+        if child is None:
+            return
+
+        child_state, child_dict = instance_state(child), \
+            instance_dict(child)
+        child_impl = child_state.manager[key].impl
+
+        if initiator.parent_token is not parent_token and \
+                initiator.parent_token is not child_impl.parent_token:
+            _acceptable_key_err(state, initiator, child_impl)
+        elif initiator.impl is not child_impl or \
+                initiator.op not in (OP_APPEND, OP_REPLACE):
+            child_impl.append(
+                child_state,
+                child_dict,
+                state.obj(),
+                initiator,
+                passive=PASSIVE_NO_FETCH)
+        return child
+
+    def emit_backref_from_collection_remove_event(state, child, initiator):
+        if child is not None:
+            child_state, child_dict = instance_state(child),\
+                instance_dict(child)
+            child_impl = child_state.manager[key].impl
+            if initiator.impl is not child_impl or \
+                    initiator.op not in (OP_REMOVE, OP_REPLACE):
+                child_impl.pop(
+                    child_state,
+                    child_dict,
+                    state.obj(),
+                    initiator,
+                    passive=PASSIVE_NO_FETCH)
+
+    if uselist:
+        event.listen(attribute, "append",
+                     emit_backref_from_collection_append_event,
+                     retval=True, raw=True)
+    else:
+        event.listen(attribute, "set",
+                     emit_backref_from_scalar_set_event,
+                     retval=True, raw=True)
+    # TODO: need coverage in test/orm/ of remove event
+    event.listen(attribute, "remove",
+                 emit_backref_from_collection_remove_event,
+                 retval=True, raw=True)
+
+_NO_HISTORY = util.symbol('NO_HISTORY')
+_NO_STATE_SYMBOLS = frozenset([
+    id(PASSIVE_NO_RESULT),
+    id(NO_VALUE),
+    id(NEVER_SET)])
+
+History = util.namedtuple("History", [
+    "added", "unchanged", "deleted"
+])
+
+
+class History(History):
+    """A 3-tuple of added, unchanged and deleted values,
+    representing the changes which have occurred on an instrumented
+    attribute.
+
+    The easiest way to get a :class:`.History` object for a particular
+    attribute on an object is to use the :func:`.inspect` function::
+
+        from sqlalchemy import inspect
+
+        hist = inspect(myobject).attrs.myattribute.history
+
+    Each tuple member is an iterable sequence:
+
+    * ``added`` - the collection of items added to the attribute (the first
+      tuple element).
+
+    * ``unchanged`` - the collection of items that have not changed on the
+      attribute (the second tuple element).
+
+    * ``deleted`` - the collection of items that have been removed from the
+      attribute (the third tuple element).
+
+    """
+
+    def __bool__(self):
+        return self != HISTORY_BLANK
+    __nonzero__ = __bool__
+
+    def empty(self):
+        """Return True if this :class:`.History` has no changes
+        and no existing, unchanged state.
+
+        """
+
+        return not bool(
+            (self.added or self.deleted)
+            or self.unchanged
+        )
+
+    def sum(self):
+        """Return a collection of added + unchanged + deleted."""
+
+        return (self.added or []) +\
+            (self.unchanged or []) +\
+            (self.deleted or [])
+
+    def non_deleted(self):
+        """Return a collection of added + unchanged."""
+
+        return (self.added or []) +\
+            (self.unchanged or [])
+
+    def non_added(self):
+        """Return a collection of unchanged + deleted."""
+
+        return (self.unchanged or []) +\
+            (self.deleted or [])
+
+    def has_changes(self):
+        """Return True if this :class:`.History` has changes."""
+
+        return bool(self.added or self.deleted)
+
+    def as_state(self):
+        return History(
+            [(c is not None)
+             and instance_state(c) or None
+             for c in self.added],
+            [(c is not None)
+             and instance_state(c) or None
+             for c in self.unchanged],
+            [(c is not None)
+             and instance_state(c) or None
+             for c in self.deleted],
+        )
+
+    @classmethod
+    def from_scalar_attribute(cls, attribute, state, current):
+        original = state.committed_state.get(attribute.key, _NO_HISTORY)
+
+        if original is _NO_HISTORY:
+            if current is NEVER_SET:
+                return cls((), (), ())
+            else:
+                return cls((), [current], ())
+        # don't let ClauseElement expressions here trip things up
+        elif attribute.is_equal(current, original) is True:
+            return cls((), [current], ())
+        else:
+            # current convention on native scalars is to not
+            # include information
+            # about missing previous value in "deleted", but
+            # we do include None, which helps in some primary
+            # key situations
+            if id(original) in _NO_STATE_SYMBOLS:
+                deleted = ()
+            else:
+                deleted = [original]
+            if current is NEVER_SET:
+                return cls((), (), deleted)
+            else:
+                return cls([current], (), deleted)
+
+    @classmethod
+    def from_object_attribute(cls, attribute, state, current):
+        original = state.committed_state.get(attribute.key, _NO_HISTORY)
+
+        if original is _NO_HISTORY:
+            if current is NO_VALUE or current is NEVER_SET:
+                return cls((), (), ())
+            else:
+                return cls((), [current], ())
+        elif current is original:
+            return cls((), [current], ())
+        else:
+            # current convention on related objects is to not
+            # include information
+            # about missing previous value in "deleted", and
+            # to also not include None - the dependency.py rules
+            # ignore the None in any case.
+            if id(original) in _NO_STATE_SYMBOLS or original is None:
+                deleted = ()
+            else:
+                deleted = [original]
+            if current is NO_VALUE or current is NEVER_SET:
+                return cls((), (), deleted)
+            else:
+                return cls([current], (), deleted)
+
+    @classmethod
+    def from_collection(cls, attribute, state, current):
+        original = state.committed_state.get(attribute.key, _NO_HISTORY)
+
+        if current is NO_VALUE or current is NEVER_SET:
+            return cls((), (), ())
+
+        current = getattr(current, '_sa_adapter')
+        if original in (NO_VALUE, NEVER_SET):
+            return cls(list(current), (), ())
+        elif original is _NO_HISTORY:
+            return cls((), list(current), ())
+        else:
+
+            current_states = [((c is not None) and instance_state(c)
+                               or None, c)
+                              for c in current
+                              ]
+            original_states = [((c is not None) and instance_state(c)
+                                or None, c)
+                               for c in original
+                               ]
+
+            current_set = dict(current_states)
+            original_set = dict(original_states)
+
+            return cls(
+                [o for s, o in current_states if s not in original_set],
+                [o for s, o in current_states if s in original_set],
+                [o for s, o in original_states if s not in current_set]
+            )
+
+HISTORY_BLANK = History(None, None, None)
+
+
+def get_history(obj, key, passive=PASSIVE_OFF):
+    """Return a :class:`.History` record for the given object
+    and attribute key.
+
+    :param obj: an object whose class is instrumented by the
+      attributes package.
+
+    :param key: string attribute name.
+
+    :param passive: indicates loading behavior for the attribute
+       if the value is not already present.   This is a
+       bitflag attribute, which defaults to the symbol
+       :attr:`.PASSIVE_OFF` indicating all necessary SQL
+       should be emitted.
+
+    """
+    if passive is True:
+        util.warn_deprecated("Passing True for 'passive' is deprecated. "
+                             "Use attributes.PASSIVE_NO_INITIALIZE")
+        passive = PASSIVE_NO_INITIALIZE
+    elif passive is False:
+        util.warn_deprecated("Passing False for 'passive' is "
+                             "deprecated.  Use attributes.PASSIVE_OFF")
+        passive = PASSIVE_OFF
+
+    return get_state_history(instance_state(obj), key, passive)
+
+
+def get_state_history(state, key, passive=PASSIVE_OFF):
+    return state.get_history(key, passive)
+
+
+def has_parent(cls, obj, key, optimistic=False):
+    """TODO"""
+    manager = manager_of_class(cls)
+    state = instance_state(obj)
+    return manager.has_parent(state, key, optimistic)
+
+
+def register_attribute(class_, key, **kw):
+    comparator = kw.pop('comparator', None)
+    parententity = kw.pop('parententity', None)
+    doc = kw.pop('doc', None)
+    desc = register_descriptor(class_, key,
+                               comparator, parententity, doc=doc)
+    register_attribute_impl(class_, key, **kw)
+    return desc
+
+
+def register_attribute_impl(class_, key,
+                            uselist=False, callable_=None,
+                            useobject=False,
+                            impl_class=None, backref=None, **kw):
+
+    manager = manager_of_class(class_)
+    if uselist:
+        factory = kw.pop('typecallable', None)
+        typecallable = manager.instrument_collection_class(
+            key, factory or list)
+    else:
+        typecallable = kw.pop('typecallable', None)
+
+    dispatch = manager[key].dispatch
+
+    if impl_class:
+        impl = impl_class(class_, key, typecallable, dispatch, **kw)
+    elif uselist:
+        impl = CollectionAttributeImpl(class_, key, callable_, dispatch,
+                                       typecallable=typecallable, **kw)
+    elif useobject:
+        impl = ScalarObjectAttributeImpl(class_, key, callable_,
+                                         dispatch, **kw)
+    else:
+        impl = ScalarAttributeImpl(class_, key, callable_, dispatch, **kw)
+
+    manager[key].impl = impl
+
+    if backref:
+        backref_listeners(manager[key], backref, uselist)
+
+    manager.post_configure_attribute(key)
+    return manager[key]
+
+
+def register_descriptor(class_, key, comparator=None,
+                        parententity=None, doc=None):
+    manager = manager_of_class(class_)
+
+    descriptor = InstrumentedAttribute(class_, key, comparator=comparator,
+                                       parententity=parententity)
+
+    descriptor.__doc__ = doc
+
+    manager.instrument_attribute(key, descriptor)
+    return descriptor
+
+
+def unregister_attribute(class_, key):
+    manager_of_class(class_).uninstrument_attribute(key)
+
+
+def init_collection(obj, key):
+    """Initialize a collection attribute and return the collection adapter.
+
+    This function is used to provide direct access to collection internals
+    for a previously unloaded attribute.  e.g.::
+
+        collection_adapter = init_collection(someobject, 'elements')
+        for elem in values:
+            collection_adapter.append_without_event(elem)
+
+    For an easier way to do the above, see
+    :func:`~sqlalchemy.orm.attributes.set_committed_value`.
+
+    obj is an instrumented object instance.  An InstanceState
+    is accepted directly for backwards compatibility but
+    this usage is deprecated.
+
+    """
+    state = instance_state(obj)
+    dict_ = state.dict
+    return init_state_collection(state, dict_, key)
+
+
+def init_state_collection(state, dict_, key):
+    """Initialize a collection attribute and return the collection adapter."""
+
+    attr = state.manager[key].impl
+    user_data = attr.initialize(state, dict_)
+    return attr.get_collection(state, dict_, user_data)
+
+
+def set_committed_value(instance, key, value):
+    """Set the value of an attribute with no history events.
+
+    Cancels any previous history present.  The value should be
+    a scalar value for scalar-holding attributes, or
+    an iterable for any collection-holding attribute.
+
+    This is the same underlying method used when a lazy loader
+    fires off and loads additional data from the database.
+    In particular, this method can be used by application code
+    which has loaded additional attributes or collections through
+    separate queries, which can then be attached to an instance
+    as though it were part of its original loaded state.
+
+    """
+    state, dict_ = instance_state(instance), instance_dict(instance)
+    state.manager[key].impl.set_committed_value(state, dict_, value)
+
+
+def set_attribute(instance, key, value):
+    """Set the value of an attribute, firing history events.
+
+    This function may be used regardless of instrumentation
+    applied directly to the class, i.e. no descriptors are required.
+    Custom attribute management schemes will need to make usage
+    of this method to establish attribute state as understood
+    by SQLAlchemy.
+
+    """
+    state, dict_ = instance_state(instance), instance_dict(instance)
+    state.manager[key].impl.set(state, dict_, value, None)
+
+
+def get_attribute(instance, key):
+    """Get the value of an attribute, firing any callables required.
+
+    This function may be used regardless of instrumentation
+    applied directly to the class, i.e. no descriptors are required.
+    Custom attribute management schemes will need to make usage
+    of this method to make usage of attribute state as understood
+    by SQLAlchemy.
+
+    """
+    state, dict_ = instance_state(instance), instance_dict(instance)
+    return state.manager[key].impl.get(state, dict_)
+
+
+def del_attribute(instance, key):
+    """Delete the value of an attribute, firing history events.
+
+    This function may be used regardless of instrumentation
+    applied directly to the class, i.e. no descriptors are required.
+    Custom attribute management schemes will need to make usage
+    of this method to establish attribute state as understood
+    by SQLAlchemy.
+
+    """
+    state, dict_ = instance_state(instance), instance_dict(instance)
+    state.manager[key].impl.delete(state, dict_)
+
+
+def flag_modified(instance, key):
+    """Mark an attribute on an instance as 'modified'.
+
+    This sets the 'modified' flag on the instance and
+    establishes an unconditional change event for the given attribute.
+
+    """
+    state, dict_ = instance_state(instance), instance_dict(instance)
+    impl = state.manager[key].impl
+    state._modified_event(dict_, impl, NO_VALUE, force=True)
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_modules/sqlalchemy/sql/schema.html b/_modules/sqlalchemy/sql/schema.html new file mode 100644 index 0000000..071013e --- /dev/null +++ b/_modules/sqlalchemy/sql/schema.html @@ -0,0 +1,4203 @@ + + + + + + + sqlalchemy.sql.schema — Python CarePoint 0.1.8b665 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for sqlalchemy.sql.schema

+# sql/schema.py
+# Copyright (C) 2005-2017 the SQLAlchemy authors and contributors
+# <see AUTHORS file>
+#
+# This module is part of SQLAlchemy and is released under
+# the MIT License: http://www.opensource.org/licenses/mit-license.php
+
+"""The schema module provides the building blocks for database metadata.
+
+Each element within this module describes a database entity which can be
+created and dropped, or is otherwise part of such an entity.  Examples include
+tables, columns, sequences, and indexes.
+
+All entities are subclasses of :class:`~sqlalchemy.schema.SchemaItem`, and as
+defined in this module they are intended to be agnostic of any vendor-specific
+constructs.
+
+A collection of entities are grouped into a unit called
+:class:`~sqlalchemy.schema.MetaData`. MetaData serves as a logical grouping of
+schema elements, and can also be associated with an actual database connection
+such that operations involving the contained elements can contact the database
+as needed.
+
+Two of the elements here also build upon their "syntactic" counterparts, which
+are defined in :class:`~sqlalchemy.sql.expression.`, specifically
+:class:`~sqlalchemy.schema.Table` and :class:`~sqlalchemy.schema.Column`.
+Since these objects are part of the SQL expression language, they are usable
+as components in SQL expressions.
+
+"""
+from __future__ import absolute_import
+
+from .. import exc, util, event, inspection
+from .base import SchemaEventTarget, DialectKWArgs
+import operator
+from . import visitors
+from . import type_api
+from .base import _bind_or_error, ColumnCollection
+from .elements import ClauseElement, ColumnClause, \
+    _as_truncated, TextClause, _literal_as_text,\
+    ColumnElement, quoted_name
+from .selectable import TableClause
+import collections
+import sqlalchemy
+from . import ddl
+
+RETAIN_SCHEMA = util.symbol('retain_schema')
+
+BLANK_SCHEMA = util.symbol(
+    'blank_schema',
+    """Symbol indicating that a :class:`.Table` or :class:`.Sequence`
+    should have 'None' for its schema, even if the parent
+    :class:`.MetaData` has specified a schema.
+
+    .. versionadded:: 1.0.14
+
+    """
+)
+
+
+def _get_table_key(name, schema):
+    if schema is None:
+        return name
+    else:
+        return schema + "." + name
+
+
+@inspection._self_inspects
+class SchemaItem(SchemaEventTarget, visitors.Visitable):
+    """Base class for items that define a database schema."""
+
+    __visit_name__ = 'schema_item'
+
+    def _init_items(self, *args):
+        """Initialize the list of child items for this SchemaItem."""
+
+        for item in args:
+            if item is not None:
+                item._set_parent_with_dispatch(self)
+
+    def get_children(self, **kwargs):
+        """used to allow SchemaVisitor access"""
+        return []
+
+    def __repr__(self):
+        return util.generic_repr(self, omit_kwarg=['info'])
+
+    @property
+    @util.deprecated('0.9', 'Use ``<obj>.name.quote``')
+    def quote(self):
+        """Return the value of the ``quote`` flag passed
+        to this schema object, for those schema items which
+        have a ``name`` field.
+
+        """
+
+        return self.name.quote
+
+    @util.memoized_property
+    def info(self):
+        """Info dictionary associated with the object, allowing user-defined
+        data to be associated with this :class:`.SchemaItem`.
+
+        The dictionary is automatically generated when first accessed.
+        It can also be specified in the constructor of some objects,
+        such as :class:`.Table` and :class:`.Column`.
+
+        """
+        return {}
+
+    def _schema_item_copy(self, schema_item):
+        if 'info' in self.__dict__:
+            schema_item.info = self.info.copy()
+        schema_item.dispatch._update(self.dispatch)
+        return schema_item
+
+    def _translate_schema(self, effective_schema, map_):
+        return map_.get(effective_schema, effective_schema)
+
+
+class Table(DialectKWArgs, SchemaItem, TableClause):
+    r"""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
+    on its name and optional schema name within the given
+    :class:`.MetaData` object. Calling the :class:`.Table`
+    constructor with the same name and same :class:`.MetaData` argument
+    a second time will return the *same* :class:`.Table` object - in this way
+    the :class:`.Table` constructor acts as a registry function.
+
+    .. seealso::
+
+        :ref:`metadata_describing` - Introduction to database metadata
+
+    Constructor arguments are as follows:
+
+    :param name: The name of this table as represented in the database.
+
+        The table name, along with the value of the ``schema`` parameter,
+        forms a key which uniquely identifies this :class:`.Table` within
+        the owning :class:`.MetaData` collection.
+        Additional calls to :class:`.Table` with the same name, metadata,
+        and schema name will return the same :class:`.Table` object.
+
+        Names which contain no upper case characters
+        will be treated as case insensitive names, and will not be quoted
+        unless they are a reserved word or contain special characters.
+        A name with any number of upper case characters is considered
+        to be case sensitive, and will be sent as quoted.
+
+        To enable unconditional quoting for the table name, specify the flag
+        ``quote=True`` to the constructor, or use the :class:`.quoted_name`
+        construct to specify the name.
+
+    :param metadata: a :class:`.MetaData` object which will contain this
+        table.  The metadata is used as a point of association of this table
+        with other tables which are referenced via foreign key.  It also
+        may be used to associate this table with a particular
+        :class:`.Connectable`.
+
+    :param \*args: Additional positional arguments are used primarily
+        to add the list of :class:`.Column` objects contained within this
+        table. Similar to the style of a CREATE TABLE statement, other
+        :class:`.SchemaItem` constructs may be added here, including
+        :class:`.PrimaryKeyConstraint`, and :class:`.ForeignKeyConstraint`.
+
+    :param autoload: Defaults to False, unless :paramref:`.Table.autoload_with`
+        is set in which case it defaults to True; :class:`.Column` objects
+        for this table should be reflected from the database, possibly
+        augmenting or replacing existing :class:`.Column` objects that were
+        explicitly specified.
+
+        .. versionchanged:: 1.0.0 setting the :paramref:`.Table.autoload_with`
+           parameter implies that :paramref:`.Table.autoload` will default
+           to True.
+
+        .. seealso::
+
+            :ref:`metadata_reflection_toplevel`
+
+    :param autoload_replace: Defaults to ``True``; when using
+        :paramref:`.Table.autoload`
+        in conjunction with :paramref:`.Table.extend_existing`, indicates
+        that :class:`.Column` objects present in the already-existing
+        :class:`.Table` object should be replaced with columns of the same
+        name retrieved from the autoload process.   When ``False``, columns
+        already present under existing names will be omitted from the
+        reflection process.
+
+        Note that this setting does not impact :class:`.Column` objects
+        specified programmatically within the call to :class:`.Table` that
+        also is autoloading; those :class:`.Column` objects will always
+        replace existing columns of the same name when
+        :paramref:`.Table.extend_existing` is ``True``.
+
+        .. versionadded:: 0.7.5
+
+        .. seealso::
+
+            :paramref:`.Table.autoload`
+
+            :paramref:`.Table.extend_existing`
+
+    :param autoload_with: An :class:`.Engine` or :class:`.Connection` object
+        with which this :class:`.Table` object will be reflected; when
+        set to a non-None value, it implies that :paramref:`.Table.autoload`
+        is ``True``.   If left unset, but :paramref:`.Table.autoload` is
+        explicitly set to ``True``, an autoload operation will attempt to
+        proceed by locating an :class:`.Engine` or :class:`.Connection` bound
+        to the underlying :class:`.MetaData` object.
+
+        .. seealso::
+
+            :paramref:`.Table.autoload`
+
+    :param extend_existing: When ``True``, indicates that if this
+        :class:`.Table` is already present in the given :class:`.MetaData`,
+        apply further arguments within the constructor to the existing
+        :class:`.Table`.
+
+        If :paramref:`.Table.extend_existing` or
+        :paramref:`.Table.keep_existing` are not set, and the given name
+        of the new :class:`.Table` refers to a :class:`.Table` that is
+        already present in the target :class:`.MetaData` collection, and
+        this :class:`.Table` specifies additional columns or other constructs
+        or flags that modify the table's state, an
+        error is raised.  The purpose of these two mutually-exclusive flags
+        is to specify what action should be taken when a :class:`.Table`
+        is specified that matches an existing :class:`.Table`, yet specifies
+        additional constructs.
+
+        :paramref:`.Table.extend_existing` will also work in conjunction
+        with :paramref:`.Table.autoload` to run a new reflection
+        operation against the database, even if a :class:`.Table`
+        of the same name is already present in the target
+        :class:`.MetaData`; newly reflected :class:`.Column` objects
+        and other options will be added into the state of the
+        :class:`.Table`, potentially overwriting existing columns
+        and options of the same name.
+
+        .. versionchanged:: 0.7.4 :paramref:`.Table.extend_existing` will
+           invoke a new reflection operation when combined with
+           :paramref:`.Table.autoload` set to True.
+
+        As is always the case with :paramref:`.Table.autoload`,
+        :class:`.Column` objects can be specified in the same :class:`.Table`
+        constructor, which will take precedence.  Below, the existing
+        table ``mytable`` will be augmented with :class:`.Column` objects
+        both reflected from the database, as well as the given :class:`.Column`
+        named "y"::
+
+            Table("mytable", metadata,
+                        Column('y', Integer),
+                        extend_existing=True,
+                        autoload=True,
+                        autoload_with=engine
+                    )
+
+        .. seealso::
+
+            :paramref:`.Table.autoload`
+
+            :paramref:`.Table.autoload_replace`
+
+            :paramref:`.Table.keep_existing`
+
+
+    :param implicit_returning: True by default - indicates that
+        RETURNING can be used by default to fetch newly inserted primary key
+        values, for backends which support this.  Note that
+        create_engine() also provides an implicit_returning flag.
+
+    :param include_columns: A list of strings indicating a subset of
+        columns to be loaded via the ``autoload`` operation; table columns who
+        aren't present in this list will not be represented on the resulting
+        ``Table`` object. Defaults to ``None`` which indicates all columns
+        should be reflected.
+
+    :param info: Optional data dictionary which will be populated into the
+        :attr:`.SchemaItem.info` attribute of this object.
+
+    :param keep_existing: When ``True``, indicates that if this Table
+        is already present in the given :class:`.MetaData`, ignore
+        further arguments within the constructor to the existing
+        :class:`.Table`, and return the :class:`.Table` object as
+        originally created. This is to allow a function that wishes
+        to define a new :class:`.Table` on first call, but on
+        subsequent calls will return the same :class:`.Table`,
+        without any of the declarations (particularly constraints)
+        being applied a second time.
+
+        If :paramref:`.Table.extend_existing` or
+        :paramref:`.Table.keep_existing` are not set, and the given name
+        of the new :class:`.Table` refers to a :class:`.Table` that is
+        already present in the target :class:`.MetaData` collection, and
+        this :class:`.Table` specifies additional columns or other constructs
+        or flags that modify the table's state, an
+        error is raised.  The purpose of these two mutually-exclusive flags
+        is to specify what action should be taken when a :class:`.Table`
+        is specified that matches an existing :class:`.Table`, yet specifies
+        additional constructs.
+
+        .. seealso::
+
+            :paramref:`.Table.extend_existing`
+
+    :param listeners: A list of tuples of the form ``(<eventname>, <fn>)``
+        which will be passed to :func:`.event.listen` upon construction.
+        This alternate hook to :func:`.event.listen` allows the establishment
+        of a listener function specific to this :class:`.Table` before
+        the "autoload" process begins.  Particularly useful for
+        the :meth:`.DDLEvents.column_reflect` event::
+
+            def listen_for_reflect(table, column_info):
+                "handle the column reflection event"
+                # ...
+
+            t = Table(
+                'sometable',
+                autoload=True,
+                listeners=[
+                    ('column_reflect', listen_for_reflect)
+                ])
+
+    :param mustexist: When ``True``, indicates that this Table must already
+        be present in the given :class:`.MetaData` collection, else
+        an exception is raised.
+
+    :param prefixes:
+        A list of strings to insert after CREATE in the CREATE TABLE
+        statement.  They will be separated by spaces.
+
+    :param quote: Force quoting of this table's name on or off, corresponding
+        to ``True`` or ``False``.  When left at its default of ``None``,
+        the column identifier will be quoted according to whether the name is
+        case sensitive (identifiers with at least one upper case character are
+        treated as case sensitive), or if it's a reserved word.  This flag
+        is only needed to force quoting of a reserved word which is not known
+        by the SQLAlchemy dialect.
+
+    :param quote_schema: same as 'quote' but applies to the schema identifier.
+
+    :param schema: The schema name for this table, which is required if
+        the table resides in a schema other than the default selected schema
+        for the engine's database connection.  Defaults to ``None``.
+
+        If the owning :class:`.MetaData` of this :class:`.Table` specifies
+        its own :paramref:`.MetaData.schema` parameter, then that schema
+        name will be applied to this :class:`.Table` if the schema parameter
+        here is set to ``None``.  To set a blank schema name on a :class:`.Table`
+        that would otherwise use the schema set on the owning :class:`.MetaData`,
+        specify the special symbol :attr:`.BLANK_SCHEMA`.
+
+        .. versionadded:: 1.0.14  Added the :attr:`.BLANK_SCHEMA` symbol to
+           allow a :class:`.Table` to have a blank schema name even when the
+           parent :class:`.MetaData` specifies :paramref:`.MetaData.schema`.
+
+        The quoting rules for the schema name are the same as those for the
+        ``name`` parameter, in that quoting is applied for reserved words or
+        case-sensitive names; to enable unconditional quoting for the
+        schema name, specify the flag
+        ``quote_schema=True`` to the constructor, or use the
+        :class:`.quoted_name` construct to specify the name.
+
+    :param useexisting: Deprecated.  Use :paramref:`.Table.extend_existing`.
+
+    :param \**kw: Additional keyword arguments not mentioned above are
+        dialect specific, and passed in the form ``<dialectname>_<argname>``.
+        See the documentation regarding an individual dialect at
+        :ref:`dialect_toplevel` for detail on documented arguments.
+
+    """
+
+    __visit_name__ = 'table'
+
+    def __new__(cls, *args, **kw):
+        if not args:
+            # python3k pickle seems to call this
+            return object.__new__(cls)
+
+        try:
+            name, metadata, args = args[0], args[1], args[2:]
+        except IndexError:
+            raise TypeError("Table() takes at least two arguments")
+
+        schema = kw.get('schema', None)
+        if schema is None:
+            schema = metadata.schema
+        elif schema is BLANK_SCHEMA:
+            schema = None
+        keep_existing = kw.pop('keep_existing', False)
+        extend_existing = kw.pop('extend_existing', False)
+        if 'useexisting' in kw:
+            msg = "useexisting is deprecated.  Use extend_existing."
+            util.warn_deprecated(msg)
+            if extend_existing:
+                msg = "useexisting is synonymous with extend_existing."
+                raise exc.ArgumentError(msg)
+            extend_existing = kw.pop('useexisting', False)
+
+        if keep_existing and extend_existing:
+            msg = "keep_existing and extend_existing are mutually exclusive."
+            raise exc.ArgumentError(msg)
+
+        mustexist = kw.pop('mustexist', False)
+        key = _get_table_key(name, schema)
+        if key in metadata.tables:
+            if not keep_existing and not extend_existing and bool(args):
+                raise exc.InvalidRequestError(
+                    "Table '%s' is already defined for this MetaData "
+                    "instance.  Specify 'extend_existing=True' "
+                    "to redefine "
+                    "options and columns on an "
+                    "existing Table object." % key)
+            table = metadata.tables[key]
+            if extend_existing:
+                table._init_existing(*args, **kw)
+            return table
+        else:
+            if mustexist:
+                raise exc.InvalidRequestError(
+                    "Table '%s' not defined" % (key))
+            table = object.__new__(cls)
+            table.dispatch.before_parent_attach(table, metadata)
+            metadata._add_table(name, schema, table)
+            try:
+                table._init(name, metadata, *args, **kw)
+                table.dispatch.after_parent_attach(table, metadata)
+                return table
+            except:
+                with util.safe_reraise():
+                    metadata._remove_table(name, schema)
+
+    @property
+    @util.deprecated('0.9', 'Use ``table.schema.quote``')
+    def quote_schema(self):
+        """Return the value of the ``quote_schema`` flag passed
+        to this :class:`.Table`.
+        """
+
+        return self.schema.quote
+
+    def __init__(self, *args, **kw):
+        """Constructor for :class:`~.schema.Table`.
+
+        This method is a no-op.   See the top-level
+        documentation for :class:`~.schema.Table`
+        for constructor arguments.
+
+        """
+        # __init__ is overridden to prevent __new__ from
+        # calling the superclass constructor.
+
+    def _init(self, name, metadata, *args, **kwargs):
+        super(Table, self).__init__(
+            quoted_name(name, kwargs.pop('quote', None)))
+        self.metadata = metadata
+
+        self.schema = kwargs.pop('schema', None)
+        if self.schema is None:
+            self.schema = metadata.schema
+        elif self.schema is BLANK_SCHEMA:
+            self.schema = None
+        else:
+            quote_schema = kwargs.pop('quote_schema', None)
+            self.schema = quoted_name(self.schema, quote_schema)
+
+        self.indexes = set()
+        self.constraints = set()
+        self._columns = ColumnCollection()
+        PrimaryKeyConstraint(_implicit_generated=True).\
+            _set_parent_with_dispatch(self)
+        self.foreign_keys = set()
+        self._extra_dependencies = set()
+        if self.schema is not None:
+            self.fullname = "%s.%s" % (self.schema, self.name)
+        else:
+            self.fullname = self.name
+
+        autoload_with = kwargs.pop('autoload_with', None)
+        autoload = kwargs.pop('autoload', autoload_with is not None)
+        # this argument is only used with _init_existing()
+        kwargs.pop('autoload_replace', True)
+        _extend_on = kwargs.pop("_extend_on", None)
+
+        include_columns = kwargs.pop('include_columns', None)
+
+        self.implicit_returning = kwargs.pop('implicit_returning', True)
+
+        if 'info' in kwargs:
+            self.info = kwargs.pop('info')
+        if 'listeners' in kwargs:
+            listeners = kwargs.pop('listeners')
+            for evt, fn in listeners:
+                event.listen(self, evt, fn)
+
+        self._prefixes = kwargs.pop('prefixes', [])
+
+        self._extra_kwargs(**kwargs)
+
+        # load column definitions from the database if 'autoload' is defined
+        # we do it after the table is in the singleton dictionary to support
+        # circular foreign keys
+        if autoload:
+            self._autoload(
+                metadata, autoload_with,
+                include_columns, _extend_on=_extend_on)
+
+        # initialize all the column, etc. objects.  done after reflection to
+        # allow user-overrides
+        self._init_items(*args)
+
+    def _autoload(self, metadata, autoload_with, include_columns,
+                  exclude_columns=(), _extend_on=None):
+
+        if autoload_with:
+            autoload_with.run_callable(
+                autoload_with.dialect.reflecttable,
+                self, include_columns, exclude_columns,
+                _extend_on=_extend_on
+            )
+        else:
+            bind = _bind_or_error(
+                metadata,
+                msg="No engine is bound to this Table's MetaData. "
+                "Pass an engine to the Table via "
+                "autoload_with=<someengine>, "
+                "or associate the MetaData with an engine via "
+                "metadata.bind=<someengine>")
+            bind.run_callable(
+                bind.dialect.reflecttable,
+                self, include_columns, exclude_columns,
+                _extend_on=_extend_on
+            )
+
+    @property
+    def _sorted_constraints(self):
+        """Return the set of constraints as a list, sorted by creation
+        order.
+
+        """
+        return sorted(self.constraints, key=lambda c: c._creation_order)
+
+    @property
+    def foreign_key_constraints(self):
+        """:class:`.ForeignKeyConstraint` objects referred to by this
+        :class:`.Table`.
+
+        This list is produced from the collection of :class:`.ForeignKey`
+        objects currently associated.
+
+        .. versionadded:: 1.0.0
+
+        """
+        return set(fkc.constraint for fkc in self.foreign_keys)
+
+    def _init_existing(self, *args, **kwargs):
+        autoload_with = kwargs.pop('autoload_with', None)
+        autoload = kwargs.pop('autoload', autoload_with is not None)
+        autoload_replace = kwargs.pop('autoload_replace', True)
+        schema = kwargs.pop('schema', None)
+        _extend_on = kwargs.pop('_extend_on', None)
+
+        if schema and schema != self.schema:
+            raise exc.ArgumentError(
+                "Can't change schema of existing table from '%s' to '%s'",
+                (self.schema, schema))
+
+        include_columns = kwargs.pop('include_columns', None)
+
+        if include_columns is not None:
+            for c in self.c:
+                if c.name not in include_columns:
+                    self._columns.remove(c)
+
+        for key in ('quote', 'quote_schema'):
+            if key in kwargs:
+                raise exc.ArgumentError(
+                    "Can't redefine 'quote' or 'quote_schema' arguments")
+
+        if 'info' in kwargs:
+            self.info = kwargs.pop('info')
+
+        if autoload:
+            if not autoload_replace:
+                # don't replace columns already present.
+                # we'd like to do this for constraints also however we don't
+                # have simple de-duping for unnamed constraints.
+                exclude_columns = [c.name for c in self.c]
+            else:
+                exclude_columns = ()
+            self._autoload(
+                self.metadata, autoload_with,
+                include_columns, exclude_columns, _extend_on=_extend_on)
+
+        self._extra_kwargs(**kwargs)
+        self._init_items(*args)
+
+    def _extra_kwargs(self, **kwargs):
+        self._validate_dialect_kwargs(kwargs)
+
+    def _init_collections(self):
+        pass
+
+    def _reset_exported(self):
+        pass
+
+    @property
+    def _autoincrement_column(self):
+        return self.primary_key._autoincrement_column
+
+    @property
+    def key(self):
+        """Return the 'key' for this :class:`.Table`.
+
+        This value is used as the dictionary key within the
+        :attr:`.MetaData.tables` collection.   It is typically the same
+        as that of :attr:`.Table.name` for a table with no
+        :attr:`.Table.schema` set; otherwise it is typically of the form
+        ``schemaname.tablename``.
+
+        """
+        return _get_table_key(self.name, self.schema)
+
+    def __repr__(self):
+        return "Table(%s)" % ', '.join(
+            [repr(self.name)] + [repr(self.metadata)] +
+            [repr(x) for x in self.columns] +
+            ["%s=%s" % (k, repr(getattr(self, k))) for k in ['schema']])
+
+    def __str__(self):
+        return _get_table_key(self.description, self.schema)
+
+    @property
+    def bind(self):
+        """Return the connectable associated with this Table."""
+
+        return self.metadata and self.metadata.bind or None
+
+    def add_is_dependent_on(self, table):
+        """Add a 'dependency' for this Table.
+
+        This is another Table object which must be created
+        first before this one can, or dropped after this one.
+
+        Usually, dependencies between tables are determined via
+        ForeignKey objects.   However, for other situations that
+        create dependencies outside of foreign keys (rules, inheriting),
+        this method can manually establish such a link.
+
+        """
+        self._extra_dependencies.add(table)
+
+    def append_column(self, column):
+        """Append a :class:`~.schema.Column` to this :class:`~.schema.Table`.
+
+        The "key" of the newly added :class:`~.schema.Column`, i.e. the
+        value of its ``.key`` attribute, will then be available
+        in the ``.c`` collection of this :class:`~.schema.Table`, and the
+        column definition will be included in any CREATE TABLE, SELECT,
+        UPDATE, etc. statements generated from this :class:`~.schema.Table`
+        construct.
+
+        Note that this does **not** change the definition of the table
+        as it exists within any underlying database, assuming that
+        table has already been created in the database.   Relational
+        databases support the addition of columns to existing tables
+        using the SQL ALTER command, which would need to be
+        emitted for an already-existing table that doesn't contain
+        the newly added column.
+
+        """
+
+        column._set_parent_with_dispatch(self)
+
+    def append_constraint(self, constraint):
+        """Append a :class:`~.schema.Constraint` to this
+        :class:`~.schema.Table`.
+
+        This has the effect of the constraint being included in any
+        future CREATE TABLE statement, assuming specific DDL creation
+        events have not been associated with the given
+        :class:`~.schema.Constraint` object.
+
+        Note that this does **not** produce the constraint within the
+        relational database automatically, for a table that already exists
+        in the database.   To add a constraint to an
+        existing relational database table, the SQL ALTER command must
+        be used.  SQLAlchemy also provides the
+        :class:`.AddConstraint` construct which can produce this SQL when
+        invoked as an executable clause.
+
+        """
+
+        constraint._set_parent_with_dispatch(self)
+
+    def append_ddl_listener(self, event_name, listener):
+        """Append a DDL event listener to this ``Table``.
+
+        .. deprecated:: 0.7
+            See :class:`.DDLEvents`.
+
+        """
+
+        def adapt_listener(target, connection, **kw):
+            listener(event_name, target, connection)
+
+        event.listen(self, "" + event_name.replace('-', '_'), adapt_listener)
+
+    def _set_parent(self, metadata):
+        metadata._add_table(self.name, self.schema, self)
+        self.metadata = metadata
+
+    def get_children(self, column_collections=True,
+                     schema_visitor=False, **kw):
+        if not schema_visitor:
+            return TableClause.get_children(
+                self, column_collections=column_collections, **kw)
+        else:
+            if column_collections:
+                return list(self.columns)
+            else:
+                return []
+
+    def exists(self, bind=None):
+        """Return True if this table exists."""
+
+        if bind is None:
+            bind = _bind_or_error(self)
+
+        return bind.run_callable(bind.dialect.has_table,
+                                 self.name, schema=self.schema)
+
+    def create(self, bind=None, checkfirst=False):
+        """Issue a ``CREATE`` statement for this
+        :class:`.Table`, using the given :class:`.Connectable`
+        for connectivity.
+
+        .. seealso::
+
+            :meth:`.MetaData.create_all`.
+
+        """
+
+        if bind is None:
+            bind = _bind_or_error(self)
+        bind._run_visitor(ddl.SchemaGenerator,
+                          self,
+                          checkfirst=checkfirst)
+
+    def drop(self, bind=None, checkfirst=False):
+        """Issue a ``DROP`` statement for this
+        :class:`.Table`, using the given :class:`.Connectable`
+        for connectivity.
+
+        .. seealso::
+
+            :meth:`.MetaData.drop_all`.
+
+        """
+        if bind is None:
+            bind = _bind_or_error(self)
+        bind._run_visitor(ddl.SchemaDropper,
+                          self,
+                          checkfirst=checkfirst)
+
+    def tometadata(self, metadata, schema=RETAIN_SCHEMA,
+                   referred_schema_fn=None, name=None):
+        """Return a copy of this :class:`.Table` associated with a different
+        :class:`.MetaData`.
+
+        E.g.::
+
+            m1 = MetaData()
+
+            user = Table('user', m1, Column('id', Integer, priamry_key=True))
+
+            m2 = MetaData()
+            user_copy = user.tometadata(m2)
+
+        :param metadata: Target :class:`.MetaData` object, into which the
+         new :class:`.Table` object will be created.
+
+        :param schema: optional string name indicating the target schema.
+         Defaults to the special symbol :attr:`.RETAIN_SCHEMA` which indicates
+         that no change to the schema name should be made in the new
+         :class:`.Table`.  If set to a string name, the new :class:`.Table`
+         will have this new name as the ``.schema``.  If set to ``None``, the
+         schema will be set to that of the schema set on the target
+         :class:`.MetaData`, which is typically ``None`` as well, unless
+         set explicitly::
+
+            m2 = MetaData(schema='newschema')
+
+            # user_copy_one will have "newschema" as the schema name
+            user_copy_one = user.tometadata(m2, schema=None)
+
+            m3 = MetaData()  # schema defaults to None
+
+            # user_copy_two will have None as the schema name
+            user_copy_two = user.tometadata(m3, schema=None)
+
+        :param referred_schema_fn: optional callable which can be supplied
+         in order to provide for the schema name that should be assigned
+         to the referenced table of a :class:`.ForeignKeyConstraint`.
+         The callable accepts this parent :class:`.Table`, the
+         target schema that we are changing to, the
+         :class:`.ForeignKeyConstraint` object, and the existing
+         "target schema" of that constraint.  The function should return the
+         string schema name that should be applied.
+         E.g.::
+
+                def referred_schema_fn(table, to_schema,
+                                                constraint, referred_schema):
+                    if referred_schema == 'base_tables':
+                        return referred_schema
+                    else:
+                        return to_schema
+
+                new_table = table.tometadata(m2, schema="alt_schema",
+                                        referred_schema_fn=referred_schema_fn)
+
+         .. versionadded:: 0.9.2
+
+        :param name: optional string name indicating the target table name.
+         If not specified or None, the table name is retained.  This allows
+         a :class:`.Table` to be copied to the same :class:`.MetaData` target
+         with a new name.
+
+         .. versionadded:: 1.0.0
+
+        """
+        if name is None:
+            name = self.name
+        if schema is RETAIN_SCHEMA:
+            schema = self.schema
+        elif schema is None:
+            schema = metadata.schema
+        key = _get_table_key(name, schema)
+        if key in metadata.tables:
+            util.warn("Table '%s' already exists within the given "
+                      "MetaData - not copying." % self.description)
+            return metadata.tables[key]
+
+        args = []
+        for c in self.columns:
+            args.append(c.copy(schema=schema))
+        table = Table(
+            name, metadata, schema=schema,
+            *args, **self.kwargs
+        )
+        for c in self.constraints:
+            if isinstance(c, ForeignKeyConstraint):
+                referred_schema = c._referred_schema
+                if referred_schema_fn:
+                    fk_constraint_schema = referred_schema_fn(
+                        self, schema, c, referred_schema)
+                else:
+                    fk_constraint_schema = (
+                        schema if referred_schema == self.schema else None)
+                table.append_constraint(
+                    c.copy(schema=fk_constraint_schema, target_table=table))
+            elif not c._type_bound:
+                # skip unique constraints that would be generated
+                # by the 'unique' flag on Column
+                if isinstance(c, UniqueConstraint) and \
+                    len(c.columns) == 1 and \
+                        list(c.columns)[0].unique:
+                    continue
+
+                table.append_constraint(
+                    c.copy(schema=schema, target_table=table))
+        for index in self.indexes:
+            # skip indexes that would be generated
+            # by the 'index' flag on Column
+            if len(index.columns) == 1 and \
+                    list(index.columns)[0].index:
+                continue
+            Index(index.name,
+                  unique=index.unique,
+                  *[table.c[col] for col in index.columns.keys()],
+                  **index.kwargs)
+        return self._schema_item_copy(table)
+
+
+class Column(SchemaItem, ColumnClause):
+    """Represents a column in a database table."""
+
+    __visit_name__ = 'column'
+
+    def __init__(self, *args, **kwargs):
+        r"""
+        Construct a new ``Column`` object.
+
+        :param name: The name of this column as represented in the database.
+          This argument may be the first positional argument, or specified
+          via keyword.
+
+          Names which contain no upper case characters
+          will be treated as case insensitive names, and will not be quoted
+          unless they are a reserved word.  Names with any number of upper
+          case characters will be quoted and sent exactly.  Note that this
+          behavior applies even for databases which standardize upper
+          case names as case insensitive such as Oracle.
+
+          The name field may be omitted at construction time and applied
+          later, at any time before the Column is associated with a
+          :class:`.Table`.  This is to support convenient
+          usage within the :mod:`~sqlalchemy.ext.declarative` extension.
+
+        :param type\_: The column's type, indicated using an instance which
+          subclasses :class:`~sqlalchemy.types.TypeEngine`.  If no arguments
+          are required for the type, the class of the type can be sent
+          as well, e.g.::
+
+            # use a type with arguments
+            Column('data', String(50))
+
+            # use no arguments
+            Column('level', Integer)
+
+          The ``type`` argument may be the second positional argument
+          or specified by keyword.
+
+          If the ``type`` is ``None`` or is omitted, it will first default to
+          the special type :class:`.NullType`.  If and when this
+          :class:`.Column` is made to refer to another column using
+          :class:`.ForeignKey` and/or :class:`.ForeignKeyConstraint`, the type
+          of the remote-referenced column will be copied to this column as
+          well, at the moment that the foreign key is resolved against that
+          remote :class:`.Column` object.
+
+          .. versionchanged:: 0.9.0
+            Support for propagation of type to a :class:`.Column` from its
+            :class:`.ForeignKey` object has been improved and should be
+            more reliable and timely.
+
+        :param \*args: Additional positional arguments include various
+          :class:`.SchemaItem` derived constructs which will be applied
+          as options to the column.  These include instances of
+          :class:`.Constraint`, :class:`.ForeignKey`, :class:`.ColumnDefault`,
+          and :class:`.Sequence`.  In some cases an equivalent keyword
+          argument is available such as ``server_default``, ``default``
+          and ``unique``.
+
+        :param autoincrement: Set up "auto increment" semantics for an integer
+          primary key column.  The default value is the string ``"auto"``
+          which indicates that a single-column primary key that is of
+          an INTEGER type with no stated client-side or python-side defaults
+          should receive auto increment semantics automatically;
+          all other varieties of primary key columns will not.  This
+          includes that :term:`DDL` such as PostgreSQL SERIAL or MySQL
+          AUTO_INCREMENT will be emitted for this column during a table
+          create, as well as that the column is assumed to generate new
+          integer primary key values when an INSERT statement invokes which
+          will be retrieved by the dialect.
+
+          The flag may be set to ``True`` to indicate that a column which
+          is part of a composite (e.g. multi-column) primary key should
+          have autoincrement semantics, though note that only one column
+          within a primary key may have this setting.    It can also
+          be set to ``True`` to indicate autoincrement semantics on a
+          column that has a client-side or server-side default configured,
+          however note that not all dialects can accommodate all styles
+          of default as an "autoincrement".  It can also be
+          set to ``False`` on a single-column primary key that has a
+          datatype of INTEGER in order to disable auto increment semantics
+          for that column.
+
+          .. versionchanged:: 1.1 The autoincrement flag now defaults to
+             ``"auto"`` which indicates autoincrement semantics by default
+             for single-column integer primary keys only; for composite
+             (multi-column) primary keys, autoincrement is never implicitly
+             enabled; as always, ``autoincrement=True`` will allow for
+             at most one of those columns to be an "autoincrement" column.
+             ``autoincrement=True`` may also be set on a :class:`.Column`
+             that has an explicit client-side or server-side default,
+             subject to limitations of the backend database and dialect.
+
+
+          The setting *only* has an effect for columns which are:
+
+          * Integer derived (i.e. INT, SMALLINT, BIGINT).
+
+          * Part of the primary key
+
+          * Not referring to another column via :class:`.ForeignKey`, unless
+            the value is specified as ``'ignore_fk'``::
+
+                # turn on autoincrement for this column despite
+                # the ForeignKey()
+                Column('id', ForeignKey('other.id'),
+                            primary_key=True, autoincrement='ignore_fk')
+
+            It is typically not desirable to have "autoincrement" enabled
+            on a column that refers to another via foreign key, as such a column
+            is required to refer to a value that originates from elsewhere.
+
+          The setting has these two effects on columns that meet the
+          above criteria:
+
+          * DDL issued for the column will include database-specific
+            keywords intended to signify this column as an
+            "autoincrement" column, such as AUTO INCREMENT on MySQL,
+            SERIAL on PostgreSQL, and IDENTITY on MS-SQL.  It does
+            *not* issue AUTOINCREMENT for SQLite since this is a
+            special SQLite flag that is not required for autoincrementing
+            behavior.
+
+            .. seealso::
+
+                :ref:`sqlite_autoincrement`
+
+          * The column will be considered to be available using an
+            "autoincrement" method specific to the backend database, such
+            as calling upon ``cursor.lastrowid``, using RETURNING in an
+            INSERT statement to get at a sequence-generated value, or using
+            special functions such as "SELECT scope_identity()".
+            These methods are highly specific to the DBAPIs and databases in
+            use and vary greatly, so care should be taken when associating
+            ``autoincrement=True`` with a custom default generation function.
+
+
+        :param default: A scalar, Python callable, or
+            :class:`.ColumnElement` expression representing the
+            *default value* for this column, which will be invoked upon insert
+            if this column is otherwise not specified in the VALUES clause of
+            the insert. This is a shortcut to using :class:`.ColumnDefault` as
+            a positional argument; see that class for full detail on the
+            structure of the argument.
+
+            Contrast this argument to :paramref:`.Column.server_default`
+            which creates a default generator on the database side.
+
+            .. seealso::
+
+                :ref:`metadata_defaults_toplevel`
+
+        :param doc: optional String that can be used by the ORM or similar
+            to document attributes.   This attribute does not render SQL
+            comments (a future attribute 'comment' will achieve that).
+
+        :param key: An optional string identifier which will identify this
+            ``Column`` object on the :class:`.Table`. When a key is provided,
+            this is the only identifier referencing the ``Column`` within the
+            application, including ORM attribute mapping; the ``name`` field
+            is used only when rendering SQL.
+
+        :param index: When ``True``, indicates that the column is indexed.
+            This is a shortcut for using a :class:`.Index` construct on the
+            table. To specify indexes with explicit names or indexes that
+            contain multiple columns, use the :class:`.Index` construct
+            instead.
+
+        :param info: Optional data dictionary which will be populated into the
+            :attr:`.SchemaItem.info` attribute of this object.
+
+        :param nullable: When set to ``False``, will cause the "NOT NULL"
+            phrase to be added when generating DDL for the column.   When
+            ``True``, will normally generate nothing (in SQL this defaults to
+            "NULL"), except in some very specific backend-specific edge cases
+            where "NULL" may render explicitly.   Defaults to ``True`` unless
+            :paramref:`~.Column.primary_key` is also ``True``, in which case it
+            defaults to ``False``.  This parameter is only used when issuing
+            CREATE TABLE statements.
+
+        :param onupdate: A scalar, Python callable, or
+            :class:`~sqlalchemy.sql.expression.ClauseElement` representing a
+            default value to be applied to the column within UPDATE
+            statements, which wil be invoked upon update if this column is not
+            present in the SET clause of the update. This is a shortcut to
+            using :class:`.ColumnDefault` as a positional argument with
+            ``for_update=True``.
+
+            .. seealso::
+
+                :ref:`metadata_defaults` - complete discussion of onupdate
+
+        :param primary_key: If ``True``, marks this column as a primary key
+            column. Multiple columns can have this flag set to specify
+            composite primary keys. As an alternative, the primary key of a
+            :class:`.Table` can be specified via an explicit
+            :class:`.PrimaryKeyConstraint` object.
+
+        :param server_default: A :class:`.FetchedValue` instance, str, Unicode
+            or :func:`~sqlalchemy.sql.expression.text` construct representing
+            the DDL DEFAULT value for the column.
+
+            String types will be emitted as-is, surrounded by single quotes::
+
+                Column('x', Text, server_default="val")
+
+                x TEXT DEFAULT 'val'
+
+            A :func:`~sqlalchemy.sql.expression.text` expression will be
+            rendered as-is, without quotes::
+
+                Column('y', DateTime, server_default=text('NOW()'))
+
+                y DATETIME DEFAULT NOW()
+
+            Strings and text() will be converted into a
+            :class:`.DefaultClause` object upon initialization.
+
+            Use :class:`.FetchedValue` to indicate that an already-existing
+            column will generate a default value on the database side which
+            will be available to SQLAlchemy for post-fetch after inserts. This
+            construct does not specify any DDL and the implementation is left
+            to the database, such as via a trigger.
+
+            .. seealso::
+
+                :ref:`server_defaults` - complete discussion of server side
+                defaults
+
+        :param server_onupdate:   A :class:`.FetchedValue` instance
+             representing a database-side default generation function,
+             such as a trigger. This
+             indicates to SQLAlchemy that a newly generated value will be
+             available after updates. This construct does not actually
+             implement any kind of generation function within the database,
+             which instead must be specified separately.
+
+            .. seealso::
+
+                :ref:`triggered_columns`
+
+        :param quote: Force quoting of this column's name on or off,
+             corresponding to ``True`` or ``False``. When left at its default
+             of ``None``, the column identifier will be quoted according to
+             whether the name is case sensitive (identifiers with at least one
+             upper case character are treated as case sensitive), or if it's a
+             reserved word. This flag is only needed to force quoting of a
+             reserved word which is not known by the SQLAlchemy dialect.
+
+        :param unique: When ``True``, indicates that this column contains a
+             unique constraint, or if ``index`` is ``True`` as well, indicates
+             that the :class:`.Index` should be created with the unique flag.
+             To specify multiple columns in the constraint/index or to specify
+             an explicit name, use the :class:`.UniqueConstraint` or
+             :class:`.Index` constructs explicitly.
+
+        :param system: When ``True``, indicates this is a "system" column,
+             that is a column which is automatically made available by the
+             database, and should not be included in the columns list for a
+             ``CREATE TABLE`` statement.
+
+             For more elaborate scenarios where columns should be
+             conditionally rendered differently on different backends,
+             consider custom compilation rules for :class:`.CreateColumn`.
+
+             .. versionadded:: 0.8.3 Added the ``system=True`` parameter to
+                :class:`.Column`.
+
+        """
+
+        name = kwargs.pop('name', None)
+        type_ = kwargs.pop('type_', None)
+        args = list(args)
+        if args:
+            if isinstance(args[0], util.string_types):
+                if name is not None:
+                    raise exc.ArgumentError(
+                        "May not pass name positionally and as a keyword.")
+                name = args.pop(0)
+        if args:
+            coltype = args[0]
+
+            if hasattr(coltype, "_sqla_type"):
+                if type_ is not None:
+                    raise exc.ArgumentError(
+                        "May not pass type_ positionally and as a keyword.")
+                type_ = args.pop(0)
+
+        if name is not None:
+            name = quoted_name(name, kwargs.pop('quote', None))
+        elif "quote" in kwargs:
+            raise exc.ArgumentError("Explicit 'name' is required when "
+                                    "sending 'quote' argument")
+
+        super(Column, self).__init__(name, type_)
+        self.key = kwargs.pop('key', name)
+        self.primary_key = kwargs.pop('primary_key', False)
+        self.nullable = kwargs.pop('nullable', not self.primary_key)
+        self.default = kwargs.pop('default', None)
+        self.server_default = kwargs.pop('server_default', None)
+        self.server_onupdate = kwargs.pop('server_onupdate', None)
+
+        # these default to None because .index and .unique is *not*
+        # an informational flag about Column - there can still be an
+        # Index or UniqueConstraint referring to this Column.
+        self.index = kwargs.pop('index', None)
+        self.unique = kwargs.pop('unique', None)
+
+        self.system = kwargs.pop('system', False)
+        self.doc = kwargs.pop('doc', None)
+        self.onupdate = kwargs.pop('onupdate', None)
+        self.autoincrement = kwargs.pop('autoincrement', "auto")
+        self.constraints = set()
+        self.foreign_keys = set()
+
+        # check if this Column is proxying another column
+        if '_proxies' in kwargs:
+            self._proxies = kwargs.pop('_proxies')
+        # otherwise, add DDL-related events
+        elif isinstance(self.type, SchemaEventTarget):
+            self.type._set_parent_with_dispatch(self)
+
+        if self.default is not None:
+            if isinstance(self.default, (ColumnDefault, Sequence)):
+                args.append(self.default)
+            else:
+                if getattr(self.type, '_warn_on_bytestring', False):
+                    if isinstance(self.default, util.binary_type):
+                        util.warn(
+                            "Unicode column '%s' has non-unicode "
+                            "default value %r specified." % (
+                                self.key,
+                                self.default
+                            ))
+                args.append(ColumnDefault(self.default))
+
+        if self.server_default is not None:
+            if isinstance(self.server_default, FetchedValue):
+                args.append(self.server_default._as_for_update(False))
+            else:
+                args.append(DefaultClause(self.server_default))
+
+        if self.onupdate is not None:
+            if isinstance(self.onupdate, (ColumnDefault, Sequence)):
+                args.append(self.onupdate)
+            else:
+                args.append(ColumnDefault(self.onupdate, for_update=True))
+
+        if self.server_onupdate is not None:
+            if isinstance(self.server_onupdate, FetchedValue):
+                args.append(self.server_onupdate._as_for_update(True))
+            else:
+                args.append(DefaultClause(self.server_onupdate,
+                                          for_update=True))
+        self._init_items(*args)
+
+        util.set_creation_order(self)
+
+        if 'info' in kwargs:
+            self.info = kwargs.pop('info')
+
+        if kwargs:
+            raise exc.ArgumentError(
+                "Unknown arguments passed to Column: " + repr(list(kwargs)))
+
+#    @property
+#    def quote(self):
+#        return getattr(self.name, "quote", None)
+
+    def __str__(self):
+        if self.name is None:
+            return "(no name)"
+        elif self.table is not None:
+            if self.table.named_with_column:
+                return (self.table.description + "." + self.description)
+            else:
+                return self.description
+        else:
+            return self.description
+
+    def references(self, column):
+        """Return True if this Column references the given column via foreign
+        key."""
+
+        for fk in self.foreign_keys:
+            if fk.column.proxy_set.intersection(column.proxy_set):
+                return True
+        else:
+            return False
+
+    def append_foreign_key(self, fk):
+        fk._set_parent_with_dispatch(self)
+
+    def __repr__(self):
+        kwarg = []
+        if self.key != self.name:
+            kwarg.append('key')
+        if self.primary_key:
+            kwarg.append('primary_key')
+        if not self.nullable:
+            kwarg.append('nullable')
+        if self.onupdate:
+            kwarg.append('onupdate')
+        if self.default:
+            kwarg.append('default')
+        if self.server_default:
+            kwarg.append('server_default')
+        return "Column(%s)" % ', '.join(
+            [repr(self.name)] + [repr(self.type)] +
+            [repr(x) for x in self.foreign_keys if x is not None] +
+            [repr(x) for x in self.constraints] +
+            [(self.table is not None and "table=<%s>" %
+              self.table.description or "table=None")] +
+            ["%s=%s" % (k, repr(getattr(self, k))) for k in kwarg])
+
+    def _set_parent(self, table):
+        if not self.name:
+            raise exc.ArgumentError(
+                "Column must be constructed with a non-blank name or "
+                "assign a non-blank .name before adding to a Table.")
+        if self.key is None:
+            self.key = self.name
+
+        existing = getattr(self, 'table', None)
+        if existing is not None and existing is not table:
+            raise exc.ArgumentError(
+                "Column object '%s' already assigned to Table '%s'" % (
+                    self.key,
+                    existing.description
+                ))
+
+        if self.key in table._columns:
+            col = table._columns.get(self.key)
+            if col is not self:
+                for fk in col.foreign_keys:
+                    table.foreign_keys.remove(fk)
+                    if fk.constraint in table.constraints:
+                        # this might have been removed
+                        # already, if it's a composite constraint
+                        # and more than one col being replaced
+                        table.constraints.remove(fk.constraint)
+
+        table._columns.replace(self)
+
+        if self.primary_key:
+            table.primary_key._replace(self)
+        elif self.key in table.primary_key:
+            raise exc.ArgumentError(
+                "Trying to redefine primary-key column '%s' as a "
+                "non-primary-key column on table '%s'" % (
+                    self.key, table.fullname))
+
+        self.table = table
+
+        if self.index:
+            if isinstance(self.index, util.string_types):
+                raise exc.ArgumentError(
+                    "The 'index' keyword argument on Column is boolean only. "
+                    "To create indexes with a specific name, create an "
+                    "explicit Index object external to the Table.")
+            Index(None, self, unique=bool(self.unique))
+        elif self.unique:
+            if isinstance(self.unique, util.string_types):
+                raise exc.ArgumentError(
+                    "The 'unique' keyword argument on Column is boolean "
+                    "only. To create unique constraints or indexes with a "
+                    "specific name, append an explicit UniqueConstraint to "
+                    "the Table's list of elements, or create an explicit "
+                    "Index object external to the Table.")
+            table.append_constraint(UniqueConstraint(self.key))
+
+        self._setup_on_memoized_fks(lambda fk: fk._set_remote_table(table))
+
+    def _setup_on_memoized_fks(self, fn):
+        fk_keys = [
+            ((self.table.key, self.key), False),
+            ((self.table.key, self.name), True),
+        ]
+        for fk_key, link_to_name in fk_keys:
+            if fk_key in self.table.metadata._fk_memos:
+                for fk in self.table.metadata._fk_memos[fk_key]:
+                    if fk.link_to_name is link_to_name:
+                        fn(fk)
+
+    def _on_table_attach(self, fn):
+        if self.table is not None:
+            fn(self, self.table)
+        else:
+            event.listen(self, 'after_parent_attach', fn)
+
+    def copy(self, **kw):
+        """Create a copy of this ``Column``, unitialized.
+
+        This is used in ``Table.tometadata``.
+
+        """
+
+        # Constraint objects plus non-constraint-bound ForeignKey objects
+        args = \
+            [c.copy(**kw) for c in self.constraints if not c._type_bound] + \
+            [c.copy(**kw) for c in self.foreign_keys if not c.constraint]
+
+        type_ = self.type
+        if isinstance(type_, SchemaEventTarget):
+            type_ = type_.copy(**kw)
+
+        c = self._constructor(
+            name=self.name,
+            type_=type_,
+            key=self.key,
+            primary_key=self.primary_key,
+            nullable=self.nullable,
+            unique=self.unique,
+            system=self.system,
+            # quote=self.quote,
+            index=self.index,
+            autoincrement=self.autoincrement,
+            default=self.default,
+            server_default=self.server_default,
+            onupdate=self.onupdate,
+            server_onupdate=self.server_onupdate,
+            doc=self.doc,
+            *args
+        )
+        return self._schema_item_copy(c)
+
+    def _make_proxy(self, selectable, name=None, key=None,
+                    name_is_truncatable=False, **kw):
+        """Create a *proxy* for this column.
+
+        This is a copy of this ``Column`` referenced by a different parent
+        (such as an alias or select statement).  The column should
+        be used only in select scenarios, as its full DDL/default
+        information is not transferred.
+
+        """
+        fk = [ForeignKey(f.column, _constraint=f.constraint)
+              for f in self.foreign_keys]
+        if name is None and self.name is None:
+            raise exc.InvalidRequestError(
+                "Cannot initialize a sub-selectable"
+                " with this Column object until its 'name' has "
+                "been assigned.")
+        try:
+            c = self._constructor(
+                _as_truncated(name or self.name) if
+                name_is_truncatable else (name or self.name),
+                self.type,
+                key=key if key else name if name else self.key,
+                primary_key=self.primary_key,
+                nullable=self.nullable,
+                _proxies=[self], *fk)
+        except TypeError:
+            util.raise_from_cause(
+                TypeError(
+                    "Could not create a copy of this %r object.  "
+                    "Ensure the class includes a _constructor() "
+                    "attribute or method which accepts the "
+                    "standard Column constructor arguments, or "
+                    "references the Column class itself." % self.__class__)
+            )
+
+        c.table = selectable
+        selectable._columns.add(c)
+        if selectable._is_clone_of is not None:
+            c._is_clone_of = selectable._is_clone_of.columns[c.key]
+        if self.primary_key:
+            selectable.primary_key.add(c)
+        c.dispatch.after_parent_attach(c, selectable)
+        return c
+
+    def get_children(self, schema_visitor=False, **kwargs):
+        if schema_visitor:
+            return [x for x in (self.default, self.onupdate)
+                    if x is not None] + \
+                list(self.foreign_keys) + list(self.constraints)
+        else:
+            return ColumnClause.get_children(self, **kwargs)
+
+
+class ForeignKey(DialectKWArgs, SchemaItem):
+    """Defines a dependency between two columns.
+
+    ``ForeignKey`` is specified as an argument to a :class:`.Column` object,
+    e.g.::
+
+        t = Table("remote_table", metadata,
+            Column("remote_id", ForeignKey("main_table.id"))
+        )
+
+    Note that ``ForeignKey`` is only a marker object that defines
+    a dependency between two columns.   The actual constraint
+    is in all cases represented by the :class:`.ForeignKeyConstraint`
+    object.   This object will be generated automatically when
+    a ``ForeignKey`` is associated with a :class:`.Column` which
+    in turn is associated with a :class:`.Table`.   Conversely,
+    when :class:`.ForeignKeyConstraint` is applied to a :class:`.Table`,
+    ``ForeignKey`` markers are automatically generated to be
+    present on each associated :class:`.Column`, which are also
+    associated with the constraint object.
+
+    Note that you cannot define a "composite" foreign key constraint,
+    that is a constraint between a grouping of multiple parent/child
+    columns, using ``ForeignKey`` objects.   To define this grouping,
+    the :class:`.ForeignKeyConstraint` object must be used, and applied
+    to the :class:`.Table`.   The associated ``ForeignKey`` objects
+    are created automatically.
+
+    The ``ForeignKey`` objects associated with an individual
+    :class:`.Column` object are available in the `foreign_keys` collection
+    of that column.
+
+    Further examples of foreign key configuration are in
+    :ref:`metadata_foreignkeys`.
+
+    """
+
+    __visit_name__ = 'foreign_key'
+
+    def __init__(self, column, _constraint=None, use_alter=False, name=None,
+                 onupdate=None, ondelete=None, deferrable=None,
+                 initially=None, link_to_name=False, match=None,
+                 info=None,
+                 **dialect_kw):
+        r"""
+        Construct a column-level FOREIGN KEY.
+
+        The :class:`.ForeignKey` object when constructed generates a
+        :class:`.ForeignKeyConstraint` which is associated with the parent
+        :class:`.Table` object's collection of constraints.
+
+        :param column: A single target column for the key relationship. A
+            :class:`.Column` object or a column name as a string:
+            ``tablename.columnkey`` or ``schema.tablename.columnkey``.
+            ``columnkey`` is the ``key`` which has been assigned to the column
+            (defaults to the column name itself), unless ``link_to_name`` is
+            ``True`` in which case the rendered name of the column is used.
+
+            .. versionadded:: 0.7.4
+                Note that if the schema name is not included, and the
+                underlying :class:`.MetaData` has a "schema", that value will
+                be used.
+
+        :param name: Optional string. An in-database name for the key if
+            `constraint` is not provided.
+
+        :param onupdate: Optional string. If set, emit ON UPDATE <value> when
+            issuing DDL for this constraint. Typical values include CASCADE,
+            DELETE and RESTRICT.
+
+        :param ondelete: Optional string. If set, emit ON DELETE <value> when
+            issuing DDL for this constraint. Typical values include CASCADE,
+            DELETE and RESTRICT.
+
+        :param deferrable: Optional bool. If set, emit DEFERRABLE or NOT
+            DEFERRABLE when issuing DDL for this constraint.
+
+        :param initially: Optional string. If set, emit INITIALLY <value> when
+            issuing DDL for this constraint.
+
+        :param link_to_name: if True, the string name given in ``column`` is
+            the rendered name of the referenced column, not its locally
+            assigned ``key``.
+
+        :param use_alter: passed to the underlying
+            :class:`.ForeignKeyConstraint` to indicate the constraint should
+            be generated/dropped externally from the CREATE TABLE/ DROP TABLE
+            statement.  See :paramref:`.ForeignKeyConstraint.use_alter`
+            for further description.
+
+            .. seealso::
+
+                :paramref:`.ForeignKeyConstraint.use_alter`
+
+                :ref:`use_alter`
+
+        :param match: Optional string. If set, emit MATCH <value> when issuing
+            DDL for this constraint. Typical values include SIMPLE, PARTIAL
+            and FULL.
+
+        :param info: Optional data dictionary which will be populated into the
+            :attr:`.SchemaItem.info` attribute of this object.
+
+            .. versionadded:: 1.0.0
+
+        :param \**dialect_kw:  Additional keyword arguments are dialect
+            specific, and passed in the form ``<dialectname>_<argname>``.  The
+            arguments are ultimately handled by a corresponding
+            :class:`.ForeignKeyConstraint`.  See the documentation regarding
+            an individual dialect at :ref:`dialect_toplevel` for detail on
+            documented arguments.
+
+            .. versionadded:: 0.9.2
+
+        """
+
+        self._colspec = column
+        if isinstance(self._colspec, util.string_types):
+            self._table_column = None
+        else:
+            if hasattr(self._colspec, '__clause_element__'):
+                self._table_column = self._colspec.__clause_element__()
+            else:
+                self._table_column = self._colspec
+
+            if not isinstance(self._table_column, ColumnClause):
+                raise exc.ArgumentError(
+                    "String, Column, or Column-bound argument "
+                    "expected, got %r" % self._table_column)
+            elif not isinstance(
+                    self._table_column.table, (util.NoneType, TableClause)):
+                raise exc.ArgumentError(
+                    "ForeignKey received Column not bound "
+                    "to a Table, got: %r" % self._table_column.table
+                )
+
+        # the linked ForeignKeyConstraint.
+        # ForeignKey will create this when parent Column
+        # is attached to a Table, *or* ForeignKeyConstraint
+        # object passes itself in when creating ForeignKey
+        # markers.
+        self.constraint = _constraint
+        self.parent = None
+        self.use_alter = use_alter
+        self.name = name
+        self.onupdate = onupdate
+        self.ondelete = ondelete
+        self.deferrable = deferrable
+        self.initially = initially
+        self.link_to_name = link_to_name
+        self.match = match
+        if info:
+            self.info = info
+        self._unvalidated_dialect_kw = dialect_kw
+
+    def __repr__(self):
+        return "ForeignKey(%r)" % self._get_colspec()
+
+    def copy(self, schema=None):
+        """Produce a copy of this :class:`.ForeignKey` object.
+
+        The new :class:`.ForeignKey` will not be bound
+        to any :class:`.Column`.
+
+        This method is usually used by the internal
+        copy procedures of :class:`.Column`, :class:`.Table`,
+        and :class:`.MetaData`.
+
+        :param schema: The returned :class:`.ForeignKey` will
+          reference the original table and column name, qualified
+          by the given string schema name.
+
+        """
+
+        fk = ForeignKey(
+            self._get_colspec(schema=schema),
+            use_alter=self.use_alter,
+            name=self.name,
+            onupdate=self.onupdate,
+            ondelete=self.ondelete,
+            deferrable=self.deferrable,
+            initially=self.initially,
+            link_to_name=self.link_to_name,
+            match=self.match,
+            **self._unvalidated_dialect_kw
+        )
+        return self._schema_item_copy(fk)
+
+    def _get_colspec(self, schema=None, table_name=None):
+        """Return a string based 'column specification' for this
+        :class:`.ForeignKey`.
+
+        This is usually the equivalent of the string-based "tablename.colname"
+        argument first passed to the object's constructor.
+
+        """
+        if schema:
+            _schema, tname, colname = self._column_tokens
+            if table_name is not None:
+                tname = table_name
+            return "%s.%s.%s" % (schema, tname, colname)
+        elif table_name:
+            schema, tname, colname = self._column_tokens
+            if schema:
+                return "%s.%s.%s" % (schema, table_name, colname)
+            else:
+                return "%s.%s" % (table_name, colname)
+        elif self._table_column is not None:
+            return "%s.%s" % (
+                self._table_column.table.fullname, self._table_column.key)
+        else:
+            return self._colspec
+
+    @property
+    def _referred_schema(self):
+        return self._column_tokens[0]
+
+    def _table_key(self):
+        if self._table_column is not None:
+            if self._table_column.table is None:
+                return None
+            else:
+                return self._table_column.table.key
+        else:
+            schema, tname, colname = self._column_tokens
+            return _get_table_key(tname, schema)
+
+    target_fullname = property(_get_colspec)
+
+    def references(self, table):
+        """Return True if the given :class:`.Table` is referenced by this
+        :class:`.ForeignKey`."""
+
+        return table.corresponding_column(self.column) is not None
+
+    def get_referent(self, table):
+        """Return the :class:`.Column` in the given :class:`.Table`
+        referenced by this :class:`.ForeignKey`.
+
+        Returns None if this :class:`.ForeignKey` does not reference the given
+        :class:`.Table`.
+
+        """
+
+        return table.corresponding_column(self.column)
+
+    @util.memoized_property
+    def _column_tokens(self):
+        """parse a string-based _colspec into its component parts."""
+
+        m = self._get_colspec().split('.')
+        if m is None:
+            raise exc.ArgumentError(
+                "Invalid foreign key column specification: %s" %
+                self._colspec)
+        if (len(m) == 1):
+            tname = m.pop()
+            colname = None
+        else:
+            colname = m.pop()
+            tname = m.pop()
+
+        # A FK between column 'bar' and table 'foo' can be
+        # specified as 'foo', 'foo.bar', 'dbo.foo.bar',
+        # 'otherdb.dbo.foo.bar'. Once we have the column name and
+        # the table name, treat everything else as the schema
+        # name. Some databases (e.g. Sybase) support
+        # inter-database foreign keys. See tickets#1341 and --
+        # indirectly related -- Ticket #594. This assumes that '.'
+        # will never appear *within* any component of the FK.
+
+        if (len(m) > 0):
+            schema = '.'.join(m)
+        else:
+            schema = None
+        return schema, tname, colname
+
+    def _resolve_col_tokens(self):
+        if self.parent is None:
+            raise exc.InvalidRequestError(
+                "this ForeignKey object does not yet have a "
+                "parent Column associated with it.")
+
+        elif self.parent.table is None:
+            raise exc.InvalidRequestError(
+                "this ForeignKey's parent column is not yet associated "
+                "with a Table.")
+
+        parenttable = self.parent.table
+
+        # assertion, can be commented out.
+        # basically Column._make_proxy() sends the actual
+        # target Column to the ForeignKey object, so the
+        # string resolution here is never called.
+        for c in self.parent.base_columns:
+            if isinstance(c, Column):
+                assert c.table is parenttable
+                break
+        else:
+            assert False
+        ######################
+
+        schema, tname, colname = self._column_tokens
+
+        if schema is None and parenttable.metadata.schema is not None:
+            schema = parenttable.metadata.schema
+
+        tablekey = _get_table_key(tname, schema)
+        return parenttable, tablekey, colname
+
+    def _link_to_col_by_colstring(self, parenttable, table, colname):
+        if not hasattr(self.constraint, '_referred_table'):
+            self.constraint._referred_table = table
+        else:
+            assert self.constraint._referred_table is table
+
+        _column = None
+        if colname is None:
+            # colname is None in the case that ForeignKey argument
+            # was specified as table name only, in which case we
+            # match the column name to the same column on the
+            # parent.
+            key = self.parent
+            _column = table.c.get(self.parent.key, None)
+        elif self.link_to_name:
+            key = colname
+            for c in table.c:
+                if c.name == colname:
+                    _column = c
+        else:
+            key = colname
+            _column = table.c.get(colname, None)
+
+        if _column is None:
+            raise exc.NoReferencedColumnError(
+                "Could not initialize target column "
+                "for ForeignKey '%s' on table '%s': "
+                "table '%s' has no column named '%s'" %
+                (self._colspec, parenttable.name, table.name, key),
+                table.name, key)
+
+        self._set_target_column(_column)
+
+    def _set_target_column(self, column):
+        # propagate TypeEngine to parent if it didn't have one
+        if self.parent.type._isnull:
+            self.parent.type = column.type
+
+        # super-edgy case, if other FKs point to our column,
+        # they'd get the type propagated out also.
+        if isinstance(self.parent.table, Table):
+
+            def set_type(fk):
+                if fk.parent.type._isnull:
+                    fk.parent.type = column.type
+            self.parent._setup_on_memoized_fks(set_type)
+
+        self.column = column
+
+    @util.memoized_property
+    def column(self):
+        """Return the target :class:`.Column` referenced by this
+        :class:`.ForeignKey`.
+
+        If no target column has been established, an exception
+        is raised.
+
+        .. versionchanged:: 0.9.0
+            Foreign key target column resolution now occurs as soon as both
+            the ForeignKey object and the remote Column to which it refers
+            are both associated with the same MetaData object.
+
+        """
+
+        if isinstance(self._colspec, util.string_types):
+
+            parenttable, tablekey, colname = self._resolve_col_tokens()
+
+            if tablekey not in parenttable.metadata:
+                raise exc.NoReferencedTableError(
+                    "Foreign key associated with column '%s' could not find "
+                    "table '%s' with which to generate a "
+                    "foreign key to target column '%s'" %
+                    (self.parent, tablekey, colname),
+                    tablekey)
+            elif parenttable.key not in parenttable.metadata:
+                raise exc.InvalidRequestError(
+                    "Table %s is no longer associated with its "
+                    "parent MetaData" % parenttable)
+            else:
+                raise exc.NoReferencedColumnError(
+                    "Could not initialize target column for "
+                    "ForeignKey '%s' on table '%s': "
+                    "table '%s' has no column named '%s'" % (
+                        self._colspec, parenttable.name, tablekey, colname),
+                    tablekey, colname)
+        elif hasattr(self._colspec, '__clause_element__'):
+            _column = self._colspec.__clause_element__()
+            return _column
+        else:
+            _column = self._colspec
+            return _column
+
+    def _set_parent(self, column):
+        if self.parent is not None and self.parent is not column:
+            raise exc.InvalidRequestError(
+                "This ForeignKey already has a parent !")
+        self.parent = column
+        self.parent.foreign_keys.add(self)
+        self.parent._on_table_attach(self._set_table)
+
+    def _set_remote_table(self, table):
+        parenttable, tablekey, colname = self._resolve_col_tokens()
+        self._link_to_col_by_colstring(parenttable, table, colname)
+        self.constraint._validate_dest_table(table)
+
+    def _remove_from_metadata(self, metadata):
+        parenttable, table_key, colname = self._resolve_col_tokens()
+        fk_key = (table_key, colname)
+
+        if self in metadata._fk_memos[fk_key]:
+            # TODO: no test coverage for self not in memos
+            metadata._fk_memos[fk_key].remove(self)
+
+    def _set_table(self, column, table):
+        # standalone ForeignKey - create ForeignKeyConstraint
+        # on the hosting Table when attached to the Table.
+        if self.constraint is None and isinstance(table, Table):
+            self.constraint = ForeignKeyConstraint(
+                [], [], use_alter=self.use_alter, name=self.name,
+                onupdate=self.onupdate, ondelete=self.ondelete,
+                deferrable=self.deferrable, initially=self.initially,
+                match=self.match,
+                **self._unvalidated_dialect_kw
+            )
+            self.constraint._append_element(column, self)
+            self.constraint._set_parent_with_dispatch(table)
+        table.foreign_keys.add(self)
+
+        # set up remote ".column" attribute, or a note to pick it
+        # up when the other Table/Column shows up
+        if isinstance(self._colspec, util.string_types):
+            parenttable, table_key, colname = self._resolve_col_tokens()
+            fk_key = (table_key, colname)
+            if table_key in parenttable.metadata.tables:
+                table = parenttable.metadata.tables[table_key]
+                try:
+                    self._link_to_col_by_colstring(
+                        parenttable, table, colname)
+                except exc.NoReferencedColumnError:
+                    # this is OK, we'll try later
+                    pass
+            parenttable.metadata._fk_memos[fk_key].append(self)
+        elif hasattr(self._colspec, '__clause_element__'):
+            _column = self._colspec.__clause_element__()
+            self._set_target_column(_column)
+        else:
+            _column = self._colspec
+            self._set_target_column(_column)
+
+
+class _NotAColumnExpr(object):
+    def _not_a_column_expr(self):
+        raise exc.InvalidRequestError(
+            "This %s cannot be used directly "
+            "as a column expression." % self.__class__.__name__)
+
+    __clause_element__ = self_group = lambda self: self._not_a_column_expr()
+    _from_objects = property(lambda self: self._not_a_column_expr())
+
+
+class DefaultGenerator(_NotAColumnExpr, SchemaItem):
+    """Base class for column *default* values."""
+
+    __visit_name__ = 'default_generator'
+
+    is_sequence = False
+    is_server_default = False
+    column = None
+
+    def __init__(self, for_update=False):
+        self.for_update = for_update
+
+    def _set_parent(self, column):
+        self.column = column
+        if self.for_update:
+            self.column.onupdate = self
+        else:
+            self.column.default = self
+
+    def execute(self, bind=None, **kwargs):
+        if bind is None:
+            bind = _bind_or_error(self)
+        return bind._execute_default(self, **kwargs)
+
+    def _execute_on_connection(self, connection, multiparams, params):
+        return connection._execute_default(self, multiparams, params)
+
+    @property
+    def bind(self):
+        """Return the connectable associated with this default."""
+        if getattr(self, 'column', None) is not None:
+            return self.column.table.bind
+        else:
+            return None
+
+
+class ColumnDefault(DefaultGenerator):
+    """A plain default value on a column.
+
+    This could correspond to a constant, a callable function,
+    or a SQL clause.
+
+    :class:`.ColumnDefault` is generated automatically
+    whenever the ``default``, ``onupdate`` arguments of
+    :class:`.Column` are used.  A :class:`.ColumnDefault`
+    can be passed positionally as well.
+
+    For example, the following::
+
+        Column('foo', Integer, default=50)
+
+    Is equivalent to::
+
+        Column('foo', Integer, ColumnDefault(50))
+
+
+    """
+
+    def __init__(self, arg, **kwargs):
+        """"Construct a new :class:`.ColumnDefault`.
+
+
+        :param arg: argument representing the default value.
+         May be one of the following:
+
+         * a plain non-callable Python value, such as a
+           string, integer, boolean, or other simple type.
+           The default value will be used as is each time.
+         * a SQL expression, that is one which derives from
+           :class:`.ColumnElement`.  The SQL expression will
+           be rendered into the INSERT or UPDATE statement,
+           or in the case of a primary key column when
+           RETURNING is not used may be
+           pre-executed before an INSERT within a SELECT.
+         * A Python callable.  The function will be invoked for each
+           new row subject to an INSERT or UPDATE.
+           The callable must accept exactly
+           zero or one positional arguments.  The one-argument form
+           will receive an instance of the :class:`.ExecutionContext`,
+           which provides contextual information as to the current
+           :class:`.Connection` in use as well as the current
+           statement and parameters.
+
+        """
+        super(ColumnDefault, self).__init__(**kwargs)
+        if isinstance(arg, FetchedValue):
+            raise exc.ArgumentError(
+                "ColumnDefault may not be a server-side default type.")
+        if util.callable(arg):
+            arg = self._maybe_wrap_callable(arg)
+        self.arg = arg
+
+    @util.memoized_property
+    def is_callable(self):
+        return util.callable(self.arg)
+
+    @util.memoized_property
+    def is_clause_element(self):
+        return isinstance(self.arg, ClauseElement)
+
+    @util.memoized_property
+    def is_scalar(self):
+        return not self.is_callable and \
+            not self.is_clause_element and \
+            not self.is_sequence
+
+    def _maybe_wrap_callable(self, fn):
+        """Wrap callables that don't accept a context.
+
+        This is to allow easy compatibility with default callables
+        that aren't specific to accepting of a context.
+
+        """
+        try:
+            argspec = util.get_callable_argspec(fn, no_self=True)
+        except TypeError:
+            return util.wrap_callable(lambda ctx: fn(), fn)
+
+        defaulted = argspec[3] is not None and len(argspec[3]) or 0
+        positionals = len(argspec[0]) - defaulted
+
+        if positionals == 0:
+            return util.wrap_callable(lambda ctx: fn(), fn)
+
+        elif positionals == 1:
+            return fn
+        else:
+            raise exc.ArgumentError(
+                "ColumnDefault Python function takes zero or one "
+                "positional arguments")
+
+    def _visit_name(self):
+        if self.for_update:
+            return "column_onupdate"
+        else:
+            return "column_default"
+    __visit_name__ = property(_visit_name)
+
+    def __repr__(self):
+        return "ColumnDefault(%r)" % self.arg
+
+
+class Sequence(DefaultGenerator):
+    """Represents a named database sequence.
+
+    The :class:`.Sequence` object represents the name and configurational
+    parameters of a database sequence.   It also represents
+    a construct that can be "executed" by a SQLAlchemy :class:`.Engine`
+    or :class:`.Connection`, rendering the appropriate "next value" function
+    for the target database and returning a result.
+
+    The :class:`.Sequence` is typically associated with a primary key column::
+
+        some_table = Table(
+            'some_table', metadata,
+            Column('id', Integer, Sequence('some_table_seq'),
+            primary_key=True)
+        )
+
+    When CREATE TABLE is emitted for the above :class:`.Table`, if the
+    target platform supports sequences, a CREATE SEQUENCE statement will
+    be emitted as well.   For platforms that don't support sequences,
+    the :class:`.Sequence` construct is ignored.
+
+    .. seealso::
+
+        :class:`.CreateSequence`
+
+        :class:`.DropSequence`
+
+    """
+
+    __visit_name__ = 'sequence'
+
+    is_sequence = True
+
+    def __init__(self, name, start=None, increment=None, minvalue=None,
+                 maxvalue=None, nominvalue=None, nomaxvalue=None, cycle=None,
+                 schema=None, cache=None, order=None, optional=False,
+                 quote=None, metadata=None, quote_schema=None,
+                 for_update=False):
+        """Construct a :class:`.Sequence` object.
+
+        :param name: The name of the sequence.
+        :param start: the starting index of the sequence.  This value is
+         used when the CREATE SEQUENCE command is emitted to the database
+         as the value of the "START WITH" clause.   If ``None``, the
+         clause is omitted, which on most platforms indicates a starting
+         value of 1.
+        :param increment: the increment value of the sequence.  This
+         value is used when the CREATE SEQUENCE command is emitted to
+         the database as the value of the "INCREMENT BY" clause.  If ``None``,
+         the clause is omitted, which on most platforms indicates an
+         increment of 1.
+        :param minvalue: the minimum value of the sequence.  This
+         value is used when the CREATE SEQUENCE command is emitted to
+         the database as the value of the "MINVALUE" clause.  If ``None``,
+         the clause is omitted, which on most platforms indicates a
+         minvalue of 1 and -2^63-1 for ascending and descending sequences,
+         respectively.
+
+         .. versionadded:: 1.0.7
+
+        :param maxvalue: the maximum value of the sequence.  This
+         value is used when the CREATE SEQUENCE command is emitted to
+         the database as the value of the "MAXVALUE" clause.  If ``None``,
+         the clause is omitted, which on most platforms indicates a
+         maxvalue of 2^63-1 and -1 for ascending and descending sequences,
+         respectively.
+
+         .. versionadded:: 1.0.7
+
+        :param nominvalue: no minimum value of the sequence.  This
+         value is used when the CREATE SEQUENCE command is emitted to
+         the database as the value of the "NO MINVALUE" clause.  If ``None``,
+         the clause is omitted, which on most platforms indicates a
+         minvalue of 1 and -2^63-1 for ascending and descending sequences,
+         respectively.
+
+         .. versionadded:: 1.0.7
+
+        :param nomaxvalue: no maximum value of the sequence.  This
+         value is used when the CREATE SEQUENCE command is emitted to
+         the database as the value of the "NO MAXVALUE" clause.  If ``None``,
+         the clause is omitted, which on most platforms indicates a
+         maxvalue of 2^63-1 and -1 for ascending and descending sequences,
+         respectively.
+
+         .. versionadded:: 1.0.7
+
+        :param cycle: allows the sequence to wrap around when the maxvalue
+         or minvalue has been reached by an ascending or descending sequence
+         respectively.  This value is used when the CREATE SEQUENCE command
+         is emitted to the database as the "CYCLE" clause.  If the limit is
+         reached, the next number generated will be the minvalue or maxvalue,
+         respectively.  If cycle=False (the default) any calls to nextval
+         after the sequence has reached its maximum value will return an
+         error.
+
+         .. versionadded:: 1.0.7
+
+        :param schema: Optional schema name for the sequence, if located
+         in a schema other than the default.  The rules for selecting the
+         schema name when a :class:`.MetaData` is also present are the same
+         as that of :paramref:`.Table.schema`.
+
+        :param cache: optional integer value; number of future values in the
+         sequence which are calculated in advance.  Renders the CACHE keyword
+         understood by Oracle and PostgreSQL.
+
+         .. versionadded:: 1.1.12
+
+        :param order: optional boolean value; if true, renders the
+         ORDER keyword, understood by Oracle, indicating the sequence is
+         definitively ordered.   May be necessary to provide deterministic
+         ordering using Oracle RAC.
+
+         .. versionadded:: 1.1.12
+
+        :param optional: boolean value, when ``True``, indicates that this
+         :class:`.Sequence` object only needs to be explicitly generated
+         on backends that don't provide another way to generate primary
+         key identifiers.  Currently, it essentially means, "don't create
+         this sequence on the PostgreSQL backend, where the SERIAL keyword
+         creates a sequence for us automatically".
+        :param quote: boolean value, when ``True`` or ``False``, explicitly
+         forces quoting of the schema name on or off.  When left at its
+         default of ``None``, normal quoting rules based on casing and
+         reserved words take place.
+        :param quote_schema: set the quoting preferences for the ``schema``
+         name.
+
+        :param metadata: optional :class:`.MetaData` object which this
+         :class:`.Sequence` will be associated with.  A :class:`.Sequence`
+         that is associated with a :class:`.MetaData` gains the following
+         capabilities:
+
+         * The :class:`.Sequence` will inherit the :paramref:`.MetaData.schema`
+           parameter specified to the target :class:`.MetaData`, which
+           affects the production of CREATE / DROP DDL, if any.
+
+         * The :meth:`.Sequence.create` and :meth:`.Sequence.drop` methods
+           automatically use the engine bound to the :class:`.MetaData`
+           object, if any.
+
+         * The :meth:`.MetaData.create_all` and :meth:`.MetaData.drop_all`
+           methods will emit CREATE / DROP for this :class:`.Sequence`,
+           even if the :class:`.Sequence` is not associated with any
+           :class:`.Table` / :class:`.Column` that's a member of this
+           :class:`.MetaData`.
+
+         The above behaviors can only occur if the :class:`.Sequence` is
+         explicitly associated with the :class:`.MetaData` via this parameter.
+
+         .. seealso::
+
+            :ref:`sequence_metadata` - full discussion of the
+            :paramref:`.Sequence.metadata` parameter.
+
+        :param for_update: Indicates this :class:`.Sequence`, when associated
+         with a :class:`.Column`, should be invoked for UPDATE statements
+         on that column's table, rather than for INSERT statements, when
+         no value is otherwise present for that column in the statement.
+
+        """
+        super(Sequence, self).__init__(for_update=for_update)
+        self.name = quoted_name(name, quote)
+        self.start = start
+        self.increment = increment
+        self.minvalue = minvalue
+        self.maxvalue = maxvalue
+        self.nominvalue = nominvalue
+        self.nomaxvalue = nomaxvalue
+        self.cycle = cycle
+        self.cache = cache
+        self.order = order
+        self.optional = optional
+        if schema is BLANK_SCHEMA:
+            self.schema = schema = None
+        elif metadata is not None and schema is None and metadata.schema:
+            self.schema = schema = metadata.schema
+        else:
+            self.schema = quoted_name(schema, quote_schema)
+        self.metadata = metadata
+        self._key = _get_table_key(name, schema)
+        if metadata:
+            self._set_metadata(metadata)
+
+    @util.memoized_property
+    def is_callable(self):
+        return False
+
+    @util.memoized_property
+    def is_clause_element(self):
+        return False
+
+    @util.dependencies("sqlalchemy.sql.functions.func")
+    def next_value(self, func):
+        """Return a :class:`.next_value` function element
+        which will render the appropriate increment function
+        for this :class:`.Sequence` within any SQL expression.
+
+        """
+        return func.next_value(self, bind=self.bind)
+
+    def _set_parent(self, column):
+        super(Sequence, self)._set_parent(column)
+        column._on_table_attach(self._set_table)
+
+    def _set_table(self, column, table):
+        self._set_metadata(table.metadata)
+
+    def _set_metadata(self, metadata):
+        self.metadata = metadata
+        self.metadata._sequences[self._key] = self
+
+    @property
+    def bind(self):
+        if self.metadata:
+            return self.metadata.bind
+        else:
+            return None
+
+    def create(self, bind=None, checkfirst=True):
+        """Creates this sequence in the database."""
+
+        if bind is None:
+            bind = _bind_or_error(self)
+        bind._run_visitor(ddl.SchemaGenerator,
+                          self,
+                          checkfirst=checkfirst)
+
+    def drop(self, bind=None, checkfirst=True):
+        """Drops this sequence from the database."""
+
+        if bind is None:
+            bind = _bind_or_error(self)
+        bind._run_visitor(ddl.SchemaDropper,
+                          self,
+                          checkfirst=checkfirst)
+
+    def _not_a_column_expr(self):
+        raise exc.InvalidRequestError(
+            "This %s cannot be used directly "
+            "as a column expression.  Use func.next_value(sequence) "
+            "to produce a 'next value' function that's usable "
+            "as a column element."
+            % self.__class__.__name__)
+
+
+@inspection._self_inspects
+class FetchedValue(_NotAColumnExpr, SchemaEventTarget):
+    """A marker for a transparent database-side default.
+
+    Use :class:`.FetchedValue` when the database is configured
+    to provide some automatic default for a column.
+
+    E.g.::
+
+        Column('foo', Integer, FetchedValue())
+
+    Would indicate that some trigger or default generator
+    will create a new value for the ``foo`` column during an
+    INSERT.
+
+    .. seealso::
+
+        :ref:`triggered_columns`
+
+    """
+    is_server_default = True
+    reflected = False
+    has_argument = False
+
+    def __init__(self, for_update=False):
+        self.for_update = for_update
+
+    def _as_for_update(self, for_update):
+        if for_update == self.for_update:
+            return self
+        else:
+            return self._clone(for_update)
+
+    def _clone(self, for_update):
+        n = self.__class__.__new__(self.__class__)
+        n.__dict__.update(self.__dict__)
+        n.__dict__.pop('column', None)
+        n.for_update = for_update
+        return n
+
+    def _set_parent(self, column):
+        self.column = column
+        if self.for_update:
+            self.column.server_onupdate = self
+        else:
+            self.column.server_default = self
+
+    def __repr__(self):
+        return util.generic_repr(self)
+
+
+class DefaultClause(FetchedValue):
+    """A DDL-specified DEFAULT column value.
+
+    :class:`.DefaultClause` is a :class:`.FetchedValue`
+    that also generates a "DEFAULT" clause when
+    "CREATE TABLE" is emitted.
+
+    :class:`.DefaultClause` is generated automatically
+    whenever the ``server_default``, ``server_onupdate`` arguments of
+    :class:`.Column` are used.  A :class:`.DefaultClause`
+    can be passed positionally as well.
+
+    For example, the following::
+
+        Column('foo', Integer, server_default="50")
+
+    Is equivalent to::
+
+        Column('foo', Integer, DefaultClause("50"))
+
+    """
+
+    has_argument = True
+
+    def __init__(self, arg, for_update=False, _reflected=False):
+        util.assert_arg_type(arg, (util.string_types[0],
+                                   ClauseElement,
+                                   TextClause), 'arg')
+        super(DefaultClause, self).__init__(for_update)
+        self.arg = arg
+        self.reflected = _reflected
+
+    def __repr__(self):
+        return "DefaultClause(%r, for_update=%r)" % \
+            (self.arg, self.for_update)
+
+
+class PassiveDefault(DefaultClause):
+    """A DDL-specified DEFAULT column value.
+
+    .. deprecated:: 0.6
+        :class:`.PassiveDefault` is deprecated.
+        Use :class:`.DefaultClause`.
+    """
+    @util.deprecated("0.6",
+                     ":class:`.PassiveDefault` is deprecated.  "
+                     "Use :class:`.DefaultClause`.",
+                     False)
+    def __init__(self, *arg, **kw):
+        DefaultClause.__init__(self, *arg, **kw)
+
+
+class Constraint(DialectKWArgs, SchemaItem):
+    """A table-level SQL constraint."""
+
+    __visit_name__ = 'constraint'
+
+    def __init__(self, name=None, deferrable=None, initially=None,
+                 _create_rule=None, info=None, _type_bound=False,
+                 **dialect_kw):
+        r"""Create a SQL constraint.
+
+        :param name:
+          Optional, the in-database name of this ``Constraint``.
+
+        :param deferrable:
+          Optional bool.  If set, emit DEFERRABLE or NOT DEFERRABLE when
+          issuing DDL for this constraint.
+
+        :param initially:
+          Optional string.  If set, emit INITIALLY <value> when issuing DDL
+          for this constraint.
+
+        :param info: Optional data dictionary which will be populated into the
+            :attr:`.SchemaItem.info` attribute of this object.
+
+            .. versionadded:: 1.0.0
+
+        :param _create_rule:
+          a callable which is passed the DDLCompiler object during
+          compilation. Returns True or False to signal inline generation of
+          this Constraint.
+
+          The AddConstraint and DropConstraint DDL constructs provide
+          DDLElement's more comprehensive "conditional DDL" approach that is
+          passed a database connection when DDL is being issued. _create_rule
+          is instead called during any CREATE TABLE compilation, where there
+          may not be any transaction/connection in progress. However, it
+          allows conditional compilation of the constraint even for backends
+          which do not support addition of constraints through ALTER TABLE,
+          which currently includes SQLite.
+
+          _create_rule is used by some types to create constraints.
+          Currently, its call signature is subject to change at any time.
+
+        :param \**dialect_kw:  Additional keyword arguments are dialect
+            specific, and passed in the form ``<dialectname>_<argname>``.  See
+            the documentation regarding an individual dialect at
+            :ref:`dialect_toplevel` for detail on documented arguments.
+
+        """
+
+        self.name = name
+        self.deferrable = deferrable
+        self.initially = initially
+        if info:
+            self.info = info
+        self._create_rule = _create_rule
+        self._type_bound = _type_bound
+        util.set_creation_order(self)
+        self._validate_dialect_kwargs(dialect_kw)
+
+    @property
+    def table(self):
+        try:
+            if isinstance(self.parent, Table):
+                return self.parent
+        except AttributeError:
+            pass
+        raise exc.InvalidRequestError(
+            "This constraint is not bound to a table.  Did you "
+            "mean to call table.append_constraint(constraint) ?")
+
+    def _set_parent(self, parent):
+        self.parent = parent
+        parent.constraints.add(self)
+
+    def copy(self, **kw):
+        raise NotImplementedError()
+
+
+def _to_schema_column(element):
+    if hasattr(element, '__clause_element__'):
+        element = element.__clause_element__()
+    if not isinstance(element, Column):
+        raise exc.ArgumentError("schema.Column object expected")
+    return element
+
+
+def _to_schema_column_or_string(element):
+    if hasattr(element, '__clause_element__'):
+        element = element.__clause_element__()
+    if not isinstance(element, util.string_types + (ColumnElement, )):
+        msg = "Element %r is not a string name or column element"
+        raise exc.ArgumentError(msg % element)
+    return element
+
+
+class ColumnCollectionMixin(object):
+
+    columns = None
+    """A :class:`.ColumnCollection` of :class:`.Column` objects.
+
+    This collection represents the columns which are referred to by
+    this object.
+
+    """
+
+    _allow_multiple_tables = False
+
+    def __init__(self, *columns, **kw):
+        _autoattach = kw.pop('_autoattach', True)
+        self.columns = ColumnCollection()
+        self._pending_colargs = [_to_schema_column_or_string(c)
+                                 for c in columns]
+        if _autoattach and self._pending_colargs:
+            self._check_attach()
+
+    @classmethod
+    def _extract_col_expression_collection(cls, expressions):
+        for expr in expressions:
+            strname = None
+            column = None
+            if hasattr(expr, '__clause_element__'):
+                expr = expr.__clause_element__()
+
+            if not isinstance(expr, (ColumnElement, TextClause)):
+                # this assumes a string
+                strname = expr
+            else:
+                cols = []
+                visitors.traverse(expr, {}, {'column': cols.append})
+                if cols:
+                    column = cols[0]
+            add_element = column if column is not None else strname
+            yield expr, column, strname, add_element
+
+    def _check_attach(self, evt=False):
+        col_objs = [
+            c for c in self._pending_colargs
+            if isinstance(c, Column)
+        ]
+
+        cols_w_table = [
+            c for c in col_objs if isinstance(c.table, Table)
+        ]
+
+        cols_wo_table = set(col_objs).difference(cols_w_table)
+
+        if cols_wo_table:
+            # feature #3341 - place event listeners for Column objects
+            # such that when all those cols are attached, we autoattach.
+            assert not evt, "Should not reach here on event call"
+
+            # issue #3411 - don't do the per-column auto-attach if some of the
+            # columns are specified as strings.
+            has_string_cols = set(self._pending_colargs).difference(col_objs)
+            if not has_string_cols:
+                def _col_attached(column, table):
+                    # this isinstance() corresponds with the
+                    # isinstance() above; only want to count Table-bound
+                    # columns
+                    if isinstance(table, Table):
+                        cols_wo_table.discard(column)
+                        if not cols_wo_table:
+                            self._check_attach(evt=True)
+                self._cols_wo_table = cols_wo_table
+                for col in cols_wo_table:
+                    col._on_table_attach(_col_attached)
+                return
+
+        columns = cols_w_table
+
+        tables = set([c.table for c in columns])
+        if len(tables) == 1:
+            self._set_parent_with_dispatch(tables.pop())
+        elif len(tables) > 1 and not self._allow_multiple_tables:
+            table = columns[0].table
+            others = [c for c in columns[1:] if c.table is not table]
+            if others:
+                raise exc.ArgumentError(
+                    "Column(s) %s are not part of table '%s'." %
+                    (", ".join("'%s'" % c for c in others),
+                        table.description)
+                )
+
+    def _set_parent(self, table):
+        for col in self._pending_colargs:
+            if isinstance(col, util.string_types):
+                col = table.c[col]
+            self.columns.add(col)
+
+
+class ColumnCollectionConstraint(ColumnCollectionMixin, Constraint):
+    """A constraint that proxies a ColumnCollection."""
+
+    def __init__(self, *columns, **kw):
+        r"""
+        :param \*columns:
+          A sequence of column names or Column objects.
+
+        :param name:
+          Optional, the in-database name of this constraint.
+
+        :param deferrable:
+          Optional bool.  If set, emit DEFERRABLE or NOT DEFERRABLE when
+          issuing DDL for this constraint.
+
+        :param initially:
+          Optional string.  If set, emit INITIALLY <value> when issuing DDL
+          for this constraint.
+
+        :param \**kw: other keyword arguments including dialect-specific
+          arguments are propagated to the :class:`.Constraint` superclass.
+
+        """
+        _autoattach = kw.pop('_autoattach', True)
+        Constraint.__init__(self, **kw)
+        ColumnCollectionMixin.__init__(self, *columns, _autoattach=_autoattach)
+
+    columns = None
+    """A :class:`.ColumnCollection` representing the set of columns
+    for this constraint.
+
+    """
+
+    def _set_parent(self, table):
+        Constraint._set_parent(self, table)
+        ColumnCollectionMixin._set_parent(self, table)
+
+    def __contains__(self, x):
+        return x in self.columns
+
+    def copy(self, **kw):
+        c = self.__class__(name=self.name, deferrable=self.deferrable,
+                           initially=self.initially, *self.columns.keys())
+        return self._schema_item_copy(c)
+
+    def contains_column(self, col):
+        """Return True if this constraint contains the given column.
+
+        Note that this object also contains an attribute ``.columns``
+        which is a :class:`.ColumnCollection` of :class:`.Column` objects.
+
+        """
+
+        return self.columns.contains_column(col)
+
+    def __iter__(self):
+        # inlining of
+        # return iter(self.columns)
+        # ColumnCollection->OrderedProperties->OrderedDict
+        ordered_dict = self.columns._data
+        return (ordered_dict[key] for key in ordered_dict._list)
+
+    def __len__(self):
+        return len(self.columns._data)
+
+
+class CheckConstraint(ColumnCollectionConstraint):
+    """A table- or column-level CHECK constraint.
+
+    Can be included in the definition of a Table or Column.
+    """
+
+    _allow_multiple_tables = True
+
+    def __init__(self, sqltext, name=None, deferrable=None,
+                 initially=None, table=None, info=None, _create_rule=None,
+                 _autoattach=True, _type_bound=False):
+        r"""Construct a CHECK constraint.
+
+        :param sqltext:
+          A string containing the constraint definition, which will be used
+          verbatim, or a SQL expression construct.   If given as a string,
+          the object is converted to a :class:`.Text` object.   If the textual
+          string includes a colon character, escape this using a backslash::
+
+            CheckConstraint(r"foo ~ E'a(?\:b|c)d")
+
+        :param name:
+          Optional, the in-database name of the constraint.
+
+        :param deferrable:
+          Optional bool.  If set, emit DEFERRABLE or NOT DEFERRABLE when
+          issuing DDL for this constraint.
+
+        :param initially:
+          Optional string.  If set, emit INITIALLY <value> when issuing DDL
+          for this constraint.
+
+        :param info: Optional data dictionary which will be populated into the
+            :attr:`.SchemaItem.info` attribute of this object.
+
+            .. versionadded:: 1.0.0
+
+        """
+
+        self.sqltext = _literal_as_text(sqltext, warn=False)
+
+        columns = []
+        visitors.traverse(self.sqltext, {}, {'column': columns.append})
+
+        super(CheckConstraint, self).\
+            __init__(
+                name=name, deferrable=deferrable,
+                initially=initially, _create_rule=_create_rule, info=info,
+                _type_bound=_type_bound, _autoattach=_autoattach,
+                *columns)
+        if table is not None:
+            self._set_parent_with_dispatch(table)
+
+    def __visit_name__(self):
+        if isinstance(self.parent, Table):
+            return "check_constraint"
+        else:
+            return "column_check_constraint"
+    __visit_name__ = property(__visit_name__)
+
+    def copy(self, target_table=None, **kw):
+        if target_table is not None:
+            def replace(col):
+                if self.table.c.contains_column(col):
+                    return target_table.c[col.key]
+                else:
+                    return None
+            sqltext = visitors.replacement_traverse(self.sqltext, {}, replace)
+        else:
+            sqltext = self.sqltext
+        c = CheckConstraint(sqltext,
+                            name=self.name,
+                            initially=self.initially,
+                            deferrable=self.deferrable,
+                            _create_rule=self._create_rule,
+                            table=target_table,
+                            _autoattach=False,
+                            _type_bound=self._type_bound)
+        return self._schema_item_copy(c)
+
+
+class ForeignKeyConstraint(ColumnCollectionConstraint):
+    """A table-level FOREIGN KEY constraint.
+
+    Defines a single column or composite FOREIGN KEY ... REFERENCES
+    constraint. For a no-frills, single column foreign key, adding a
+    :class:`.ForeignKey` to the definition of a :class:`.Column` is a
+    shorthand equivalent for an unnamed, single column
+    :class:`.ForeignKeyConstraint`.
+
+    Examples of foreign key configuration are in :ref:`metadata_foreignkeys`.
+
+    """
+    __visit_name__ = 'foreign_key_constraint'
+
+    def __init__(self, columns, refcolumns, name=None, onupdate=None,
+                 ondelete=None, deferrable=None, initially=None,
+                 use_alter=False, link_to_name=False, match=None,
+                 table=None, info=None, **dialect_kw):
+        r"""Construct a composite-capable FOREIGN KEY.
+
+        :param columns: A sequence of local column names. The named columns
+          must be defined and present in the parent Table. The names should
+          match the ``key`` given to each column (defaults to the name) unless
+          ``link_to_name`` is True.
+
+        :param refcolumns: A sequence of foreign column names or Column
+          objects. The columns must all be located within the same Table.
+
+        :param name: Optional, the in-database name of the key.
+
+        :param onupdate: Optional string. If set, emit ON UPDATE <value> when
+          issuing DDL for this constraint. Typical values include CASCADE,
+          DELETE and RESTRICT.
+
+        :param ondelete: Optional string. If set, emit ON DELETE <value> when
+          issuing DDL for this constraint. Typical values include CASCADE,
+          DELETE and RESTRICT.
+
+        :param deferrable: Optional bool. If set, emit DEFERRABLE or NOT
+          DEFERRABLE when issuing DDL for this constraint.
+
+        :param initially: Optional string. If set, emit INITIALLY <value> when
+          issuing DDL for this constraint.
+
+        :param link_to_name: if True, the string name given in ``column`` is
+          the rendered name of the referenced column, not its locally assigned
+          ``key``.
+
+        :param use_alter: If True, do not emit the DDL for this constraint as
+          part of the CREATE TABLE definition. Instead, generate it via an
+          ALTER TABLE statement issued after the full collection of tables
+          have been created, and drop it via an ALTER TABLE statement before
+          the full collection of tables are dropped.
+
+          The use of :paramref:`.ForeignKeyConstraint.use_alter` is
+          particularly geared towards the case where two or more tables
+          are established within a mutually-dependent foreign key constraint
+          relationship; however, the :meth:`.MetaData.create_all` and
+          :meth:`.MetaData.drop_all` methods will perform this resolution
+          automatically, so the flag is normally not needed.
+
+          .. versionchanged:: 1.0.0  Automatic resolution of foreign key
+             cycles has been added, removing the need to use the
+             :paramref:`.ForeignKeyConstraint.use_alter` in typical use
+             cases.
+
+          .. seealso::
+
+                :ref:`use_alter`
+
+        :param match: Optional string. If set, emit MATCH <value> when issuing
+          DDL for this constraint. Typical values include SIMPLE, PARTIAL
+          and FULL.
+
+        :param info: Optional data dictionary which will be populated into the
+            :attr:`.SchemaItem.info` attribute of this object.
+
+            .. versionadded:: 1.0.0
+
+        :param \**dialect_kw:  Additional keyword arguments are dialect
+          specific, and passed in the form ``<dialectname>_<argname>``.  See
+          the documentation regarding an individual dialect at
+          :ref:`dialect_toplevel` for detail on documented arguments.
+
+            .. versionadded:: 0.9.2
+
+        """
+
+        Constraint.__init__(
+            self, name=name, deferrable=deferrable, initially=initially,
+            info=info, **dialect_kw)
+        self.onupdate = onupdate
+        self.ondelete = ondelete
+        self.link_to_name = link_to_name
+        self.use_alter = use_alter
+        self.match = match
+
+        if len(set(columns)) != len(refcolumns):
+            if len(set(columns)) != len(columns):
+                # e.g. FOREIGN KEY (a, a) REFERENCES r (b, c)
+                raise exc.ArgumentError(
+                    "ForeignKeyConstraint with duplicate source column "
+                    "references are not supported."
+                )
+            else:
+                # e.g. FOREIGN KEY (a) REFERENCES r (b, c)
+                # paraphrasing https://www.postgresql.org/docs/9.2/static/\
+                # ddl-constraints.html
+                raise exc.ArgumentError(
+                    "ForeignKeyConstraint number "
+                    "of constrained columns must match the number of "
+                    "referenced columns.")
+
+        # standalone ForeignKeyConstraint - create
+        # associated ForeignKey objects which will be applied to hosted
+        # Column objects (in col.foreign_keys), either now or when attached
+        # to the Table for string-specified names
+        self.elements = [
+            ForeignKey(
+                refcol,
+                _constraint=self,
+                name=self.name,
+                onupdate=self.onupdate,
+                ondelete=self.ondelete,
+                use_alter=self.use_alter,
+                link_to_name=self.link_to_name,
+                match=self.match,
+                deferrable=self.deferrable,
+                initially=self.initially,
+                **self.dialect_kwargs
+            ) for refcol in refcolumns
+        ]
+
+        ColumnCollectionMixin.__init__(self, *columns)
+        if table is not None:
+            if hasattr(self, "parent"):
+                assert table is self.parent
+            self._set_parent_with_dispatch(table)
+
+    def _append_element(self, column, fk):
+        self.columns.add(column)
+        self.elements.append(fk)
+
+    columns = None
+    """A :class:`.ColumnCollection` representing the set of columns
+    for this constraint.
+
+    """
+
+    elements = None
+    """A sequence of :class:`.ForeignKey` objects.
+
+    Each :class:`.ForeignKey` represents a single referring column/referred
+    column pair.
+
+    This collection is intended to be read-only.
+
+    """
+
+    @property
+    def _elements(self):
+        # legacy - provide a dictionary view of (column_key, fk)
+        return util.OrderedDict(
+            zip(self.column_keys, self.elements)
+        )
+
+    @property
+    def _referred_schema(self):
+        for elem in self.elements:
+            return elem._referred_schema
+        else:
+            return None
+
+    @property
+    def referred_table(self):
+        """The :class:`.Table` object to which this
+        :class:`.ForeignKeyConstraint` references.
+
+        This is a dynamically calculated attribute which may not be available
+        if the constraint and/or parent table is not yet associated with
+        a metadata collection that contains the referred table.
+
+        .. versionadded:: 1.0.0
+
+        """
+        return self.elements[0].column.table
+
+    def _validate_dest_table(self, table):
+        table_keys = set([elem._table_key()
+                          for elem in self.elements])
+        if None not in table_keys and len(table_keys) > 1:
+            elem0, elem1 = sorted(table_keys)[0:2]
+            raise exc.ArgumentError(
+                'ForeignKeyConstraint on %s(%s) refers to '
+                'multiple remote tables: %s and %s' % (
+                    table.fullname,
+                    self._col_description,
+                    elem0,
+                    elem1
+                ))
+
+    @property
+    def column_keys(self):
+        """Return a list of string keys representing the local
+        columns in this :class:`.ForeignKeyConstraint`.
+
+        This list is either the original string arguments sent
+        to the constructor of the :class:`.ForeignKeyConstraint`,
+        or if the constraint has been initialized with :class:`.Column`
+        objects, is the string .key of each element.
+
+        .. versionadded:: 1.0.0
+
+        """
+        if hasattr(self, "parent"):
+            return self.columns.keys()
+        else:
+            return [
+                col.key if isinstance(col, ColumnElement)
+                else str(col) for col in self._pending_colargs
+            ]
+
+    @property
+    def _col_description(self):
+        return ", ".join(self.column_keys)
+
+    def _set_parent(self, table):
+        Constraint._set_parent(self, table)
+
+        try:
+            ColumnCollectionConstraint._set_parent(self, table)
+        except KeyError as ke:
+            raise exc.ArgumentError(
+                "Can't create ForeignKeyConstraint "
+                "on table '%s': no column "
+                "named '%s' is present." % (table.description, ke.args[0]))
+
+        for col, fk in zip(self.columns, self.elements):
+            if not hasattr(fk, 'parent') or \
+                    fk.parent is not col:
+                fk._set_parent_with_dispatch(col)
+
+        self._validate_dest_table(table)
+
+    def copy(self, schema=None, target_table=None, **kw):
+        fkc = ForeignKeyConstraint(
+            [x.parent.key for x in self.elements],
+            [x._get_colspec(
+                schema=schema,
+                table_name=target_table.name
+                if target_table is not None
+                and x._table_key() == x.parent.table.key
+                else None)
+             for x in self.elements],
+            name=self.name,
+            onupdate=self.onupdate,
+            ondelete=self.ondelete,
+            use_alter=self.use_alter,
+            deferrable=self.deferrable,
+            initially=self.initially,
+            link_to_name=self.link_to_name,
+            match=self.match
+        )
+        for self_fk, other_fk in zip(
+                self.elements,
+                fkc.elements):
+            self_fk._schema_item_copy(other_fk)
+        return self._schema_item_copy(fkc)
+
+
+class PrimaryKeyConstraint(ColumnCollectionConstraint):
+    """A table-level PRIMARY KEY constraint.
+
+    The :class:`.PrimaryKeyConstraint` object is present automatically
+    on any :class:`.Table` object; it is assigned a set of
+    :class:`.Column` objects corresponding to those marked with
+    the :paramref:`.Column.primary_key` flag::
+
+        >>> my_table = Table('mytable', metadata,
+        ...                 Column('id', Integer, primary_key=True),
+        ...                 Column('version_id', Integer, primary_key=True),
+        ...                 Column('data', String(50))
+        ...     )
+        >>> my_table.primary_key
+        PrimaryKeyConstraint(
+            Column('id', Integer(), table=<mytable>,
+                   primary_key=True, nullable=False),
+            Column('version_id', Integer(), table=<mytable>,
+                   primary_key=True, nullable=False)
+        )
+
+    The primary key of a :class:`.Table` can also be specified by using
+    a :class:`.PrimaryKeyConstraint` object explicitly; in this mode of usage,
+    the "name" of the constraint can also be specified, as well as other
+    options which may be recognized by dialects::
+
+        my_table = Table('mytable', metadata,
+                    Column('id', Integer),
+                    Column('version_id', Integer),
+                    Column('data', String(50)),
+                    PrimaryKeyConstraint('id', 'version_id',
+                                         name='mytable_pk')
+                )
+
+    The two styles of column-specification should generally not be mixed.
+    An warning is emitted if the columns present in the
+    :class:`.PrimaryKeyConstraint`
+    don't match the columns that were marked as ``primary_key=True``, if both
+    are present; in this case, the columns are taken strictly from the
+    :class:`.PrimaryKeyConstraint` declaration, and those columns otherwise
+    marked as ``primary_key=True`` are ignored.  This behavior is intended to
+    be backwards compatible with previous behavior.
+
+    .. versionchanged:: 0.9.2  Using a mixture of columns within a
+       :class:`.PrimaryKeyConstraint` in addition to columns marked as
+       ``primary_key=True`` now emits a warning if the lists don't match.
+       The ultimate behavior of ignoring those columns marked with the flag
+       only is currently maintained for backwards compatibility; this warning
+       may raise an exception in a future release.
+
+    For the use case where specific options are to be specified on the
+    :class:`.PrimaryKeyConstraint`, but the usual style of using
+    ``primary_key=True`` flags is still desirable, an empty
+    :class:`.PrimaryKeyConstraint` may be specified, which will take on the
+    primary key column collection from the :class:`.Table` based on the
+    flags::
+
+        my_table = Table('mytable', metadata,
+                    Column('id', Integer, primary_key=True),
+                    Column('version_id', Integer, primary_key=True),
+                    Column('data', String(50)),
+                    PrimaryKeyConstraint(name='mytable_pk',
+                                         mssql_clustered=True)
+                )
+
+    .. versionadded:: 0.9.2 an empty :class:`.PrimaryKeyConstraint` may now
+       be specified for the purposes of establishing keyword arguments with
+       the constraint, independently of the specification of "primary key"
+       columns within the :class:`.Table` itself; columns marked as
+       ``primary_key=True`` will be gathered into the empty constraint's
+       column collection.
+
+    """
+
+    __visit_name__ = 'primary_key_constraint'
+
+    def __init__(self, *columns, **kw):
+        self._implicit_generated = kw.pop('_implicit_generated', False)
+        super(PrimaryKeyConstraint, self).__init__(*columns, **kw)
+
+    def _set_parent(self, table):
+        super(PrimaryKeyConstraint, self)._set_parent(table)
+
+        if table.primary_key is not self:
+            table.constraints.discard(table.primary_key)
+            table.primary_key = self
+            table.constraints.add(self)
+
+        table_pks = [c for c in table.c if c.primary_key]
+        if self.columns and table_pks and \
+                set(table_pks) != set(self.columns.values()):
+            util.warn(
+                "Table '%s' specifies columns %s as primary_key=True, "
+                "not matching locally specified columns %s; setting the "
+                "current primary key columns to %s. This warning "
+                "may become an exception in a future release" %
+                (
+                    table.name,
+                    ", ".join("'%s'" % c.name for c in table_pks),
+                    ", ".join("'%s'" % c.name for c in self.columns),
+                    ", ".join("'%s'" % c.name for c in self.columns)
+                )
+            )
+            table_pks[:] = []
+
+        for c in self.columns:
+            c.primary_key = True
+            c.nullable = False
+        self.columns.extend(table_pks)
+
+    def _reload(self, columns):
+        """repopulate this :class:`.PrimaryKeyConstraint` given
+        a set of columns.
+
+        Existing columns in the table that are marked as primary_key=True
+        are maintained.
+
+        Also fires a new event.
+
+        This is basically like putting a whole new
+        :class:`.PrimaryKeyConstraint` object on the parent
+        :class:`.Table` object without actually replacing the object.
+
+        The ordering of the given list of columns is also maintained; these
+        columns will be appended to the list of columns after any which
+        are already present.
+
+        """
+
+        # set the primary key flag on new columns.
+        # note any existing PK cols on the table also have their
+        # flag still set.
+        for col in columns:
+            col.primary_key = True
+
+        self.columns.extend(columns)
+
+        PrimaryKeyConstraint._autoincrement_column._reset(self)
+        self._set_parent_with_dispatch(self.table)
+
+    def _replace(self, col):
+        PrimaryKeyConstraint._autoincrement_column._reset(self)
+        self.columns.replace(col)
+
+    @property
+    def columns_autoinc_first(self):
+        autoinc = self._autoincrement_column
+
+        if autoinc is not None:
+            return [autoinc] + [c for c in self.columns if c is not autoinc]
+        else:
+            return list(self.columns)
+
+    @util.memoized_property
+    def _autoincrement_column(self):
+
+        def _validate_autoinc(col, autoinc_true):
+            if col.type._type_affinity is None or not issubclass(
+                col.type._type_affinity,
+                    type_api.INTEGERTYPE._type_affinity):
+                if autoinc_true:
+                    raise exc.ArgumentError(
+                        "Column type %s on column '%s' is not "
+                        "compatible with autoincrement=True" % (
+                            col.type,
+                            col
+                        ))
+                else:
+                    return False
+            elif not isinstance(col.default, (type(None), Sequence)) and \
+                    not autoinc_true:
+                    return False
+            elif col.server_default is not None and not autoinc_true:
+                return False
+            elif (
+                    col.foreign_keys and col.autoincrement
+                    not in (True, 'ignore_fk')):
+                return False
+            return True
+
+        if len(self.columns) == 1:
+            col = list(self.columns)[0]
+
+            if col.autoincrement is True:
+                _validate_autoinc(col, True)
+                return col
+            elif (
+                col.autoincrement in ('auto', 'ignore_fk') and
+                    _validate_autoinc(col, False)
+            ):
+                return col
+
+        else:
+            autoinc = None
+            for col in self.columns:
+                if col.autoincrement is True:
+                    _validate_autoinc(col, True)
+                    if autoinc is not None:
+                        raise exc.ArgumentError(
+                            "Only one Column may be marked "
+                            "autoincrement=True, found both %s and %s." %
+                            (col.name, autoinc.name)
+                        )
+                    else:
+                        autoinc = col
+
+            return autoinc
+
+
+class UniqueConstraint(ColumnCollectionConstraint):
+    """A table-level UNIQUE constraint.
+
+    Defines a single column or composite UNIQUE constraint. For a no-frills,
+    single column constraint, adding ``unique=True`` to the ``Column``
+    definition is a shorthand equivalent for an unnamed, single column
+    UniqueConstraint.
+    """
+
+    __visit_name__ = 'unique_constraint'
+
+
+class Index(DialectKWArgs, ColumnCollectionMixin, SchemaItem):
+    """A table-level INDEX.
+
+    Defines a composite (one or more column) INDEX.
+
+    E.g.::
+
+        sometable = Table("sometable", metadata,
+                        Column("name", String(50)),
+                        Column("address", String(100))
+                    )
+
+        Index("some_index", sometable.c.name)
+
+    For a no-frills, single column index, adding
+    :class:`.Column` also supports ``index=True``::
+
+        sometable = Table("sometable", metadata,
+                        Column("name", String(50), index=True)
+                    )
+
+    For a composite index, multiple columns can be specified::
+
+        Index("some_index", sometable.c.name, sometable.c.address)
+
+    Functional indexes are supported as well, typically by using the
+    :data:`.func` construct in conjunction with table-bound
+    :class:`.Column` objects::
+
+        Index("some_index", func.lower(sometable.c.name))
+
+    .. versionadded:: 0.8 support for functional and expression-based indexes.
+
+    An :class:`.Index` can also be manually associated with a :class:`.Table`,
+    either through inline declaration or using
+    :meth:`.Table.append_constraint`.  When this approach is used, the names
+    of the indexed columns can be specified as strings::
+
+        Table("sometable", metadata,
+                        Column("name", String(50)),
+                        Column("address", String(100)),
+                        Index("some_index", "name", "address")
+                )
+
+    To support functional or expression-based indexes in this form, the
+    :func:`.text` construct may be used::
+
+        from sqlalchemy import text
+
+        Table("sometable", metadata,
+                        Column("name", String(50)),
+                        Column("address", String(100)),
+                        Index("some_index", text("lower(name)"))
+                )
+
+    .. versionadded:: 0.9.5 the :func:`.text` construct may be used to
+       specify :class:`.Index` expressions, provided the :class:`.Index`
+       is explicitly associated with the :class:`.Table`.
+
+
+    .. seealso::
+
+        :ref:`schema_indexes` - General information on :class:`.Index`.
+
+        :ref:`postgresql_indexes` - PostgreSQL-specific options available for
+        the :class:`.Index` construct.
+
+        :ref:`mysql_indexes` - MySQL-specific options available for the
+        :class:`.Index` construct.
+
+        :ref:`mssql_indexes` - MSSQL-specific options available for the
+        :class:`.Index` construct.
+
+    """
+
+    __visit_name__ = 'index'
+
+    def __init__(self, name, *expressions, **kw):
+        r"""Construct an index object.
+
+        :param name:
+          The name of the index
+
+        :param \*expressions:
+          Column expressions to include in the index.   The expressions
+          are normally instances of :class:`.Column`, but may also
+          be arbitrary SQL expressions which ultimately refer to a
+          :class:`.Column`.
+
+        :param unique=False:
+            Keyword only argument; if True, create a unique index.
+
+        :param quote=None:
+            Keyword only argument; whether to apply quoting to the name of
+            the index.  Works in the same manner as that of
+            :paramref:`.Column.quote`.
+
+        :param info=None: Optional data dictionary which will be populated
+            into the :attr:`.SchemaItem.info` attribute of this object.
+
+            .. versionadded:: 1.0.0
+
+        :param \**kw: Additional keyword arguments not mentioned above are
+            dialect specific, and passed in the form
+            ``<dialectname>_<argname>``. See the documentation regarding an
+            individual dialect at :ref:`dialect_toplevel` for detail on
+            documented arguments.
+
+        """
+        self.table = None
+
+        columns = []
+        processed_expressions = []
+        for expr, column, strname, add_element in self.\
+                _extract_col_expression_collection(expressions):
+            if add_element is not None:
+                columns.append(add_element)
+            processed_expressions.append(expr)
+
+        self.expressions = processed_expressions
+        self.name = quoted_name(name, kw.pop("quote", None))
+        self.unique = kw.pop('unique', False)
+        if 'info' in kw:
+            self.info = kw.pop('info')
+        self._validate_dialect_kwargs(kw)
+
+        # will call _set_parent() if table-bound column
+        # objects are present
+        ColumnCollectionMixin.__init__(self, *columns)
+
+    def _set_parent(self, table):
+        ColumnCollectionMixin._set_parent(self, table)
+
+        if self.table is not None and table is not self.table:
+            raise exc.ArgumentError(
+                "Index '%s' is against table '%s', and "
+                "cannot be associated with table '%s'." % (
+                    self.name,
+                    self.table.description,
+                    table.description
+                )
+            )
+        self.table = table
+        table.indexes.add(self)
+
+        self.expressions = [
+            expr if isinstance(expr, ClauseElement)
+            else colexpr
+            for expr, colexpr in util.zip_longest(self.expressions,
+                                                  self.columns)
+        ]
+
+    @property
+    def bind(self):
+        """Return the connectable associated with this Index."""
+
+        return self.table.bind
+
+    def create(self, bind=None):
+        """Issue a ``CREATE`` statement for this
+        :class:`.Index`, using the given :class:`.Connectable`
+        for connectivity.
+
+        .. seealso::
+
+            :meth:`.MetaData.create_all`.
+
+        """
+        if bind is None:
+            bind = _bind_or_error(self)
+        bind._run_visitor(ddl.SchemaGenerator, self)
+        return self
+
+    def drop(self, bind=None):
+        """Issue a ``DROP`` statement for this
+        :class:`.Index`, using the given :class:`.Connectable`
+        for connectivity.
+
+        .. seealso::
+
+            :meth:`.MetaData.drop_all`.
+
+        """
+        if bind is None:
+            bind = _bind_or_error(self)
+        bind._run_visitor(ddl.SchemaDropper, self)
+
+    def __repr__(self):
+        return 'Index(%s)' % (
+            ", ".join(
+                [repr(self.name)] +
+                [repr(e) for e in self.expressions] +
+                (self.unique and ["unique=True"] or [])
+            ))
+
+
+DEFAULT_NAMING_CONVENTION = util.immutabledict({
+    "ix": 'ix_%(column_0_label)s'
+})
+
+
+class MetaData(SchemaItem):
+    """A collection of :class:`.Table` objects and their associated schema
+    constructs.
+
+    Holds a collection of :class:`.Table` objects as well as
+    an optional binding to an :class:`.Engine` or
+    :class:`.Connection`.  If bound, the :class:`.Table` objects
+    in the collection and their columns may participate in implicit SQL
+    execution.
+
+    The :class:`.Table` objects themselves are stored in the
+    :attr:`.MetaData.tables` dictionary.
+
+    :class:`.MetaData` is a thread-safe object for read operations.
+    Construction of new tables within a single :class:`.MetaData` object,
+    either explicitly or via reflection, may not be completely thread-safe.
+
+    .. seealso::
+
+        :ref:`metadata_describing` - Introduction to database metadata
+
+    """
+
+    __visit_name__ = 'metadata'
+
+    def __init__(self, bind=None, reflect=False, schema=None,
+                 quote_schema=None,
+                 naming_convention=DEFAULT_NAMING_CONVENTION,
+                 info=None
+                 ):
+        """Create a new MetaData object.
+
+        :param bind:
+          An Engine or Connection to bind to.  May also be a string or URL
+          instance, these are passed to create_engine() and this MetaData will
+          be bound to the resulting engine.
+
+        :param reflect:
+          Optional, automatically load all tables from the bound database.
+          Defaults to False. ``bind`` is required when this option is set.
+
+          .. deprecated:: 0.8
+                Please use the :meth:`.MetaData.reflect` method.
+
+        :param schema:
+           The default schema to use for the :class:`.Table`,
+           :class:`.Sequence`, and potentially other objects associated with
+           this :class:`.MetaData`. Defaults to ``None``.
+
+           When this value is set, any :class:`.Table` or :class:`.Sequence`
+           which specifies ``None`` for the schema parameter will instead
+           have this schema name defined.  To build a :class:`.Table`
+           or :class:`.Sequence` that still has ``None`` for the schema
+           even when this parameter is present, use the :attr:`.BLANK_SCHEMA`
+           symbol.
+
+           .. note::
+
+                As refered above, the :paramref:`.MetaData.schema` parameter
+                only refers to the **default value** that will be applied to
+                the :paramref:`.Table.schema` parameter of an incoming
+                :class:`.Table` object.   It does not refer to how the
+                :class:`.Table` is catalogued within the :class:`.MetaData`,
+                which remains consistent vs. a :class:`.MetaData` collection
+                that does not define this parameter.  The :class:`.Table`
+                within the :class:`.MetaData` will still be keyed based on its
+                schema-qualified name, e.g.
+                ``my_metadata.tables["some_schema.my_table"]``.
+
+                The current behavior of the :class:`.ForeignKey` object is to
+                circumvent this restriction, where it can locate a table given
+                the table name alone, where the schema will be assumed to be
+                present from this value as specified on the owning
+                :class:`.MetaData` collection.  However, this implies  that a
+                table qualified with BLANK_SCHEMA cannot currently be referred
+                to by string name from :class:`.ForeignKey`.    Other parts of
+                SQLAlchemy such as Declarative may not have similar behaviors
+                built in, however may do so in a future release, along with a
+                consistent method of referring to a table in BLANK_SCHEMA.
+
+
+           .. seealso::
+
+                :paramref:`.Table.schema`
+
+                :paramref:`.Sequence.schema`
+
+        :param quote_schema:
+            Sets the ``quote_schema`` flag for those :class:`.Table`,
+            :class:`.Sequence`, and other objects which make usage of the
+            local ``schema`` name.
+
+        :param info: Optional data dictionary which will be populated into the
+            :attr:`.SchemaItem.info` attribute of this object.
+
+            .. versionadded:: 1.0.0
+
+        :param naming_convention: a dictionary referring to values which
+          will establish default naming conventions for :class:`.Constraint`
+          and :class:`.Index` objects, for those objects which are not given
+          a name explicitly.
+
+          The keys of this dictionary may be:
+
+          * a constraint or Index class, e.g. the :class:`.UniqueConstraint`,
+            :class:`.ForeignKeyConstraint` class, the :class:`.Index` class
+
+          * a string mnemonic for one of the known constraint classes;
+            ``"fk"``, ``"pk"``, ``"ix"``, ``"ck"``, ``"uq"`` for foreign key,
+            primary key, index, check, and unique constraint, respectively.
+
+          * the string name of a user-defined "token" that can be used
+            to define new naming tokens.
+
+          The values associated with each "constraint class" or "constraint
+          mnemonic" key are string naming templates, such as
+          ``"uq_%(table_name)s_%(column_0_name)s"``,
+          which describe how the name should be composed.  The values
+          associated with user-defined "token" keys should be callables of the
+          form ``fn(constraint, table)``, which accepts the constraint/index
+          object and :class:`.Table` as arguments, returning a string
+          result.
+
+          The built-in names are as follows, some of which may only be
+          available for certain types of constraint:
+
+            * ``%(table_name)s`` - the name of the :class:`.Table` object
+              associated with the constraint.
+
+            * ``%(referred_table_name)s`` - the name of the :class:`.Table`
+              object associated with the referencing target of a
+              :class:`.ForeignKeyConstraint`.
+
+            * ``%(column_0_name)s`` - the name of the :class:`.Column` at
+              index position "0" within the constraint.
+
+            * ``%(column_0_label)s`` - the label of the :class:`.Column` at
+              index position "0", e.g. :attr:`.Column.label`
+
+            * ``%(column_0_key)s`` - the key of the :class:`.Column` at
+              index position "0", e.g. :attr:`.Column.key`
+
+            * ``%(referred_column_0_name)s`` - the name of a :class:`.Column`
+              at index position "0" referenced by a
+              :class:`.ForeignKeyConstraint`.
+
+            * ``%(constraint_name)s`` - a special key that refers to the
+              existing name given to the constraint.  When this key is
+              present, the :class:`.Constraint` object's existing name will be
+              replaced with one that is composed from template string that
+              uses this token. When this token is present, it is required that
+              the :class:`.Constraint` is given an explicit name ahead of time.
+
+            * user-defined: any additional token may be implemented by passing
+              it along with a ``fn(constraint, table)`` callable to the
+              naming_convention dictionary.
+
+          .. versionadded:: 0.9.2
+
+          .. seealso::
+
+                :ref:`constraint_naming_conventions` - for detailed usage
+                examples.
+
+        """
+        self.tables = util.immutabledict()
+        self.schema = quoted_name(schema, quote_schema)
+        self.naming_convention = naming_convention
+        if info:
+            self.info = info
+        self._schemas = set()
+        self._sequences = {}
+        self._fk_memos = collections.defaultdict(list)
+
+        self.bind = bind
+        if reflect:
+            util.warn_deprecated("reflect=True is deprecate; please "
+                                 "use the reflect() method.")
+            if not bind:
+                raise exc.ArgumentError(
+                    "A bind must be supplied in conjunction "
+                    "with reflect=True")
+            self.reflect()
+
+    tables = None
+    """A dictionary of :class:`.Table` objects keyed to their name or "table key".
+
+    The exact key is that determined by the :attr:`.Table.key` attribute;
+    for a table with no :attr:`.Table.schema` attribute, this is the same
+    as :attr:`.Table.name`.  For a table with a schema, it is typically of the
+    form ``schemaname.tablename``.
+
+    .. seealso::
+
+        :attr:`.MetaData.sorted_tables`
+
+    """
+
+    def __repr__(self):
+        return 'MetaData(bind=%r)' % self.bind
+
+    def __contains__(self, table_or_key):
+        if not isinstance(table_or_key, util.string_types):
+            table_or_key = table_or_key.key
+        return table_or_key in self.tables
+
+    def _add_table(self, name, schema, table):
+        key = _get_table_key(name, schema)
+        dict.__setitem__(self.tables, key, table)
+        if schema:
+            self._schemas.add(schema)
+
+    def _remove_table(self, name, schema):
+        key = _get_table_key(name, schema)
+        removed = dict.pop(self.tables, key, None)
+        if removed is not None:
+            for fk in removed.foreign_keys:
+                fk._remove_from_metadata(self)
+        if self._schemas:
+            self._schemas = set([t.schema
+                                 for t in self.tables.values()
+                                 if t.schema is not None])
+
+    def __getstate__(self):
+        return {'tables': self.tables,
+                'schema': self.schema,
+                'schemas': self._schemas,
+                'sequences': self._sequences,
+                'fk_memos': self._fk_memos,
+                'naming_convention': self.naming_convention
+                }
+
+    def __setstate__(self, state):
+        self.tables = state['tables']
+        self.schema = state['schema']
+        self.naming_convention = state['naming_convention']
+        self._bind = None
+        self._sequences = state['sequences']
+        self._schemas = state['schemas']
+        self._fk_memos = state['fk_memos']
+
+    def is_bound(self):
+        """True if this MetaData is bound to an Engine or Connection."""
+
+        return self._bind is not None
+
+    def bind(self):
+        """An :class:`.Engine` or :class:`.Connection` to which this
+        :class:`.MetaData` is bound.
+
+        Typically, a :class:`.Engine` is assigned to this attribute
+        so that "implicit execution" may be used, or alternatively
+        as a means of providing engine binding information to an
+        ORM :class:`.Session` object::
+
+            engine = create_engine("someurl://")
+            metadata.bind = engine
+
+        .. seealso::
+
+           :ref:`dbengine_implicit` - background on "bound metadata"
+
+        """
+        return self._bind
+
+    @util.dependencies("sqlalchemy.engine.url")
+    def _bind_to(self, url, bind):
+        """Bind this MetaData to an Engine, Connection, string or URL."""
+
+        if isinstance(bind, util.string_types + (url.URL, )):
+            self._bind = sqlalchemy.create_engine(bind)
+        else:
+            self._bind = bind
+    bind = property(bind, _bind_to)
+
+    def clear(self):
+        """Clear all Table objects from this MetaData."""
+
+        dict.clear(self.tables)
+        self._schemas.clear()
+        self._fk_memos.clear()
+
+    def remove(self, table):
+        """Remove the given Table object from this MetaData."""
+
+        self._remove_table(table.name, table.schema)
+
+    @property
+    def sorted_tables(self):
+        """Returns a list of :class:`.Table` objects sorted in order of
+        foreign key dependency.
+
+        The sorting will place :class:`.Table` objects that have dependencies
+        first, before the dependencies themselves, representing the
+        order in which they can be created.   To get the order in which
+        the tables would be dropped, use the ``reversed()`` Python built-in.
+
+        .. warning::
+
+            The :attr:`.sorted_tables` accessor cannot by itself accommodate
+            automatic resolution of dependency cycles between tables, which
+            are usually caused by mutually dependent foreign key constraints.
+            To resolve these cycles, either the
+            :paramref:`.ForeignKeyConstraint.use_alter` parameter may be appled
+            to those constraints, or use the
+            :func:`.schema.sort_tables_and_constraints` function which will break
+            out foreign key constraints involved in cycles separately.
+
+        .. seealso::
+
+            :func:`.schema.sort_tables`
+
+            :func:`.schema.sort_tables_and_constraints`
+
+            :attr:`.MetaData.tables`
+
+            :meth:`.Inspector.get_table_names`
+
+            :meth:`.Inspector.get_sorted_table_and_fkc_names`
+
+
+        """
+        return ddl.sort_tables(sorted(self.tables.values(), key=lambda t: t.key))
+
+    def reflect(self, bind=None, schema=None, views=False, only=None,
+                extend_existing=False,
+                autoload_replace=True,
+                **dialect_kwargs):
+        r"""Load all available table definitions from the database.
+
+        Automatically creates ``Table`` entries in this ``MetaData`` for any
+        table available in the database but not yet present in the
+        ``MetaData``.  May be called multiple times to pick up tables recently
+        added to the database, however no special action is taken if a table
+        in this ``MetaData`` no longer exists in the database.
+
+        :param bind:
+          A :class:`.Connectable` used to access the database; if None, uses
+          the existing bind on this ``MetaData``, if any.
+
+        :param schema:
+          Optional, query and reflect tables from an alterate schema.
+          If None, the schema associated with this :class:`.MetaData`
+          is used, if any.
+
+        :param views:
+          If True, also reflect views.
+
+        :param only:
+          Optional.  Load only a sub-set of available named tables.  May be
+          specified as a sequence of names or a callable.
+
+          If a sequence of names is provided, only those tables will be
+          reflected.  An error is raised if a table is requested but not
+          available.  Named tables already present in this ``MetaData`` are
+          ignored.
+
+          If a callable is provided, it will be used as a boolean predicate to
+          filter the list of potential table names.  The callable is called
+          with a table name and this ``MetaData`` instance as positional
+          arguments and should return a true value for any table to reflect.
+
+        :param extend_existing: Passed along to each :class:`.Table` as
+          :paramref:`.Table.extend_existing`.
+
+          .. versionadded:: 0.9.1
+
+        :param autoload_replace: Passed along to each :class:`.Table` as
+          :paramref:`.Table.autoload_replace`.
+
+          .. versionadded:: 0.9.1
+
+        :param \**dialect_kwargs: Additional keyword arguments not mentioned
+         above are dialect specific, and passed in the form
+         ``<dialectname>_<argname>``.  See the documentation regarding an
+         individual dialect at :ref:`dialect_toplevel` for detail on
+         documented arguments.
+
+          .. versionadded:: 0.9.2 - Added
+             :paramref:`.MetaData.reflect.**dialect_kwargs` to support
+             dialect-level reflection options for all :class:`.Table`
+             objects reflected.
+
+        """
+        if bind is None:
+            bind = _bind_or_error(self)
+
+        with bind.connect() as conn:
+
+            reflect_opts = {
+                'autoload': True,
+                'autoload_with': conn,
+                'extend_existing': extend_existing,
+                'autoload_replace': autoload_replace,
+                '_extend_on': set()
+            }
+
+            reflect_opts.update(dialect_kwargs)
+
+            if schema is None:
+                schema = self.schema
+
+            if schema is not None:
+                reflect_opts['schema'] = schema
+
+            available = util.OrderedSet(
+                bind.engine.table_names(schema, connection=conn))
+            if views:
+                available.update(
+                    bind.dialect.get_view_names(conn, schema)
+                )
+
+            if schema is not None:
+                available_w_schema = util.OrderedSet(["%s.%s" % (schema, name)
+                                                      for name in available])
+            else:
+                available_w_schema = available
+
+            current = set(self.tables)
+
+            if only is None:
+                load = [name for name, schname in
+                        zip(available, available_w_schema)
+                        if extend_existing or schname not in current]
+            elif util.callable(only):
+                load = [name for name, schname in
+                        zip(available, available_w_schema)
+                        if (extend_existing or schname not in current)
+                        and only(name, self)]
+            else:
+                missing = [name for name in only if name not in available]
+                if missing:
+                    s = schema and (" schema '%s'" % schema) or ''
+                    raise exc.InvalidRequestError(
+                        'Could not reflect: requested table(s) not available '
+                        'in %r%s: (%s)' %
+                        (bind.engine, s, ', '.join(missing)))
+                load = [name for name in only if extend_existing or
+                        name not in current]
+
+            for name in load:
+                Table(name, self, **reflect_opts)
+
+    def append_ddl_listener(self, event_name, listener):
+        """Append a DDL event listener to this ``MetaData``.
+
+        .. deprecated:: 0.7
+            See :class:`.DDLEvents`.
+
+        """
+        def adapt_listener(target, connection, **kw):
+            tables = kw['tables']
+            listener(event, target, connection, tables=tables)
+
+        event.listen(self, "" + event_name.replace('-', '_'), adapt_listener)
+
+    def create_all(self, bind=None, tables=None, checkfirst=True):
+        """Create all tables stored in this metadata.
+
+        Conditional by default, will not attempt to recreate tables already
+        present in the target database.
+
+        :param bind:
+          A :class:`.Connectable` used to access the
+          database; if None, uses the existing bind on this ``MetaData``, if
+          any.
+
+        :param tables:
+          Optional list of ``Table`` objects, which is a subset of the total
+          tables in the ``MetaData`` (others are ignored).
+
+        :param checkfirst:
+          Defaults to True, don't issue CREATEs for tables already present
+          in the target database.
+
+        """
+        if bind is None:
+            bind = _bind_or_error(self)
+        bind._run_visitor(ddl.SchemaGenerator,
+                          self,
+                          checkfirst=checkfirst,
+                          tables=tables)
+
+    def drop_all(self, bind=None, tables=None, checkfirst=True):
+        """Drop all tables stored in this metadata.
+
+        Conditional by default, will not attempt to drop tables not present in
+        the target database.
+
+        :param bind:
+          A :class:`.Connectable` used to access the
+          database; if None, uses the existing bind on this ``MetaData``, if
+          any.
+
+        :param tables:
+          Optional list of ``Table`` objects, which is a subset of the
+          total tables in the ``MetaData`` (others are ignored).
+
+        :param checkfirst:
+          Defaults to True, only issue DROPs for tables confirmed to be
+          present in the target database.
+
+        """
+        if bind is None:
+            bind = _bind_or_error(self)
+        bind._run_visitor(ddl.SchemaDropper,
+                          self,
+                          checkfirst=checkfirst,
+                          tables=tables)
+
+
+class ThreadLocalMetaData(MetaData):
+    """A MetaData variant that presents a different ``bind`` in every thread.
+
+    Makes the ``bind`` property of the MetaData a thread-local value, allowing
+    this collection of tables to be bound to different ``Engine``
+    implementations or connections in each thread.
+
+    The ThreadLocalMetaData starts off bound to None in each thread.  Binds
+    must be made explicitly by assigning to the ``bind`` property or using
+    ``connect()``.  You can also re-bind dynamically multiple times per
+    thread, just like a regular ``MetaData``.
+
+    """
+
+    __visit_name__ = 'metadata'
+
+    def __init__(self):
+        """Construct a ThreadLocalMetaData."""
+
+        self.context = util.threading.local()
+        self.__engines = {}
+        super(ThreadLocalMetaData, self).__init__()
+
+    def bind(self):
+        """The bound Engine or Connection for this thread.
+
+        This property may be assigned an Engine or Connection, or assigned a
+        string or URL to automatically create a basic Engine for this bind
+        with ``create_engine()``."""
+
+        return getattr(self.context, '_engine', None)
+
+    @util.dependencies("sqlalchemy.engine.url")
+    def _bind_to(self, url, bind):
+        """Bind to a Connectable in the caller's thread."""
+
+        if isinstance(bind, util.string_types + (url.URL, )):
+            try:
+                self.context._engine = self.__engines[bind]
+            except KeyError:
+                e = sqlalchemy.create_engine(bind)
+                self.__engines[bind] = e
+                self.context._engine = e
+        else:
+            # TODO: this is squirrely.  we shouldn't have to hold onto engines
+            # in a case like this
+            if bind not in self.__engines:
+                self.__engines[bind] = bind
+            self.context._engine = bind
+
+    bind = property(bind, _bind_to)
+
+    def is_bound(self):
+        """True if there is a bind for this thread."""
+        return (hasattr(self.context, '_engine') and
+                self.context._engine is not None)
+
+    def dispose(self):
+        """Dispose all bound engines, in all thread contexts."""
+
+        for e in self.__engines.values():
+            if hasattr(e, 'dispose'):
+                e.dispose()
+
+
+class _SchemaTranslateMap(object):
+    """Provide translation of schema names based on a mapping.
+
+    Also provides helpers for producing cache keys and optimized
+    access when no mapping is present.
+
+    Used by the :paramref:`.Connection.execution_options.schema_translate_map`
+    feature.
+
+    .. versionadded:: 1.1
+
+
+    """
+    __slots__ = 'map_', '__call__', 'hash_key', 'is_default'
+
+    _default_schema_getter = operator.attrgetter("schema")
+
+    def __init__(self, map_):
+        self.map_ = map_
+        if map_ is not None:
+            def schema_for_object(obj):
+                effective_schema = self._default_schema_getter(obj)
+                effective_schema = obj._translate_schema(
+                    effective_schema, map_)
+                return effective_schema
+            self.__call__ = schema_for_object
+            self.hash_key = ";".join(
+                "%s=%s" % (k, map_[k])
+                for k in sorted(map_, key=str)
+            )
+            self.is_default = False
+        else:
+            self.hash_key = 0
+            self.__call__ = self._default_schema_getter
+            self.is_default = True
+
+    @classmethod
+    def _schema_getter(cls, map_):
+        if map_ is None:
+            return _default_schema_map
+        elif isinstance(map_, _SchemaTranslateMap):
+            return map_
+        else:
+            return _SchemaTranslateMap(map_)
+
+_default_schema_map = _SchemaTranslateMap(None)
+_schema_getter = _SchemaTranslateMap._schema_getter
+
+
+ +
+
+
+ +
+
+ + + + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/_sources/carepoint.db.rst.txt b/_sources/carepoint.db.rst.txt new file mode 100644 index 0000000..aa875f8 --- /dev/null +++ b/_sources/carepoint.db.rst.txt @@ -0,0 +1,30 @@ +carepoint\.db package +===================== + +Submodules +---------- + +carepoint\.db\.carepoint module +------------------------------- + +.. automodule:: carepoint.db.carepoint + :members: + :undoc-members: + :show-inheritance: + +carepoint\.db\.db module +------------------------ + +.. automodule:: carepoint.db.db + :members: + :undoc-members: + :show-inheritance: + + +Module contents +--------------- + +.. automodule:: carepoint.db + :members: + :undoc-members: + :show-inheritance: diff --git a/_sources/carepoint.models.cph.rst.txt b/_sources/carepoint.models.cph.rst.txt new file mode 100644 index 0000000..992db03 --- /dev/null +++ b/_sources/carepoint.models.cph.rst.txt @@ -0,0 +1,454 @@ +carepoint\.models\.cph package +============================== + +Submodules +---------- + +carepoint\.models\.cph\.account module +-------------------------------------- + +.. automodule:: carepoint.models.cph.account + :members: + :undoc-members: + :show-inheritance: + +carepoint\.models\.cph\.account\_activity module +------------------------------------------------ + +.. automodule:: carepoint.models.cph.account_activity + :members: + :undoc-members: + :show-inheritance: + +carepoint\.models\.cph\.address module +-------------------------------------- + +.. automodule:: carepoint.models.cph.address + :members: + :undoc-members: + :show-inheritance: + +carepoint\.models\.cph\.dispense module +--------------------------------------- + +.. automodule:: carepoint.models.cph.dispense + :members: + :undoc-members: + :show-inheritance: + +carepoint\.models\.cph\.dispense\_price module +---------------------------------------------- + +.. automodule:: carepoint.models.cph.dispense_price + :members: + :undoc-members: + :show-inheritance: + +carepoint\.models\.cph\.doctor module +------------------------------------- + +.. automodule:: carepoint.models.cph.doctor + :members: + :undoc-members: + :show-inheritance: + +carepoint\.models\.cph\.doctor\_address module +---------------------------------------------- + +.. automodule:: carepoint.models.cph.doctor_address + :members: + :undoc-members: + :show-inheritance: + +carepoint\.models\.cph\.doctor\_phone module +-------------------------------------------- + +.. automodule:: carepoint.models.cph.doctor_phone + :members: + :undoc-members: + :show-inheritance: + +carepoint\.models\.cph\.fdb\_allergen module +-------------------------------------------- + +.. automodule:: carepoint.models.cph.fdb_allergen + :members: + :undoc-members: + :show-inheritance: + +carepoint\.models\.cph\.fdb\_allergen\_desc module +-------------------------------------------------- + +.. automodule:: carepoint.models.cph.fdb_allergen_desc + :members: + :undoc-members: + :show-inheritance: + +carepoint\.models\.cph\.fdb\_allergen\_group module +--------------------------------------------------- + +.. automodule:: carepoint.models.cph.fdb_allergen_group + :members: + :undoc-members: + :show-inheritance: + +carepoint\.models\.cph\.fdb\_allergen\_rel module +------------------------------------------------- + +.. automodule:: carepoint.models.cph.fdb_allergen_rel + :members: + :undoc-members: + :show-inheritance: + +carepoint\.models\.cph\.fdb\_attr module +---------------------------------------- + +.. automodule:: carepoint.models.cph.fdb_attr + :members: + :undoc-members: + :show-inheritance: + +carepoint\.models\.cph\.fdb\_attr\_base module +---------------------------------------------- + +.. automodule:: carepoint.models.cph.fdb_attr_base + :members: + :undoc-members: + :show-inheritance: + +carepoint\.models\.cph\.fdb\_attr\_type module +---------------------------------------------- + +.. automodule:: carepoint.models.cph.fdb_attr_type + :members: + :undoc-members: + :show-inheritance: + +carepoint\.models\.cph\.fdb\_form module +---------------------------------------- + +.. automodule:: carepoint.models.cph.fdb_form + :members: + :undoc-members: + :show-inheritance: + +carepoint\.models\.cph\.fdb\_gcn module +--------------------------------------- + +.. automodule:: carepoint.models.cph.fdb_gcn + :members: + :undoc-members: + :show-inheritance: + +carepoint\.models\.cph\.fdb\_gcn\_seq module +-------------------------------------------- + +.. automodule:: carepoint.models.cph.fdb_gcn_seq + :members: + :undoc-members: + :show-inheritance: + +carepoint\.models\.cph\.fdb\_img module +--------------------------------------- + +.. automodule:: carepoint.models.cph.fdb_img + :members: + :undoc-members: + :show-inheritance: + +carepoint\.models\.cph\.fdb\_img\_date module +--------------------------------------------- + +.. automodule:: carepoint.models.cph.fdb_img_date + :members: + :undoc-members: + :show-inheritance: + +carepoint\.models\.cph\.fdb\_img\_id module +------------------------------------------- + +.. automodule:: carepoint.models.cph.fdb_img_id + :members: + :undoc-members: + :show-inheritance: + +carepoint\.models\.cph\.fdb\_img\_mfg module +-------------------------------------------- + +.. automodule:: carepoint.models.cph.fdb_img_mfg + :members: + :undoc-members: + :show-inheritance: + +carepoint\.models\.cph\.fdb\_lbl\_rid module +-------------------------------------------- + +.. automodule:: carepoint.models.cph.fdb_lbl_rid + :members: + :undoc-members: + :show-inheritance: + +carepoint\.models\.cph\.fdb\_ndc module +--------------------------------------- + +.. automodule:: carepoint.models.cph.fdb_ndc + :members: + :undoc-members: + :show-inheritance: + +carepoint\.models\.cph\.fdb\_ndc\_cs\_ext module +------------------------------------------------ + +.. automodule:: carepoint.models.cph.fdb_ndc_cs_ext + :members: + :undoc-members: + :show-inheritance: + +carepoint\.models\.cph\.fdb\_pem\_moe module +-------------------------------------------- + +.. automodule:: carepoint.models.cph.fdb_pem_moe + :members: + :undoc-members: + :show-inheritance: + +carepoint\.models\.cph\.fdb\_pem\_mogc module +--------------------------------------------- + +.. automodule:: carepoint.models.cph.fdb_pem_mogc + :members: + :undoc-members: + :show-inheritance: + +carepoint\.models\.cph\.fdb\_price module +----------------------------------------- + +.. automodule:: carepoint.models.cph.fdb_price + :members: + :undoc-members: + :show-inheritance: + +carepoint\.models\.cph\.fdb\_price\_type module +----------------------------------------------- + +.. automodule:: carepoint.models.cph.fdb_price_type + :members: + :undoc-members: + :show-inheritance: + +carepoint\.models\.cph\.fdb\_route module +----------------------------------------- + +.. automodule:: carepoint.models.cph.fdb_route + :members: + :undoc-members: + :show-inheritance: + +carepoint\.models\.cph\.fdb\_unit module +---------------------------------------- + +.. automodule:: carepoint.models.cph.fdb_unit + :members: + :undoc-members: + :show-inheritance: + +carepoint\.models\.cph\.image\_data module +------------------------------------------ + +.. automodule:: carepoint.models.cph.image_data + :members: + :undoc-members: + :show-inheritance: + +carepoint\.models\.cph\.item module +----------------------------------- + +.. automodule:: carepoint.models.cph.item + :members: + :undoc-members: + :show-inheritance: + +carepoint\.models\.cph\.order module +------------------------------------ + +.. automodule:: carepoint.models.cph.order + :members: + :undoc-members: + :show-inheritance: + +carepoint\.models\.cph\.order\_line module +------------------------------------------ + +.. automodule:: carepoint.models.cph.order_line + :members: + :undoc-members: + :show-inheritance: + +carepoint\.models\.cph\.order\_line\_non\_rx module +--------------------------------------------------- + +.. automodule:: carepoint.models.cph.order_line_non_rx + :members: + :undoc-members: + :show-inheritance: + +carepoint\.models\.cph\.order\_ship module +------------------------------------------ + +.. automodule:: carepoint.models.cph.order_ship + :members: + :undoc-members: + :show-inheritance: + +carepoint\.models\.cph\.order\_status module +-------------------------------------------- + +.. automodule:: carepoint.models.cph.order_status + :members: + :undoc-members: + :show-inheritance: + +carepoint\.models\.cph\.organization module +------------------------------------------- + +.. automodule:: carepoint.models.cph.organization + :members: + :undoc-members: + :show-inheritance: + +carepoint\.models\.cph\.organization\_address module +---------------------------------------------------- + +.. automodule:: carepoint.models.cph.organization_address + :members: + :undoc-members: + :show-inheritance: + +carepoint\.models\.cph\.pathology module +---------------------------------------- + +.. automodule:: carepoint.models.cph.pathology + :members: + :undoc-members: + :show-inheritance: + +carepoint\.models\.cph\.pathology\_code\_type module +---------------------------------------------------- + +.. automodule:: carepoint.models.cph.pathology_code_type + :members: + :undoc-members: + :show-inheritance: + +carepoint\.models\.cph\.patient module +-------------------------------------- + +.. automodule:: carepoint.models.cph.patient + :members: + :undoc-members: + :show-inheritance: + +carepoint\.models\.cph\.patient\_address module +----------------------------------------------- + +.. automodule:: carepoint.models.cph.patient_address + :members: + :undoc-members: + :show-inheritance: + +carepoint\.models\.cph\.patient\_allergy module +----------------------------------------------- + +.. automodule:: carepoint.models.cph.patient_allergy + :members: + :undoc-members: + :show-inheritance: + +carepoint\.models\.cph\.patient\_disease module +----------------------------------------------- + +.. automodule:: carepoint.models.cph.patient_disease + :members: + :undoc-members: + :show-inheritance: + +carepoint\.models\.cph\.patient\_phone module +--------------------------------------------- + +.. automodule:: carepoint.models.cph.patient_phone + :members: + :undoc-members: + :show-inheritance: + +carepoint\.models\.cph\.phone module +------------------------------------ + +.. automodule:: carepoint.models.cph.phone + :members: + :undoc-members: + :show-inheritance: + +carepoint\.models\.cph\.prescription module +------------------------------------------- + +.. automodule:: carepoint.models.cph.prescription + :members: + :undoc-members: + :show-inheritance: + +carepoint\.models\.cph\.store module +------------------------------------ + +.. automodule:: carepoint.models.cph.store + :members: + :undoc-members: + :show-inheritance: + +carepoint\.models\.cph\.store\_address module +--------------------------------------------- + +.. automodule:: carepoint.models.cph.store_address + :members: + :undoc-members: + :show-inheritance: + +carepoint\.models\.cph\.store\_param module +------------------------------------------- + +.. automodule:: carepoint.models.cph.store_param + :members: + :undoc-members: + :show-inheritance: + +carepoint\.models\.cph\.store\_phone module +------------------------------------------- + +.. automodule:: carepoint.models.cph.store_phone + :members: + :undoc-members: + :show-inheritance: + +carepoint\.models\.cph\.user module +----------------------------------- + +.. automodule:: carepoint.models.cph.user + :members: + :undoc-members: + :show-inheritance: + +carepoint\.models\.cph\.vendor module +------------------------------------- + +.. automodule:: carepoint.models.cph.vendor + :members: + :undoc-members: + :show-inheritance: + + +Module contents +--------------- + +.. automodule:: carepoint.models.cph + :members: + :undoc-members: + :show-inheritance: diff --git a/_sources/carepoint.models.rst.txt b/_sources/carepoint.models.rst.txt new file mode 100644 index 0000000..8a6492e --- /dev/null +++ b/_sources/carepoint.models.rst.txt @@ -0,0 +1,45 @@ +carepoint\.models package +========================= + +Subpackages +----------- + +.. toctree:: + + carepoint.models.cph + +Submodules +---------- + +carepoint\.models\.address\_mixin module +---------------------------------------- + +.. automodule:: carepoint.models.address_mixin + :members: + :undoc-members: + :show-inheritance: + +carepoint\.models\.phone\_mixin module +-------------------------------------- + +.. automodule:: carepoint.models.phone_mixin + :members: + :undoc-members: + :show-inheritance: + +carepoint\.models\.state module +------------------------------- + +.. automodule:: carepoint.models.state + :members: + :undoc-members: + :show-inheritance: + + +Module contents +--------------- + +.. automodule:: carepoint.models + :members: + :undoc-members: + :show-inheritance: diff --git a/_sources/carepoint.rst.txt b/_sources/carepoint.rst.txt new file mode 100644 index 0000000..c7fb9ba --- /dev/null +++ b/_sources/carepoint.rst.txt @@ -0,0 +1,19 @@ +carepoint package +================= + +Subpackages +----------- + +.. toctree:: + + carepoint.db + carepoint.models + carepoint.tests + +Module contents +--------------- + +.. automodule:: carepoint + :members: + :undoc-members: + :show-inheritance: diff --git a/_sources/carepoint.tests.db.rst.txt b/_sources/carepoint.tests.db.rst.txt new file mode 100644 index 0000000..2512832 --- /dev/null +++ b/_sources/carepoint.tests.db.rst.txt @@ -0,0 +1,45 @@ +carepoint\.tests\.db package +============================ + +Subpackages +----------- + +.. toctree:: + + carepoint.tests.db.test_models + +Submodules +---------- + +carepoint\.tests\.db\.db module +------------------------------- + +.. automodule:: carepoint.tests.db.db + :members: + :undoc-members: + :show-inheritance: + +carepoint\.tests\.db\.test\_carepoint module +-------------------------------------------- + +.. automodule:: carepoint.tests.db.test_carepoint + :members: + :undoc-members: + :show-inheritance: + +carepoint\.tests\.db\.test\_db module +------------------------------------- + +.. automodule:: carepoint.tests.db.test_db + :members: + :undoc-members: + :show-inheritance: + + +Module contents +--------------- + +.. automodule:: carepoint.tests.db + :members: + :undoc-members: + :show-inheritance: diff --git a/_sources/carepoint.tests.db.test_models.rst.txt b/_sources/carepoint.tests.db.test_models.rst.txt new file mode 100644 index 0000000..99ec042 --- /dev/null +++ b/_sources/carepoint.tests.db.test_models.rst.txt @@ -0,0 +1,22 @@ +carepoint\.tests\.db\.test\_models package +========================================== + +Submodules +---------- + +carepoint\.tests\.db\.test\_models\.test\_model module +------------------------------------------------------ + +.. automodule:: carepoint.tests.db.test_models.test_model + :members: + :undoc-members: + :show-inheritance: + + +Module contents +--------------- + +.. automodule:: carepoint.tests.db.test_models + :members: + :undoc-members: + :show-inheritance: diff --git a/_sources/carepoint.tests.models.cph.fixtures.rst.txt b/_sources/carepoint.tests.models.cph.fixtures.rst.txt new file mode 100644 index 0000000..b5eb648 --- /dev/null +++ b/_sources/carepoint.tests.models.cph.fixtures.rst.txt @@ -0,0 +1,142 @@ +carepoint\.tests\.models\.cph\.fixtures package +=============================================== + +Submodules +---------- + +carepoint\.tests\.models\.cph\.fixtures\.address module +------------------------------------------------------- + +.. automodule:: carepoint.tests.models.cph.fixtures.address + :members: + :undoc-members: + :show-inheritance: + +carepoint\.tests\.models\.cph\.fixtures\.dispense module +-------------------------------------------------------- + +.. automodule:: carepoint.tests.models.cph.fixtures.dispense + :members: + :undoc-members: + :show-inheritance: + +carepoint\.tests\.models\.cph\.fixtures\.doctor module +------------------------------------------------------ + +.. automodule:: carepoint.tests.models.cph.fixtures.doctor + :members: + :undoc-members: + :show-inheritance: + +carepoint\.tests\.models\.cph\.fixtures\.fdb\_form module +--------------------------------------------------------- + +.. automodule:: carepoint.tests.models.cph.fixtures.fdb_form + :members: + :undoc-members: + :show-inheritance: + +carepoint\.tests\.models\.cph\.fixtures\.fdb\_gcn module +-------------------------------------------------------- + +.. automodule:: carepoint.tests.models.cph.fixtures.fdb_gcn + :members: + :undoc-members: + :show-inheritance: + +carepoint\.tests\.models\.cph\.fixtures\.fdb\_gcn\_seq module +------------------------------------------------------------- + +.. automodule:: carepoint.tests.models.cph.fixtures.fdb_gcn_seq + :members: + :undoc-members: + :show-inheritance: + +carepoint\.tests\.models\.cph\.fixtures\.fdb\_lbl\_rid module +------------------------------------------------------------- + +.. automodule:: carepoint.tests.models.cph.fixtures.fdb_lbl_rid + :members: + :undoc-members: + :show-inheritance: + +carepoint\.tests\.models\.cph\.fixtures\.fdb\_ndc module +-------------------------------------------------------- + +.. automodule:: carepoint.tests.models.cph.fixtures.fdb_ndc + :members: + :undoc-members: + :show-inheritance: + +carepoint\.tests\.models\.cph\.fixtures\.fdb\_ndc\_cs\_ext module +----------------------------------------------------------------- + +.. automodule:: carepoint.tests.models.cph.fixtures.fdb_ndc_cs_ext + :members: + :undoc-members: + :show-inheritance: + +carepoint\.tests\.models\.cph\.fixtures\.fdb\_route module +---------------------------------------------------------- + +.. automodule:: carepoint.tests.models.cph.fixtures.fdb_route + :members: + :undoc-members: + :show-inheritance: + +carepoint\.tests\.models\.cph\.fixtures\.item module +---------------------------------------------------- + +.. automodule:: carepoint.tests.models.cph.fixtures.item + :members: + :undoc-members: + :show-inheritance: + +carepoint\.tests\.models\.cph\.fixtures\.patient module +------------------------------------------------------- + +.. automodule:: carepoint.tests.models.cph.fixtures.patient + :members: + :undoc-members: + :show-inheritance: + +carepoint\.tests\.models\.cph\.fixtures\.prescription module +------------------------------------------------------------ + +.. automodule:: carepoint.tests.models.cph.fixtures.prescription + :members: + :undoc-members: + :show-inheritance: + +carepoint\.tests\.models\.cph\.fixtures\.store module +----------------------------------------------------- + +.. automodule:: carepoint.tests.models.cph.fixtures.store + :members: + :undoc-members: + :show-inheritance: + +carepoint\.tests\.models\.cph\.fixtures\.store\_param module +------------------------------------------------------------ + +.. automodule:: carepoint.tests.models.cph.fixtures.store_param + :members: + :undoc-members: + :show-inheritance: + +carepoint\.tests\.models\.cph\.fixtures\.user module +---------------------------------------------------- + +.. automodule:: carepoint.tests.models.cph.fixtures.user + :members: + :undoc-members: + :show-inheritance: + + +Module contents +--------------- + +.. automodule:: carepoint.tests.models.cph.fixtures + :members: + :undoc-members: + :show-inheritance: diff --git a/_sources/carepoint.tests.models.cph.rst.txt b/_sources/carepoint.tests.models.cph.rst.txt new file mode 100644 index 0000000..6b56506 --- /dev/null +++ b/_sources/carepoint.tests.models.cph.rst.txt @@ -0,0 +1,461 @@ +carepoint\.tests\.models\.cph package +===================================== + +Subpackages +----------- + +.. toctree:: + + carepoint.tests.models.cph.fixtures + +Submodules +---------- + +carepoint\.tests\.models\.cph\.test\_account module +--------------------------------------------------- + +.. automodule:: carepoint.tests.models.cph.test_account + :members: + :undoc-members: + :show-inheritance: + +carepoint\.tests\.models\.cph\.test\_account\_activity module +------------------------------------------------------------- + +.. automodule:: carepoint.tests.models.cph.test_account_activity + :members: + :undoc-members: + :show-inheritance: + +carepoint\.tests\.models\.cph\.test\_address module +--------------------------------------------------- + +.. automodule:: carepoint.tests.models.cph.test_address + :members: + :undoc-members: + :show-inheritance: + +carepoint\.tests\.models\.cph\.test\_dispense module +---------------------------------------------------- + +.. automodule:: carepoint.tests.models.cph.test_dispense + :members: + :undoc-members: + :show-inheritance: + +carepoint\.tests\.models\.cph\.test\_dispense\_price module +----------------------------------------------------------- + +.. automodule:: carepoint.tests.models.cph.test_dispense_price + :members: + :undoc-members: + :show-inheritance: + +carepoint\.tests\.models\.cph\.test\_doctor module +-------------------------------------------------- + +.. automodule:: carepoint.tests.models.cph.test_doctor + :members: + :undoc-members: + :show-inheritance: + +carepoint\.tests\.models\.cph\.test\_doctor\_address module +----------------------------------------------------------- + +.. automodule:: carepoint.tests.models.cph.test_doctor_address + :members: + :undoc-members: + :show-inheritance: + +carepoint\.tests\.models\.cph\.test\_doctor\_phone module +--------------------------------------------------------- + +.. automodule:: carepoint.tests.models.cph.test_doctor_phone + :members: + :undoc-members: + :show-inheritance: + +carepoint\.tests\.models\.cph\.test\_fdb\_allergen module +--------------------------------------------------------- + +.. automodule:: carepoint.tests.models.cph.test_fdb_allergen + :members: + :undoc-members: + :show-inheritance: + +carepoint\.tests\.models\.cph\.test\_fdb\_allergen\_desc module +--------------------------------------------------------------- + +.. automodule:: carepoint.tests.models.cph.test_fdb_allergen_desc + :members: + :undoc-members: + :show-inheritance: + +carepoint\.tests\.models\.cph\.test\_fdb\_allergen\_group module +---------------------------------------------------------------- + +.. automodule:: carepoint.tests.models.cph.test_fdb_allergen_group + :members: + :undoc-members: + :show-inheritance: + +carepoint\.tests\.models\.cph\.test\_fdb\_allergen\_rel module +-------------------------------------------------------------- + +.. automodule:: carepoint.tests.models.cph.test_fdb_allergen_rel + :members: + :undoc-members: + :show-inheritance: + +carepoint\.tests\.models\.cph\.test\_fdb\_attr module +----------------------------------------------------- + +.. automodule:: carepoint.tests.models.cph.test_fdb_attr + :members: + :undoc-members: + :show-inheritance: + +carepoint\.tests\.models\.cph\.test\_fdb\_attr\_base module +----------------------------------------------------------- + +.. automodule:: carepoint.tests.models.cph.test_fdb_attr_base + :members: + :undoc-members: + :show-inheritance: + +carepoint\.tests\.models\.cph\.test\_fdb\_attr\_type module +----------------------------------------------------------- + +.. automodule:: carepoint.tests.models.cph.test_fdb_attr_type + :members: + :undoc-members: + :show-inheritance: + +carepoint\.tests\.models\.cph\.test\_fdb\_form module +----------------------------------------------------- + +.. automodule:: carepoint.tests.models.cph.test_fdb_form + :members: + :undoc-members: + :show-inheritance: + +carepoint\.tests\.models\.cph\.test\_fdb\_gcn module +---------------------------------------------------- + +.. automodule:: carepoint.tests.models.cph.test_fdb_gcn + :members: + :undoc-members: + :show-inheritance: + +carepoint\.tests\.models\.cph\.test\_fdb\_gcn\_seq module +--------------------------------------------------------- + +.. automodule:: carepoint.tests.models.cph.test_fdb_gcn_seq + :members: + :undoc-members: + :show-inheritance: + +carepoint\.tests\.models\.cph\.test\_fdb\_img module +---------------------------------------------------- + +.. automodule:: carepoint.tests.models.cph.test_fdb_img + :members: + :undoc-members: + :show-inheritance: + +carepoint\.tests\.models\.cph\.test\_fdb\_img\_date module +---------------------------------------------------------- + +.. automodule:: carepoint.tests.models.cph.test_fdb_img_date + :members: + :undoc-members: + :show-inheritance: + +carepoint\.tests\.models\.cph\.test\_fdb\_img\_id module +-------------------------------------------------------- + +.. automodule:: carepoint.tests.models.cph.test_fdb_img_id + :members: + :undoc-members: + :show-inheritance: + +carepoint\.tests\.models\.cph\.test\_fdb\_img\_mfg module +--------------------------------------------------------- + +.. automodule:: carepoint.tests.models.cph.test_fdb_img_mfg + :members: + :undoc-members: + :show-inheritance: + +carepoint\.tests\.models\.cph\.test\_fdb\_lbl\_rid module +--------------------------------------------------------- + +.. automodule:: carepoint.tests.models.cph.test_fdb_lbl_rid + :members: + :undoc-members: + :show-inheritance: + +carepoint\.tests\.models\.cph\.test\_fdb\_ndc module +---------------------------------------------------- + +.. automodule:: carepoint.tests.models.cph.test_fdb_ndc + :members: + :undoc-members: + :show-inheritance: + +carepoint\.tests\.models\.cph\.test\_fdb\_ndc\_cs\_ext module +------------------------------------------------------------- + +.. automodule:: carepoint.tests.models.cph.test_fdb_ndc_cs_ext + :members: + :undoc-members: + :show-inheritance: + +carepoint\.tests\.models\.cph\.test\_fdb\_pem\_moe module +--------------------------------------------------------- + +.. automodule:: carepoint.tests.models.cph.test_fdb_pem_moe + :members: + :undoc-members: + :show-inheritance: + +carepoint\.tests\.models\.cph\.test\_fdb\_pem\_mogc module +---------------------------------------------------------- + +.. automodule:: carepoint.tests.models.cph.test_fdb_pem_mogc + :members: + :undoc-members: + :show-inheritance: + +carepoint\.tests\.models\.cph\.test\_fdb\_price module +------------------------------------------------------ + +.. automodule:: carepoint.tests.models.cph.test_fdb_price + :members: + :undoc-members: + :show-inheritance: + +carepoint\.tests\.models\.cph\.test\_fdb\_price\_type module +------------------------------------------------------------ + +.. automodule:: carepoint.tests.models.cph.test_fdb_price_type + :members: + :undoc-members: + :show-inheritance: + +carepoint\.tests\.models\.cph\.test\_fdb\_route module +------------------------------------------------------ + +.. automodule:: carepoint.tests.models.cph.test_fdb_route + :members: + :undoc-members: + :show-inheritance: + +carepoint\.tests\.models\.cph\.test\_fdb\_unit module +----------------------------------------------------- + +.. automodule:: carepoint.tests.models.cph.test_fdb_unit + :members: + :undoc-members: + :show-inheritance: + +carepoint\.tests\.models\.cph\.test\_image\_data module +------------------------------------------------------- + +.. automodule:: carepoint.tests.models.cph.test_image_data + :members: + :undoc-members: + :show-inheritance: + +carepoint\.tests\.models\.cph\.test\_item module +------------------------------------------------ + +.. automodule:: carepoint.tests.models.cph.test_item + :members: + :undoc-members: + :show-inheritance: + +carepoint\.tests\.models\.cph\.test\_order module +------------------------------------------------- + +.. automodule:: carepoint.tests.models.cph.test_order + :members: + :undoc-members: + :show-inheritance: + +carepoint\.tests\.models\.cph\.test\_order\_line module +------------------------------------------------------- + +.. automodule:: carepoint.tests.models.cph.test_order_line + :members: + :undoc-members: + :show-inheritance: + +carepoint\.tests\.models\.cph\.test\_order\_line\_non\_rx module +---------------------------------------------------------------- + +.. automodule:: carepoint.tests.models.cph.test_order_line_non_rx + :members: + :undoc-members: + :show-inheritance: + +carepoint\.tests\.models\.cph\.test\_order\_ship module +------------------------------------------------------- + +.. automodule:: carepoint.tests.models.cph.test_order_ship + :members: + :undoc-members: + :show-inheritance: + +carepoint\.tests\.models\.cph\.test\_order\_status module +--------------------------------------------------------- + +.. automodule:: carepoint.tests.models.cph.test_order_status + :members: + :undoc-members: + :show-inheritance: + +carepoint\.tests\.models\.cph\.test\_organization module +-------------------------------------------------------- + +.. automodule:: carepoint.tests.models.cph.test_organization + :members: + :undoc-members: + :show-inheritance: + +carepoint\.tests\.models\.cph\.test\_organization\_address module +----------------------------------------------------------------- + +.. automodule:: carepoint.tests.models.cph.test_organization_address + :members: + :undoc-members: + :show-inheritance: + +carepoint\.tests\.models\.cph\.test\_pathology module +----------------------------------------------------- + +.. automodule:: carepoint.tests.models.cph.test_pathology + :members: + :undoc-members: + :show-inheritance: + +carepoint\.tests\.models\.cph\.test\_pathology\_code\_type module +----------------------------------------------------------------- + +.. automodule:: carepoint.tests.models.cph.test_pathology_code_type + :members: + :undoc-members: + :show-inheritance: + +carepoint\.tests\.models\.cph\.test\_patient module +--------------------------------------------------- + +.. automodule:: carepoint.tests.models.cph.test_patient + :members: + :undoc-members: + :show-inheritance: + +carepoint\.tests\.models\.cph\.test\_patient\_address module +------------------------------------------------------------ + +.. automodule:: carepoint.tests.models.cph.test_patient_address + :members: + :undoc-members: + :show-inheritance: + +carepoint\.tests\.models\.cph\.test\_patient\_allergy module +------------------------------------------------------------ + +.. automodule:: carepoint.tests.models.cph.test_patient_allergy + :members: + :undoc-members: + :show-inheritance: + +carepoint\.tests\.models\.cph\.test\_patient\_disease module +------------------------------------------------------------ + +.. automodule:: carepoint.tests.models.cph.test_patient_disease + :members: + :undoc-members: + :show-inheritance: + +carepoint\.tests\.models\.cph\.test\_patient\_phone module +---------------------------------------------------------- + +.. automodule:: carepoint.tests.models.cph.test_patient_phone + :members: + :undoc-members: + :show-inheritance: + +carepoint\.tests\.models\.cph\.test\_phone module +------------------------------------------------- + +.. automodule:: carepoint.tests.models.cph.test_phone + :members: + :undoc-members: + :show-inheritance: + +carepoint\.tests\.models\.cph\.test\_prescription module +-------------------------------------------------------- + +.. automodule:: carepoint.tests.models.cph.test_prescription + :members: + :undoc-members: + :show-inheritance: + +carepoint\.tests\.models\.cph\.test\_store module +------------------------------------------------- + +.. automodule:: carepoint.tests.models.cph.test_store + :members: + :undoc-members: + :show-inheritance: + +carepoint\.tests\.models\.cph\.test\_store\_address module +---------------------------------------------------------- + +.. automodule:: carepoint.tests.models.cph.test_store_address + :members: + :undoc-members: + :show-inheritance: + +carepoint\.tests\.models\.cph\.test\_store\_param module +-------------------------------------------------------- + +.. automodule:: carepoint.tests.models.cph.test_store_param + :members: + :undoc-members: + :show-inheritance: + +carepoint\.tests\.models\.cph\.test\_store\_phone module +-------------------------------------------------------- + +.. automodule:: carepoint.tests.models.cph.test_store_phone + :members: + :undoc-members: + :show-inheritance: + +carepoint\.tests\.models\.cph\.test\_user module +------------------------------------------------ + +.. automodule:: carepoint.tests.models.cph.test_user + :members: + :undoc-members: + :show-inheritance: + +carepoint\.tests\.models\.cph\.test\_vendor module +-------------------------------------------------- + +.. automodule:: carepoint.tests.models.cph.test_vendor + :members: + :undoc-members: + :show-inheritance: + + +Module contents +--------------- + +.. automodule:: carepoint.tests.models.cph + :members: + :undoc-members: + :show-inheritance: diff --git a/_sources/carepoint.tests.models.rst.txt b/_sources/carepoint.tests.models.rst.txt new file mode 100644 index 0000000..0715114 --- /dev/null +++ b/_sources/carepoint.tests.models.rst.txt @@ -0,0 +1,37 @@ +carepoint\.tests\.models package +================================ + +Subpackages +----------- + +.. toctree:: + + carepoint.tests.models.cph + +Submodules +---------- + +carepoint\.tests\.models\.test\_address\_mixin module +----------------------------------------------------- + +.. automodule:: carepoint.tests.models.test_address_mixin + :members: + :undoc-members: + :show-inheritance: + +carepoint\.tests\.models\.test\_phone\_mixin module +--------------------------------------------------- + +.. automodule:: carepoint.tests.models.test_phone_mixin + :members: + :undoc-members: + :show-inheritance: + + +Module contents +--------------- + +.. automodule:: carepoint.tests.models + :members: + :undoc-members: + :show-inheritance: diff --git a/_sources/carepoint.tests.rst.txt b/_sources/carepoint.tests.rst.txt new file mode 100644 index 0000000..3fe9bdb --- /dev/null +++ b/_sources/carepoint.tests.rst.txt @@ -0,0 +1,18 @@ +carepoint\.tests package +======================== + +Subpackages +----------- + +.. toctree:: + + carepoint.tests.db + carepoint.tests.models + +Module contents +--------------- + +.. automodule:: carepoint.tests + :members: + :undoc-members: + :show-inheritance: diff --git a/_sources/index.rst.txt b/_sources/index.rst.txt new file mode 100644 index 0000000..53a8f3e --- /dev/null +++ b/_sources/index.rst.txt @@ -0,0 +1,22 @@ +.. python-carepoint documentation master file, created by + sphinx-quickstart on Thu Sep 7 17:14:59 2017. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Welcome to python-carepoint's documentation! +============================================ + +.. toctree:: + :maxdepth: 4 + :caption: Contents: + + carepoint + setup + + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` diff --git a/_sources/setup.rst.txt b/_sources/setup.rst.txt new file mode 100644 index 0000000..31789b1 --- /dev/null +++ b/_sources/setup.rst.txt @@ -0,0 +1,7 @@ +setup module +============ + +.. automodule:: setup + :members: + :undoc-members: + :show-inheritance: diff --git a/_static/ajax-loader.gif b/_static/ajax-loader.gif new file mode 100644 index 0000000..61faf8c Binary files /dev/null and b/_static/ajax-loader.gif differ diff --git a/_static/alabaster.css b/_static/alabaster.css new file mode 100644 index 0000000..be65b13 --- /dev/null +++ b/_static/alabaster.css @@ -0,0 +1,693 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@import url("basic.css"); + +/* -- page layout ----------------------------------------------------------- */ + +body { + font-family: 'goudy old style', 'minion pro', 'bell mt', Georgia, 'Hiragino Mincho Pro', serif; + font-size: 17px; + background-color: #fff; + color: #000; + margin: 0; + padding: 0; +} + + +div.document { + width: 940px; + margin: 30px auto 0 auto; +} + +div.documentwrapper { + float: left; + width: 100%; +} + +div.bodywrapper { + margin: 0 0 0 220px; +} + +div.sphinxsidebar { + width: 220px; + font-size: 14px; + line-height: 1.5; +} + +hr { + border: 1px solid #B1B4B6; +} + +div.body { + background-color: #fff; + color: #3E4349; + padding: 0 30px 0 30px; +} + +div.body > .section { + text-align: left; +} + +div.footer { + width: 940px; + margin: 20px auto 30px auto; + font-size: 14px; + color: #888; + text-align: right; +} + +div.footer a { + color: #888; +} + +p.caption { + font-family: inherit; + font-size: inherit; +} + + +div.relations { + display: none; +} + + +div.sphinxsidebar a { + color: #444; + text-decoration: none; + border-bottom: 1px dotted #999; +} + +div.sphinxsidebar a:hover { + border-bottom: 1px solid #999; +} + +div.sphinxsidebarwrapper { + padding: 18px 10px; +} + +div.sphinxsidebarwrapper p.logo { + padding: 0; + margin: -10px 0 0 0px; + text-align: center; +} + +div.sphinxsidebarwrapper h1.logo { + margin-top: -10px; + text-align: center; + margin-bottom: 5px; + text-align: left; +} + +div.sphinxsidebarwrapper h1.logo-name { + margin-top: 0px; +} + +div.sphinxsidebarwrapper p.blurb { + margin-top: 0; + font-style: normal; +} + +div.sphinxsidebar h3, +div.sphinxsidebar h4 { + font-family: 'Garamond', 'Georgia', serif; + color: #444; + font-size: 24px; + font-weight: normal; + margin: 0 0 5px 0; + padding: 0; +} + +div.sphinxsidebar h4 { + font-size: 20px; +} + +div.sphinxsidebar h3 a { + color: #444; +} + +div.sphinxsidebar p.logo a, +div.sphinxsidebar h3 a, +div.sphinxsidebar p.logo a:hover, +div.sphinxsidebar h3 a:hover { + border: none; +} + +div.sphinxsidebar p { + color: #555; + margin: 10px 0; +} + +div.sphinxsidebar ul { + margin: 10px 0; + padding: 0; + color: #000; +} + +div.sphinxsidebar ul li.toctree-l1 > a { + font-size: 120%; +} + +div.sphinxsidebar ul li.toctree-l2 > a { + font-size: 110%; +} + +div.sphinxsidebar input { + border: 1px solid #CCC; + font-family: 'goudy old style', 'minion pro', 'bell mt', Georgia, 'Hiragino Mincho Pro', serif; + font-size: 1em; +} + +div.sphinxsidebar hr { + border: none; + height: 1px; + color: #AAA; + background: #AAA; + + text-align: left; + margin-left: 0; + width: 50%; +} + +/* -- body styles ----------------------------------------------------------- */ + +a { + color: #004B6B; + text-decoration: underline; +} + +a:hover { + color: #6D4100; + text-decoration: underline; +} + +div.body h1, +div.body h2, +div.body h3, +div.body h4, +div.body h5, +div.body h6 { + font-family: 'Garamond', 'Georgia', serif; + font-weight: normal; + margin: 30px 0px 10px 0px; + padding: 0; +} + +div.body h1 { margin-top: 0; padding-top: 0; font-size: 240%; } +div.body h2 { font-size: 180%; } +div.body h3 { font-size: 150%; } +div.body h4 { font-size: 130%; } +div.body h5 { font-size: 100%; } +div.body h6 { font-size: 100%; } + +a.headerlink { + color: #DDD; + padding: 0 4px; + text-decoration: none; +} + +a.headerlink:hover { + color: #444; + background: #EAEAEA; +} + +div.body p, div.body dd, div.body li { + line-height: 1.4em; +} + +div.admonition { + margin: 20px 0px; + padding: 10px 30px; + background-color: #EEE; + border: 1px solid #CCC; +} + +div.admonition tt.xref, div.admonition code.xref, div.admonition a tt { + background-color: #FBFBFB; + border-bottom: 1px solid #fafafa; +} + +div.admonition p.admonition-title { + font-family: 'Garamond', 'Georgia', serif; + font-weight: normal; + font-size: 24px; + margin: 0 0 10px 0; + padding: 0; + line-height: 1; +} + +div.admonition p.last { + margin-bottom: 0; +} + +div.highlight { + background-color: #fff; +} + +dt:target, .highlight { + background: #FAF3E8; +} + +div.warning { + background-color: #FCC; + border: 1px solid #FAA; +} + +div.danger { + background-color: #FCC; + border: 1px solid #FAA; + -moz-box-shadow: 2px 2px 4px #D52C2C; + -webkit-box-shadow: 2px 2px 4px #D52C2C; + box-shadow: 2px 2px 4px #D52C2C; +} + +div.error { + background-color: #FCC; + border: 1px solid #FAA; + -moz-box-shadow: 2px 2px 4px #D52C2C; + -webkit-box-shadow: 2px 2px 4px #D52C2C; + box-shadow: 2px 2px 4px #D52C2C; +} + +div.caution { + background-color: #FCC; + border: 1px solid #FAA; +} + +div.attention { + background-color: #FCC; + border: 1px solid #FAA; +} + +div.important { + background-color: #EEE; + border: 1px solid #CCC; +} + +div.note { + background-color: #EEE; + border: 1px solid #CCC; +} + +div.tip { + background-color: #EEE; + border: 1px solid #CCC; +} + +div.hint { + background-color: #EEE; + border: 1px solid #CCC; +} + +div.seealso { + background-color: #EEE; + border: 1px solid #CCC; +} + +div.topic { + background-color: #EEE; +} + +p.admonition-title { + display: inline; +} + +p.admonition-title:after { + content: ":"; +} + +pre, tt, code { + font-family: 'Consolas', 'Menlo', 'Deja Vu Sans Mono', 'Bitstream Vera Sans Mono', monospace; + font-size: 0.9em; +} + +.hll { + background-color: #FFC; + margin: 0 -12px; + padding: 0 12px; + display: block; +} + +img.screenshot { +} + +tt.descname, tt.descclassname, code.descname, code.descclassname { + font-size: 0.95em; +} + +tt.descname, code.descname { + padding-right: 0.08em; +} + +img.screenshot { + -moz-box-shadow: 2px 2px 4px #EEE; + -webkit-box-shadow: 2px 2px 4px #EEE; + box-shadow: 2px 2px 4px #EEE; +} + +table.docutils { + border: 1px solid #888; + -moz-box-shadow: 2px 2px 4px #EEE; + -webkit-box-shadow: 2px 2px 4px #EEE; + box-shadow: 2px 2px 4px #EEE; +} + +table.docutils td, table.docutils th { + border: 1px solid #888; + padding: 0.25em 0.7em; +} + +table.field-list, table.footnote { + border: none; + -moz-box-shadow: none; + -webkit-box-shadow: none; + box-shadow: none; +} + +table.footnote { + margin: 15px 0; + width: 100%; + border: 1px solid #EEE; + background: #FDFDFD; + font-size: 0.9em; +} + +table.footnote + table.footnote { + margin-top: -15px; + border-top: none; +} + +table.field-list th { + padding: 0 0.8em 0 0; +} + +table.field-list td { + padding: 0; +} + +table.field-list p { + margin-bottom: 0.8em; +} + +/* Cloned from + * https://github.com/sphinx-doc/sphinx/commit/ef60dbfce09286b20b7385333d63a60321784e68 + */ +.field-name { + -moz-hyphens: manual; + -ms-hyphens: manual; + -webkit-hyphens: manual; + hyphens: manual; +} + +table.footnote td.label { + width: .1px; + padding: 0.3em 0 0.3em 0.5em; +} + +table.footnote td { + padding: 0.3em 0.5em; +} + +dl { + margin: 0; + padding: 0; +} + +dl dd { + margin-left: 30px; +} + +blockquote { + margin: 0 0 0 30px; + padding: 0; +} + +ul, ol { + /* Matches the 30px from the narrow-screen "li > ul" selector below */ + margin: 10px 0 10px 30px; + padding: 0; +} + +pre { + background: #EEE; + padding: 7px 30px; + margin: 15px 0px; + line-height: 1.3em; +} + +div.viewcode-block:target { + background: #ffd; +} + +dl pre, blockquote pre, li pre { + margin-left: 0; + padding-left: 30px; +} + +tt, code { + background-color: #ecf0f3; + color: #222; + /* padding: 1px 2px; */ +} + +tt.xref, code.xref, a tt { + background-color: #FBFBFB; + border-bottom: 1px solid #fff; +} + +a.reference { + text-decoration: none; + border-bottom: 1px dotted #004B6B; +} + +/* Don't put an underline on images */ +a.image-reference, a.image-reference:hover { + border-bottom: none; +} + +a.reference:hover { + border-bottom: 1px solid #6D4100; +} + +a.footnote-reference { + text-decoration: none; + font-size: 0.7em; + vertical-align: top; + border-bottom: 1px dotted #004B6B; +} + +a.footnote-reference:hover { + border-bottom: 1px solid #6D4100; +} + +a:hover tt, a:hover code { + background: #EEE; +} + + +@media screen and (max-width: 870px) { + + div.sphinxsidebar { + display: none; + } + + div.document { + width: 100%; + + } + + div.documentwrapper { + margin-left: 0; + margin-top: 0; + margin-right: 0; + margin-bottom: 0; + } + + div.bodywrapper { + margin-top: 0; + margin-right: 0; + margin-bottom: 0; + margin-left: 0; + } + + ul { + margin-left: 0; + } + + li > ul { + /* Matches the 30px from the "ul, ol" selector above */ + margin-left: 30px; + } + + .document { + width: auto; + } + + .footer { + width: auto; + } + + .bodywrapper { + margin: 0; + } + + .footer { + width: auto; + } + + .github { + display: none; + } + + + +} + + + +@media screen and (max-width: 875px) { + + body { + margin: 0; + padding: 20px 30px; + } + + div.documentwrapper { + float: none; + background: #fff; + } + + div.sphinxsidebar { + display: block; + float: none; + width: 102.5%; + margin: 50px -30px -20px -30px; + padding: 10px 20px; + background: #333; + color: #FFF; + } + + div.sphinxsidebar h3, div.sphinxsidebar h4, div.sphinxsidebar p, + div.sphinxsidebar h3 a { + color: #fff; + } + + div.sphinxsidebar a { + color: #AAA; + } + + div.sphinxsidebar p.logo { + display: none; + } + + div.document { + width: 100%; + margin: 0; + } + + div.footer { + display: none; + } + + div.bodywrapper { + margin: 0; + } + + div.body { + min-height: 0; + padding: 0; + } + + .rtd_doc_footer { + display: none; + } + + .document { + width: auto; + } + + .footer { + width: auto; + } + + .footer { + width: auto; + } + + .github { + display: none; + } +} + + +/* misc. */ + +.revsys-inline { + display: none!important; +} + +/* Make nested-list/multi-paragraph items look better in Releases changelog + * pages. Without this, docutils' magical list fuckery causes inconsistent + * formatting between different release sub-lists. + */ +div#changelog > div.section > ul > li > p:only-child { + margin-bottom: 0; +} + +/* Hide fugly table cell borders in ..bibliography:: directive output */ +table.docutils.citation, table.docutils.citation td, table.docutils.citation th { + border: none; + /* Below needed in some edge cases; if not applied, bottom shadows appear */ + -moz-box-shadow: none; + -webkit-box-shadow: none; + box-shadow: none; +} \ No newline at end of file diff --git a/_static/basic.css b/_static/basic.css new file mode 100644 index 0000000..6df76b0 --- /dev/null +++ b/_static/basic.css @@ -0,0 +1,639 @@ +/* + * basic.css + * ~~~~~~~~~ + * + * Sphinx stylesheet -- basic theme. + * + * :copyright: Copyright 2007-2017 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ + +/* -- main layout ----------------------------------------------------------- */ + +div.clearer { + clear: both; +} + +/* -- relbar ---------------------------------------------------------------- */ + +div.related { + width: 100%; + font-size: 90%; +} + +div.related h3 { + display: none; +} + +div.related ul { + margin: 0; + padding: 0 0 0 10px; + list-style: none; +} + +div.related li { + display: inline; +} + +div.related li.right { + float: right; + margin-right: 5px; +} + +/* -- sidebar --------------------------------------------------------------- */ + +div.sphinxsidebarwrapper { + padding: 10px 5px 0 10px; +} + +div.sphinxsidebar { + float: left; + width: 230px; + margin-left: -100%; + font-size: 90%; + word-wrap: break-word; + overflow-wrap : break-word; +} + +div.sphinxsidebar ul { + list-style: none; +} + +div.sphinxsidebar ul ul, +div.sphinxsidebar ul.want-points { + margin-left: 20px; + list-style: square; +} + +div.sphinxsidebar ul ul { + margin-top: 0; + margin-bottom: 0; +} + +div.sphinxsidebar form { + margin-top: 10px; +} + +div.sphinxsidebar input { + border: 1px solid #98dbcc; + font-family: sans-serif; + font-size: 1em; +} + +div.sphinxsidebar #searchbox input[type="text"] { + width: 170px; +} + +img { + border: 0; + max-width: 100%; +} + +/* -- search page ----------------------------------------------------------- */ + +ul.search { + margin: 10px 0 0 20px; + padding: 0; +} + +ul.search li { + padding: 5px 0 5px 20px; + background-image: url(file.png); + background-repeat: no-repeat; + background-position: 0 7px; +} + +ul.search li a { + font-weight: bold; +} + +ul.search li div.context { + color: #888; + margin: 2px 0 0 30px; + text-align: left; +} + +ul.keywordmatches li.goodmatch a { + font-weight: bold; +} + +/* -- index page ------------------------------------------------------------ */ + +table.contentstable { + width: 90%; + margin-left: auto; + margin-right: auto; +} + +table.contentstable p.biglink { + line-height: 150%; +} + +a.biglink { + font-size: 1.3em; +} + +span.linkdescr { + font-style: italic; + padding-top: 5px; + font-size: 90%; +} + +/* -- general index --------------------------------------------------------- */ + +table.indextable { + width: 100%; +} + +table.indextable td { + text-align: left; + vertical-align: top; +} + +table.indextable ul { + margin-top: 0; + margin-bottom: 0; + list-style-type: none; +} + +table.indextable > tbody > tr > td > ul { + padding-left: 0em; +} + +table.indextable tr.pcap { + height: 10px; +} + +table.indextable tr.cap { + margin-top: 10px; + background-color: #f2f2f2; +} + +img.toggler { + margin-right: 3px; + margin-top: 3px; + cursor: pointer; +} + +div.modindex-jumpbox { + border-top: 1px solid #ddd; + border-bottom: 1px solid #ddd; + margin: 1em 0 1em 0; + padding: 0.4em; +} + +div.genindex-jumpbox { + border-top: 1px solid #ddd; + border-bottom: 1px solid #ddd; + margin: 1em 0 1em 0; + padding: 0.4em; +} + +/* -- domain module index --------------------------------------------------- */ + +table.modindextable td { + padding: 2px; + border-collapse: collapse; +} + +/* -- general body styles --------------------------------------------------- */ + +div.body p, div.body dd, div.body li, div.body blockquote { + -moz-hyphens: auto; + -ms-hyphens: auto; + -webkit-hyphens: auto; + hyphens: auto; +} + +a.headerlink { + visibility: hidden; +} + +h1:hover > a.headerlink, +h2:hover > a.headerlink, +h3:hover > a.headerlink, +h4:hover > a.headerlink, +h5:hover > a.headerlink, +h6:hover > a.headerlink, +dt:hover > a.headerlink, +caption:hover > a.headerlink, +p.caption:hover > a.headerlink, +div.code-block-caption:hover > a.headerlink { + visibility: visible; +} + +div.body p.caption { + text-align: inherit; +} + +div.body td { + text-align: left; +} + +.first { + margin-top: 0 !important; +} + +p.rubric { + margin-top: 30px; + font-weight: bold; +} + +img.align-left, .figure.align-left, object.align-left { + clear: left; + float: left; + margin-right: 1em; +} + +img.align-right, .figure.align-right, object.align-right { + clear: right; + float: right; + margin-left: 1em; +} + +img.align-center, .figure.align-center, object.align-center { + display: block; + margin-left: auto; + margin-right: auto; +} + +.align-left { + text-align: left; +} + +.align-center { + text-align: center; +} + +.align-right { + text-align: right; +} + +/* -- sidebars -------------------------------------------------------------- */ + +div.sidebar { + margin: 0 0 0.5em 1em; + border: 1px solid #ddb; + padding: 7px 7px 0 7px; + background-color: #ffe; + width: 40%; + float: right; +} + +p.sidebar-title { + font-weight: bold; +} + +/* -- topics ---------------------------------------------------------------- */ + +div.topic { + border: 1px solid #ccc; + padding: 7px 7px 0 7px; + margin: 10px 0 10px 0; +} + +p.topic-title { + font-size: 1.1em; + font-weight: bold; + margin-top: 10px; +} + +/* -- admonitions ----------------------------------------------------------- */ + +div.admonition { + margin-top: 10px; + margin-bottom: 10px; + padding: 7px; +} + +div.admonition dt { + font-weight: bold; +} + +div.admonition dl { + margin-bottom: 0; +} + +p.admonition-title { + margin: 0px 10px 5px 0px; + font-weight: bold; +} + +div.body p.centered { + text-align: center; + margin-top: 25px; +} + +/* -- tables ---------------------------------------------------------------- */ + +table.docutils { + border: 0; + border-collapse: collapse; +} + +table caption span.caption-number { + font-style: italic; +} + +table caption span.caption-text { +} + +table.docutils td, table.docutils th { + padding: 1px 8px 1px 5px; + border-top: 0; + border-left: 0; + border-right: 0; + border-bottom: 1px solid #aaa; +} + +table.footnote td, table.footnote th { + border: 0 !important; +} + +th { + text-align: left; + padding-right: 5px; +} + +table.citation { + border-left: solid 1px gray; + margin-left: 1px; +} + +table.citation td { + border-bottom: none; +} + +/* -- figures --------------------------------------------------------------- */ + +div.figure { + margin: 0.5em; + padding: 0.5em; +} + +div.figure p.caption { + padding: 0.3em; +} + +div.figure p.caption span.caption-number { + font-style: italic; +} + +div.figure p.caption span.caption-text { +} + +/* -- field list styles ----------------------------------------------------- */ + +table.field-list td, table.field-list th { + border: 0 !important; +} + +.field-list ul { + margin: 0; + padding-left: 1em; +} + +.field-list p { + margin: 0; +} + +.field-name { + -moz-hyphens: manual; + -ms-hyphens: manual; + -webkit-hyphens: manual; + hyphens: manual; +} + +/* -- other body styles ----------------------------------------------------- */ + +ol.arabic { + list-style: decimal; +} + +ol.loweralpha { + list-style: lower-alpha; +} + +ol.upperalpha { + list-style: upper-alpha; +} + +ol.lowerroman { + list-style: lower-roman; +} + +ol.upperroman { + list-style: upper-roman; +} + +dl { + margin-bottom: 15px; +} + +dd p { + margin-top: 0px; +} + +dd ul, dd table { + margin-bottom: 10px; +} + +dd { + margin-top: 3px; + margin-bottom: 10px; + margin-left: 30px; +} + +dt:target, .highlighted { + background-color: #fbe54e; +} + +dl.glossary dt { + font-weight: bold; + font-size: 1.1em; +} + +.optional { + font-size: 1.3em; +} + +.sig-paren { + font-size: larger; +} + +.versionmodified { + font-style: italic; +} + +.system-message { + background-color: #fda; + padding: 5px; + border: 3px solid red; +} + +.footnote:target { + background-color: #ffa; +} + +.line-block { + display: block; + margin-top: 1em; + margin-bottom: 1em; +} + +.line-block .line-block { + margin-top: 0; + margin-bottom: 0; + margin-left: 1.5em; +} + +.guilabel, .menuselection { + font-family: sans-serif; +} + +.accelerator { + text-decoration: underline; +} + +.classifier { + font-style: oblique; +} + +abbr, acronym { + border-bottom: dotted 1px; + cursor: help; +} + +/* -- code displays --------------------------------------------------------- */ + +pre { + overflow: auto; + overflow-y: hidden; /* fixes display issues on Chrome browsers */ +} + +span.pre { + -moz-hyphens: none; + -ms-hyphens: none; + -webkit-hyphens: none; + hyphens: none; +} + +td.linenos pre { + padding: 5px 0px; + border: 0; + background-color: transparent; + color: #aaa; +} + +table.highlighttable { + margin-left: 0.5em; +} + +table.highlighttable td { + padding: 0 0.5em 0 0.5em; +} + +div.code-block-caption { + padding: 2px 5px; + font-size: small; +} + +div.code-block-caption code { + background-color: transparent; +} + +div.code-block-caption + div > div.highlight > pre { + margin-top: 0; +} + +div.code-block-caption span.caption-number { + padding: 0.1em 0.3em; + font-style: italic; +} + +div.code-block-caption span.caption-text { +} + +div.literal-block-wrapper { + padding: 1em 1em 0; +} + +div.literal-block-wrapper div.highlight { + margin: 0; +} + +code.descname { + background-color: transparent; + font-weight: bold; + font-size: 1.2em; +} + +code.descclassname { + background-color: transparent; +} + +code.xref, a code { + background-color: transparent; + font-weight: bold; +} + +h1 code, h2 code, h3 code, h4 code, h5 code, h6 code { + background-color: transparent; +} + +.viewcode-link { + float: right; +} + +.viewcode-back { + float: right; + font-family: sans-serif; +} + +div.viewcode-block:target { + margin: -1px -10px; + padding: 0 10px; +} + +/* -- math display ---------------------------------------------------------- */ + +img.math { + vertical-align: middle; +} + +div.body div.math p { + text-align: center; +} + +span.eqno { + float: right; +} + +span.eqno a.headerlink { + position: relative; + left: 0px; + z-index: 1; +} + +div.math:hover a.headerlink { + visibility: visible; +} + +/* -- printout stylesheet --------------------------------------------------- */ + +@media print { + div.document, + div.documentwrapper, + div.bodywrapper { + margin: 0 !important; + width: 100%; + } + + div.sphinxsidebar, + div.related, + div.footer, + #top-link { + display: none; + } +} \ No newline at end of file diff --git a/_static/comment-bright.png b/_static/comment-bright.png new file mode 100644 index 0000000..15e27ed Binary files /dev/null and b/_static/comment-bright.png differ diff --git a/_static/comment-close.png b/_static/comment-close.png new file mode 100644 index 0000000..4d91bcf Binary files /dev/null and b/_static/comment-close.png differ diff --git a/_static/comment.png b/_static/comment.png new file mode 100644 index 0000000..dfbc0cb Binary files /dev/null and b/_static/comment.png differ diff --git a/_static/custom.css b/_static/custom.css new file mode 100644 index 0000000..2a924f1 --- /dev/null +++ b/_static/custom.css @@ -0,0 +1 @@ +/* This file intentionally left blank. */ diff --git a/_static/doctools.js b/_static/doctools.js new file mode 100644 index 0000000..5654977 --- /dev/null +++ b/_static/doctools.js @@ -0,0 +1,287 @@ +/* + * doctools.js + * ~~~~~~~~~~~ + * + * Sphinx JavaScript utilities for all documentation. + * + * :copyright: Copyright 2007-2017 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ + +/** + * select a different prefix for underscore + */ +$u = _.noConflict(); + +/** + * make the code below compatible with browsers without + * an installed firebug like debugger +if (!window.console || !console.firebug) { + var names = ["log", "debug", "info", "warn", "error", "assert", "dir", + "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", + "profile", "profileEnd"]; + window.console = {}; + for (var i = 0; i < names.length; ++i) + window.console[names[i]] = function() {}; +} + */ + +/** + * small helper function to urldecode strings + */ +jQuery.urldecode = function(x) { + return decodeURIComponent(x).replace(/\+/g, ' '); +}; + +/** + * small helper function to urlencode strings + */ +jQuery.urlencode = encodeURIComponent; + +/** + * This function returns the parsed url parameters of the + * current request. Multiple values per key are supported, + * it will always return arrays of strings for the value parts. + */ +jQuery.getQueryParameters = function(s) { + if (typeof s == 'undefined') + s = document.location.search; + var parts = s.substr(s.indexOf('?') + 1).split('&'); + var result = {}; + for (var i = 0; i < parts.length; i++) { + var tmp = parts[i].split('=', 2); + var key = jQuery.urldecode(tmp[0]); + var value = jQuery.urldecode(tmp[1]); + if (key in result) + result[key].push(value); + else + result[key] = [value]; + } + return result; +}; + +/** + * highlight a given string on a jquery object by wrapping it in + * span elements with the given class name. + */ +jQuery.fn.highlightText = function(text, className) { + function highlight(node) { + if (node.nodeType == 3) { + var val = node.nodeValue; + var pos = val.toLowerCase().indexOf(text); + if (pos >= 0 && !jQuery(node.parentNode).hasClass(className)) { + var span = document.createElement("span"); + span.className = className; + span.appendChild(document.createTextNode(val.substr(pos, text.length))); + node.parentNode.insertBefore(span, node.parentNode.insertBefore( + document.createTextNode(val.substr(pos + text.length)), + node.nextSibling)); + node.nodeValue = val.substr(0, pos); + } + } + else if (!jQuery(node).is("button, select, textarea")) { + jQuery.each(node.childNodes, function() { + highlight(this); + }); + } + } + return this.each(function() { + highlight(this); + }); +}; + +/* + * backward compatibility for jQuery.browser + * This will be supported until firefox bug is fixed. + */ +if (!jQuery.browser) { + jQuery.uaMatch = function(ua) { + ua = ua.toLowerCase(); + + var match = /(chrome)[ \/]([\w.]+)/.exec(ua) || + /(webkit)[ \/]([\w.]+)/.exec(ua) || + /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) || + /(msie) ([\w.]+)/.exec(ua) || + ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) || + []; + + return { + browser: match[ 1 ] || "", + version: match[ 2 ] || "0" + }; + }; + jQuery.browser = {}; + jQuery.browser[jQuery.uaMatch(navigator.userAgent).browser] = true; +} + +/** + * Small JavaScript module for the documentation. + */ +var Documentation = { + + init : function() { + this.fixFirefoxAnchorBug(); + this.highlightSearchWords(); + this.initIndexTable(); + + }, + + /** + * i18n support + */ + TRANSLATIONS : {}, + PLURAL_EXPR : function(n) { return n == 1 ? 0 : 1; }, + LOCALE : 'unknown', + + // gettext and ngettext don't access this so that the functions + // can safely bound to a different name (_ = Documentation.gettext) + gettext : function(string) { + var translated = Documentation.TRANSLATIONS[string]; + if (typeof translated == 'undefined') + return string; + return (typeof translated == 'string') ? translated : translated[0]; + }, + + ngettext : function(singular, plural, n) { + var translated = Documentation.TRANSLATIONS[singular]; + if (typeof translated == 'undefined') + return (n == 1) ? singular : plural; + return translated[Documentation.PLURALEXPR(n)]; + }, + + addTranslations : function(catalog) { + for (var key in catalog.messages) + this.TRANSLATIONS[key] = catalog.messages[key]; + this.PLURAL_EXPR = new Function('n', 'return +(' + catalog.plural_expr + ')'); + this.LOCALE = catalog.locale; + }, + + /** + * add context elements like header anchor links + */ + addContextElements : function() { + $('div[id] > :header:first').each(function() { + $('\u00B6'). + attr('href', '#' + this.id). + attr('title', _('Permalink to this headline')). + appendTo(this); + }); + $('dt[id]').each(function() { + $('\u00B6'). + attr('href', '#' + this.id). + attr('title', _('Permalink to this definition')). + appendTo(this); + }); + }, + + /** + * workaround a firefox stupidity + * see: https://bugzilla.mozilla.org/show_bug.cgi?id=645075 + */ + fixFirefoxAnchorBug : function() { + if (document.location.hash) + window.setTimeout(function() { + document.location.href += ''; + }, 10); + }, + + /** + * highlight the search words provided in the url in the text + */ + highlightSearchWords : function() { + var params = $.getQueryParameters(); + var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : []; + if (terms.length) { + var body = $('div.body'); + if (!body.length) { + body = $('body'); + } + window.setTimeout(function() { + $.each(terms, function() { + body.highlightText(this.toLowerCase(), 'highlighted'); + }); + }, 10); + $('') + .appendTo($('#searchbox')); + } + }, + + /** + * init the domain index toggle buttons + */ + initIndexTable : function() { + var togglers = $('img.toggler').click(function() { + var src = $(this).attr('src'); + var idnum = $(this).attr('id').substr(7); + $('tr.cg-' + idnum).toggle(); + if (src.substr(-9) == 'minus.png') + $(this).attr('src', src.substr(0, src.length-9) + 'plus.png'); + else + $(this).attr('src', src.substr(0, src.length-8) + 'minus.png'); + }).css('display', ''); + if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) { + togglers.click(); + } + }, + + /** + * helper function to hide the search marks again + */ + hideSearchWords : function() { + $('#searchbox .highlight-link').fadeOut(300); + $('span.highlighted').removeClass('highlighted'); + }, + + /** + * make the url absolute + */ + makeURL : function(relativeURL) { + return DOCUMENTATION_OPTIONS.URL_ROOT + '/' + relativeURL; + }, + + /** + * get the current relative url + */ + getCurrentURL : function() { + var path = document.location.pathname; + var parts = path.split(/\//); + $.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() { + if (this == '..') + parts.pop(); + }); + var url = parts.join('/'); + return path.substring(url.lastIndexOf('/') + 1, path.length - 1); + }, + + initOnKeyListeners: function() { + $(document).keyup(function(event) { + var activeElementType = document.activeElement.tagName; + // don't navigate when in search box or textarea + if (activeElementType !== 'TEXTAREA' && activeElementType !== 'INPUT' && activeElementType !== 'SELECT') { + switch (event.keyCode) { + case 37: // left + var prevHref = $('link[rel="prev"]').prop('href'); + if (prevHref) { + window.location.href = prevHref; + return false; + } + case 39: // right + var nextHref = $('link[rel="next"]').prop('href'); + if (nextHref) { + window.location.href = nextHref; + return false; + } + } + } + }); + } +}; + +// quick alias for translations +_ = Documentation.gettext; + +$(document).ready(function() { + Documentation.init(); +}); \ No newline at end of file diff --git a/_static/down-pressed.png b/_static/down-pressed.png new file mode 100644 index 0000000..5756c8c Binary files /dev/null and b/_static/down-pressed.png differ diff --git a/_static/down.png b/_static/down.png new file mode 100644 index 0000000..1b3bdad Binary files /dev/null and b/_static/down.png differ diff --git a/_static/file.png b/_static/file.png new file mode 100644 index 0000000..a858a41 Binary files /dev/null and b/_static/file.png differ diff --git a/_static/jquery-3.1.0.js b/_static/jquery-3.1.0.js new file mode 100644 index 0000000..f2fc274 --- /dev/null +++ b/_static/jquery-3.1.0.js @@ -0,0 +1,10074 @@ +/*eslint-disable no-unused-vars*/ +/*! + * jQuery JavaScript Library v3.1.0 + * https://jquery.com/ + * + * Includes Sizzle.js + * https://sizzlejs.com/ + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license + * https://jquery.org/license + * + * Date: 2016-07-07T21:44Z + */ +( function( global, factory ) { + + "use strict"; + + if ( typeof module === "object" && typeof module.exports === "object" ) { + + // For CommonJS and CommonJS-like environments where a proper `window` + // is present, execute the factory and get jQuery. + // For environments that do not have a `window` with a `document` + // (such as Node.js), expose a factory as module.exports. + // This accentuates the need for the creation of a real `window`. + // e.g. var jQuery = require("jquery")(window); + // See ticket #14549 for more info. + module.exports = global.document ? + factory( global, true ) : + function( w ) { + if ( !w.document ) { + throw new Error( "jQuery requires a window with a document" ); + } + return factory( w ); + }; + } else { + factory( global ); + } + +// Pass this if window is not defined yet +} )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) { + +// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1 +// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode +// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common +// enough that all such attempts are guarded in a try block. +"use strict"; + +var arr = []; + +var document = window.document; + +var getProto = Object.getPrototypeOf; + +var slice = arr.slice; + +var concat = arr.concat; + +var push = arr.push; + +var indexOf = arr.indexOf; + +var class2type = {}; + +var toString = class2type.toString; + +var hasOwn = class2type.hasOwnProperty; + +var fnToString = hasOwn.toString; + +var ObjectFunctionString = fnToString.call( Object ); + +var support = {}; + + + + function DOMEval( code, doc ) { + doc = doc || document; + + var script = doc.createElement( "script" ); + + script.text = code; + doc.head.appendChild( script ).parentNode.removeChild( script ); + } +/* global Symbol */ +// Defining this global in .eslintrc would create a danger of using the global +// unguarded in another place, it seems safer to define global only for this module + + + +var + version = "3.1.0", + + // Define a local copy of jQuery + jQuery = function( selector, context ) { + + // The jQuery object is actually just the init constructor 'enhanced' + // Need init if jQuery is called (just allow error to be thrown if not included) + return new jQuery.fn.init( selector, context ); + }, + + // Support: Android <=4.0 only + // Make sure we trim BOM and NBSP + rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, + + // Matches dashed string for camelizing + rmsPrefix = /^-ms-/, + rdashAlpha = /-([a-z])/g, + + // Used by jQuery.camelCase as callback to replace() + fcamelCase = function( all, letter ) { + return letter.toUpperCase(); + }; + +jQuery.fn = jQuery.prototype = { + + // The current version of jQuery being used + jquery: version, + + constructor: jQuery, + + // The default length of a jQuery object is 0 + length: 0, + + toArray: function() { + return slice.call( this ); + }, + + // Get the Nth element in the matched element set OR + // Get the whole matched element set as a clean array + get: function( num ) { + return num != null ? + + // Return just the one element from the set + ( num < 0 ? this[ num + this.length ] : this[ num ] ) : + + // Return all the elements in a clean array + slice.call( this ); + }, + + // Take an array of elements and push it onto the stack + // (returning the new matched element set) + pushStack: function( elems ) { + + // Build a new jQuery matched element set + var ret = jQuery.merge( this.constructor(), elems ); + + // Add the old object onto the stack (as a reference) + ret.prevObject = this; + + // Return the newly-formed element set + return ret; + }, + + // Execute a callback for every element in the matched set. + each: function( callback ) { + return jQuery.each( this, callback ); + }, + + map: function( callback ) { + return this.pushStack( jQuery.map( this, function( elem, i ) { + return callback.call( elem, i, elem ); + } ) ); + }, + + slice: function() { + return this.pushStack( slice.apply( this, arguments ) ); + }, + + first: function() { + return this.eq( 0 ); + }, + + last: function() { + return this.eq( -1 ); + }, + + eq: function( i ) { + var len = this.length, + j = +i + ( i < 0 ? len : 0 ); + return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] ); + }, + + end: function() { + return this.prevObject || this.constructor(); + }, + + // For internal use only. + // Behaves like an Array's method, not like a jQuery method. + push: push, + sort: arr.sort, + splice: arr.splice +}; + +jQuery.extend = jQuery.fn.extend = function() { + var options, name, src, copy, copyIsArray, clone, + target = arguments[ 0 ] || {}, + i = 1, + length = arguments.length, + deep = false; + + // Handle a deep copy situation + if ( typeof target === "boolean" ) { + deep = target; + + // Skip the boolean and the target + target = arguments[ i ] || {}; + i++; + } + + // Handle case when target is a string or something (possible in deep copy) + if ( typeof target !== "object" && !jQuery.isFunction( target ) ) { + target = {}; + } + + // Extend jQuery itself if only one argument is passed + if ( i === length ) { + target = this; + i--; + } + + for ( ; i < length; i++ ) { + + // Only deal with non-null/undefined values + if ( ( options = arguments[ i ] ) != null ) { + + // Extend the base object + for ( name in options ) { + src = target[ name ]; + copy = options[ name ]; + + // Prevent never-ending loop + if ( target === copy ) { + continue; + } + + // Recurse if we're merging plain objects or arrays + if ( deep && copy && ( jQuery.isPlainObject( copy ) || + ( copyIsArray = jQuery.isArray( copy ) ) ) ) { + + if ( copyIsArray ) { + copyIsArray = false; + clone = src && jQuery.isArray( src ) ? src : []; + + } else { + clone = src && jQuery.isPlainObject( src ) ? src : {}; + } + + // Never move original objects, clone them + target[ name ] = jQuery.extend( deep, clone, copy ); + + // Don't bring in undefined values + } else if ( copy !== undefined ) { + target[ name ] = copy; + } + } + } + } + + // Return the modified object + return target; +}; + +jQuery.extend( { + + // Unique for each copy of jQuery on the page + expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), + + // Assume jQuery is ready without the ready module + isReady: true, + + error: function( msg ) { + throw new Error( msg ); + }, + + noop: function() {}, + + isFunction: function( obj ) { + return jQuery.type( obj ) === "function"; + }, + + isArray: Array.isArray, + + isWindow: function( obj ) { + return obj != null && obj === obj.window; + }, + + isNumeric: function( obj ) { + + // As of jQuery 3.0, isNumeric is limited to + // strings and numbers (primitives or objects) + // that can be coerced to finite numbers (gh-2662) + var type = jQuery.type( obj ); + return ( type === "number" || type === "string" ) && + + // parseFloat NaNs numeric-cast false positives ("") + // ...but misinterprets leading-number strings, particularly hex literals ("0x...") + // subtraction forces infinities to NaN + !isNaN( obj - parseFloat( obj ) ); + }, + + isPlainObject: function( obj ) { + var proto, Ctor; + + // Detect obvious negatives + // Use toString instead of jQuery.type to catch host objects + if ( !obj || toString.call( obj ) !== "[object Object]" ) { + return false; + } + + proto = getProto( obj ); + + // Objects with no prototype (e.g., `Object.create( null )`) are plain + if ( !proto ) { + return true; + } + + // Objects with prototype are plain iff they were constructed by a global Object function + Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor; + return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString; + }, + + isEmptyObject: function( obj ) { + + /* eslint-disable no-unused-vars */ + // See https://github.com/eslint/eslint/issues/6125 + var name; + + for ( name in obj ) { + return false; + } + return true; + }, + + type: function( obj ) { + if ( obj == null ) { + return obj + ""; + } + + // Support: Android <=2.3 only (functionish RegExp) + return typeof obj === "object" || typeof obj === "function" ? + class2type[ toString.call( obj ) ] || "object" : + typeof obj; + }, + + // Evaluates a script in a global context + globalEval: function( code ) { + DOMEval( code ); + }, + + // Convert dashed to camelCase; used by the css and data modules + // Support: IE <=9 - 11, Edge 12 - 13 + // Microsoft forgot to hump their vendor prefix (#9572) + camelCase: function( string ) { + return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); + }, + + nodeName: function( elem, name ) { + return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); + }, + + each: function( obj, callback ) { + var length, i = 0; + + if ( isArrayLike( obj ) ) { + length = obj.length; + for ( ; i < length; i++ ) { + if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { + break; + } + } + } else { + for ( i in obj ) { + if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { + break; + } + } + } + + return obj; + }, + + // Support: Android <=4.0 only + trim: function( text ) { + return text == null ? + "" : + ( text + "" ).replace( rtrim, "" ); + }, + + // results is for internal usage only + makeArray: function( arr, results ) { + var ret = results || []; + + if ( arr != null ) { + if ( isArrayLike( Object( arr ) ) ) { + jQuery.merge( ret, + typeof arr === "string" ? + [ arr ] : arr + ); + } else { + push.call( ret, arr ); + } + } + + return ret; + }, + + inArray: function( elem, arr, i ) { + return arr == null ? -1 : indexOf.call( arr, elem, i ); + }, + + // Support: Android <=4.0 only, PhantomJS 1 only + // push.apply(_, arraylike) throws on ancient WebKit + merge: function( first, second ) { + var len = +second.length, + j = 0, + i = first.length; + + for ( ; j < len; j++ ) { + first[ i++ ] = second[ j ]; + } + + first.length = i; + + return first; + }, + + grep: function( elems, callback, invert ) { + var callbackInverse, + matches = [], + i = 0, + length = elems.length, + callbackExpect = !invert; + + // Go through the array, only saving the items + // that pass the validator function + for ( ; i < length; i++ ) { + callbackInverse = !callback( elems[ i ], i ); + if ( callbackInverse !== callbackExpect ) { + matches.push( elems[ i ] ); + } + } + + return matches; + }, + + // arg is for internal usage only + map: function( elems, callback, arg ) { + var length, value, + i = 0, + ret = []; + + // Go through the array, translating each of the items to their new values + if ( isArrayLike( elems ) ) { + length = elems.length; + for ( ; i < length; i++ ) { + value = callback( elems[ i ], i, arg ); + + if ( value != null ) { + ret.push( value ); + } + } + + // Go through every key on the object, + } else { + for ( i in elems ) { + value = callback( elems[ i ], i, arg ); + + if ( value != null ) { + ret.push( value ); + } + } + } + + // Flatten any nested arrays + return concat.apply( [], ret ); + }, + + // A global GUID counter for objects + guid: 1, + + // Bind a function to a context, optionally partially applying any + // arguments. + proxy: function( fn, context ) { + var tmp, args, proxy; + + if ( typeof context === "string" ) { + tmp = fn[ context ]; + context = fn; + fn = tmp; + } + + // Quick check to determine if target is callable, in the spec + // this throws a TypeError, but we will just return undefined. + if ( !jQuery.isFunction( fn ) ) { + return undefined; + } + + // Simulated bind + args = slice.call( arguments, 2 ); + proxy = function() { + return fn.apply( context || this, args.concat( slice.call( arguments ) ) ); + }; + + // Set the guid of unique handler to the same of original handler, so it can be removed + proxy.guid = fn.guid = fn.guid || jQuery.guid++; + + return proxy; + }, + + now: Date.now, + + // jQuery.support is not used in Core but other projects attach their + // properties to it so it needs to exist. + support: support +} ); + +if ( typeof Symbol === "function" ) { + jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ]; +} + +// Populate the class2type map +jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ), +function( i, name ) { + class2type[ "[object " + name + "]" ] = name.toLowerCase(); +} ); + +function isArrayLike( obj ) { + + // Support: real iOS 8.2 only (not reproducible in simulator) + // `in` check used to prevent JIT error (gh-2145) + // hasOwn isn't used here due to false negatives + // regarding Nodelist length in IE + var length = !!obj && "length" in obj && obj.length, + type = jQuery.type( obj ); + + if ( type === "function" || jQuery.isWindow( obj ) ) { + return false; + } + + return type === "array" || length === 0 || + typeof length === "number" && length > 0 && ( length - 1 ) in obj; +} +var Sizzle = +/*! + * Sizzle CSS Selector Engine v2.3.0 + * https://sizzlejs.com/ + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2016-01-04 + */ +(function( window ) { + +var i, + support, + Expr, + getText, + isXML, + tokenize, + compile, + select, + outermostContext, + sortInput, + hasDuplicate, + + // Local document vars + setDocument, + document, + docElem, + documentIsHTML, + rbuggyQSA, + rbuggyMatches, + matches, + contains, + + // Instance-specific data + expando = "sizzle" + 1 * new Date(), + preferredDoc = window.document, + dirruns = 0, + done = 0, + classCache = createCache(), + tokenCache = createCache(), + compilerCache = createCache(), + sortOrder = function( a, b ) { + if ( a === b ) { + hasDuplicate = true; + } + return 0; + }, + + // Instance methods + hasOwn = ({}).hasOwnProperty, + arr = [], + pop = arr.pop, + push_native = arr.push, + push = arr.push, + slice = arr.slice, + // Use a stripped-down indexOf as it's faster than native + // https://jsperf.com/thor-indexof-vs-for/5 + indexOf = function( list, elem ) { + var i = 0, + len = list.length; + for ( ; i < len; i++ ) { + if ( list[i] === elem ) { + return i; + } + } + return -1; + }, + + booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", + + // Regular expressions + + // http://www.w3.org/TR/css3-selectors/#whitespace + whitespace = "[\\x20\\t\\r\\n\\f]", + + // http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier + identifier = "(?:\\\\.|[\\w-]|[^\0-\\xa0])+", + + // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors + attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + + // Operator (capture 2) + "*([*^$|!~]?=)" + whitespace + + // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]" + "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace + + "*\\]", + + pseudos = ":(" + identifier + ")(?:\\((" + + // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: + // 1. quoted (capture 3; capture 4 or capture 5) + "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + + // 2. simple (capture 6) + "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + + // 3. anything else (capture 2) + ".*" + + ")\\)|)", + + // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter + rwhitespace = new RegExp( whitespace + "+", "g" ), + rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), + + rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), + rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ), + + rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ), + + rpseudo = new RegExp( pseudos ), + ridentifier = new RegExp( "^" + identifier + "$" ), + + matchExpr = { + "ID": new RegExp( "^#(" + identifier + ")" ), + "CLASS": new RegExp( "^\\.(" + identifier + ")" ), + "TAG": new RegExp( "^(" + identifier + "|[*])" ), + "ATTR": new RegExp( "^" + attributes ), + "PSEUDO": new RegExp( "^" + pseudos ), + "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), + "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), + // For use in libraries implementing .is() + // We use this for POS matching in `select` + "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + + whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) + }, + + rinputs = /^(?:input|select|textarea|button)$/i, + rheader = /^h\d$/i, + + rnative = /^[^{]+\{\s*\[native \w/, + + // Easily-parseable/retrievable ID or TAG or CLASS selectors + rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, + + rsibling = /[+~]/, + + // CSS escapes + // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters + runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ), + funescape = function( _, escaped, escapedWhitespace ) { + var high = "0x" + escaped - 0x10000; + // NaN means non-codepoint + // Support: Firefox<24 + // Workaround erroneous numeric interpretation of +"0x" + return high !== high || escapedWhitespace ? + escaped : + high < 0 ? + // BMP codepoint + String.fromCharCode( high + 0x10000 ) : + // Supplemental Plane codepoint (surrogate pair) + String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); + }, + + // CSS string/identifier serialization + // https://drafts.csswg.org/cssom/#common-serializing-idioms + rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g, + fcssescape = function( ch, asCodePoint ) { + if ( asCodePoint ) { + + // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER + if ( ch === "\0" ) { + return "\uFFFD"; + } + + // Control characters and (dependent upon position) numbers get escaped as code points + return ch.slice( 0, -1 ) + "\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " "; + } + + // Other potentially-special ASCII characters get backslash-escaped + return "\\" + ch; + }, + + // Used for iframes + // See setDocument() + // Removing the function wrapper causes a "Permission Denied" + // error in IE + unloadHandler = function() { + setDocument(); + }, + + disabledAncestor = addCombinator( + function( elem ) { + return elem.disabled === true; + }, + { dir: "parentNode", next: "legend" } + ); + +// Optimize for push.apply( _, NodeList ) +try { + push.apply( + (arr = slice.call( preferredDoc.childNodes )), + preferredDoc.childNodes + ); + // Support: Android<4.0 + // Detect silently failing push.apply + arr[ preferredDoc.childNodes.length ].nodeType; +} catch ( e ) { + push = { apply: arr.length ? + + // Leverage slice if possible + function( target, els ) { + push_native.apply( target, slice.call(els) ); + } : + + // Support: IE<9 + // Otherwise append directly + function( target, els ) { + var j = target.length, + i = 0; + // Can't trust NodeList.length + while ( (target[j++] = els[i++]) ) {} + target.length = j - 1; + } + }; +} + +function Sizzle( selector, context, results, seed ) { + var m, i, elem, nid, match, groups, newSelector, + newContext = context && context.ownerDocument, + + // nodeType defaults to 9, since context defaults to document + nodeType = context ? context.nodeType : 9; + + results = results || []; + + // Return early from calls with invalid selector or context + if ( typeof selector !== "string" || !selector || + nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) { + + return results; + } + + // Try to shortcut find operations (as opposed to filters) in HTML documents + if ( !seed ) { + + if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { + setDocument( context ); + } + context = context || document; + + if ( documentIsHTML ) { + + // If the selector is sufficiently simple, try using a "get*By*" DOM method + // (excepting DocumentFragment context, where the methods don't exist) + if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) { + + // ID selector + if ( (m = match[1]) ) { + + // Document context + if ( nodeType === 9 ) { + if ( (elem = context.getElementById( m )) ) { + + // Support: IE, Opera, Webkit + // TODO: identify versions + // getElementById can match elements by name instead of ID + if ( elem.id === m ) { + results.push( elem ); + return results; + } + } else { + return results; + } + + // Element context + } else { + + // Support: IE, Opera, Webkit + // TODO: identify versions + // getElementById can match elements by name instead of ID + if ( newContext && (elem = newContext.getElementById( m )) && + contains( context, elem ) && + elem.id === m ) { + + results.push( elem ); + return results; + } + } + + // Type selector + } else if ( match[2] ) { + push.apply( results, context.getElementsByTagName( selector ) ); + return results; + + // Class selector + } else if ( (m = match[3]) && support.getElementsByClassName && + context.getElementsByClassName ) { + + push.apply( results, context.getElementsByClassName( m ) ); + return results; + } + } + + // Take advantage of querySelectorAll + if ( support.qsa && + !compilerCache[ selector + " " ] && + (!rbuggyQSA || !rbuggyQSA.test( selector )) ) { + + if ( nodeType !== 1 ) { + newContext = context; + newSelector = selector; + + // qSA looks outside Element context, which is not what we want + // Thanks to Andrew Dupont for this workaround technique + // Support: IE <=8 + // Exclude object elements + } else if ( context.nodeName.toLowerCase() !== "object" ) { + + // Capture the context ID, setting it first if necessary + if ( (nid = context.getAttribute( "id" )) ) { + nid = nid.replace( rcssescape, fcssescape ); + } else { + context.setAttribute( "id", (nid = expando) ); + } + + // Prefix every selector in the list + groups = tokenize( selector ); + i = groups.length; + while ( i-- ) { + groups[i] = "#" + nid + " " + toSelector( groups[i] ); + } + newSelector = groups.join( "," ); + + // Expand context for sibling selectors + newContext = rsibling.test( selector ) && testContext( context.parentNode ) || + context; + } + + if ( newSelector ) { + try { + push.apply( results, + newContext.querySelectorAll( newSelector ) + ); + return results; + } catch ( qsaError ) { + } finally { + if ( nid === expando ) { + context.removeAttribute( "id" ); + } + } + } + } + } + } + + // All others + return select( selector.replace( rtrim, "$1" ), context, results, seed ); +} + +/** + * Create key-value caches of limited size + * @returns {function(string, object)} Returns the Object data after storing it on itself with + * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) + * deleting the oldest entry + */ +function createCache() { + var keys = []; + + function cache( key, value ) { + // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) + if ( keys.push( key + " " ) > Expr.cacheLength ) { + // Only keep the most recent entries + delete cache[ keys.shift() ]; + } + return (cache[ key + " " ] = value); + } + return cache; +} + +/** + * Mark a function for special use by Sizzle + * @param {Function} fn The function to mark + */ +function markFunction( fn ) { + fn[ expando ] = true; + return fn; +} + +/** + * Support testing using an element + * @param {Function} fn Passed the created element and returns a boolean result + */ +function assert( fn ) { + var el = document.createElement("fieldset"); + + try { + return !!fn( el ); + } catch (e) { + return false; + } finally { + // Remove from its parent by default + if ( el.parentNode ) { + el.parentNode.removeChild( el ); + } + // release memory in IE + el = null; + } +} + +/** + * Adds the same handler for all of the specified attrs + * @param {String} attrs Pipe-separated list of attributes + * @param {Function} handler The method that will be applied + */ +function addHandle( attrs, handler ) { + var arr = attrs.split("|"), + i = arr.length; + + while ( i-- ) { + Expr.attrHandle[ arr[i] ] = handler; + } +} + +/** + * Checks document order of two siblings + * @param {Element} a + * @param {Element} b + * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b + */ +function siblingCheck( a, b ) { + var cur = b && a, + diff = cur && a.nodeType === 1 && b.nodeType === 1 && + a.sourceIndex - b.sourceIndex; + + // Use IE sourceIndex if available on both nodes + if ( diff ) { + return diff; + } + + // Check if b follows a + if ( cur ) { + while ( (cur = cur.nextSibling) ) { + if ( cur === b ) { + return -1; + } + } + } + + return a ? 1 : -1; +} + +/** + * Returns a function to use in pseudos for input types + * @param {String} type + */ +function createInputPseudo( type ) { + return function( elem ) { + var name = elem.nodeName.toLowerCase(); + return name === "input" && elem.type === type; + }; +} + +/** + * Returns a function to use in pseudos for buttons + * @param {String} type + */ +function createButtonPseudo( type ) { + return function( elem ) { + var name = elem.nodeName.toLowerCase(); + return (name === "input" || name === "button") && elem.type === type; + }; +} + +/** + * Returns a function to use in pseudos for :enabled/:disabled + * @param {Boolean} disabled true for :disabled; false for :enabled + */ +function createDisabledPseudo( disabled ) { + // Known :disabled false positives: + // IE: *[disabled]:not(button, input, select, textarea, optgroup, option, menuitem, fieldset) + // not IE: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable + return function( elem ) { + + // Check form elements and option elements for explicit disabling + return "label" in elem && elem.disabled === disabled || + "form" in elem && elem.disabled === disabled || + + // Check non-disabled form elements for fieldset[disabled] ancestors + "form" in elem && elem.disabled === false && ( + // Support: IE6-11+ + // Ancestry is covered for us + elem.isDisabled === disabled || + + // Otherwise, assume any non-