# Path: scalymongo/document.py
# def get_concrete_classes():
#     """Return a set of all non-abstract :class:`Document` subclasses."""
#     return DocumentMetaclass.concrete_classes


import warnings
from pymongo import MongoClient
from scalymongo.document import get_concrete_classes
==========

"""




class Connection(MongoClient):
    """A connection to a MongoDB database.

    This is a wrapper for a :class:`pymongo.mongo_client.MongoClient`.

    """

    def connect_document(self, document):
        """Connect a document by creating a new type and injecting the
        connection.

        """
        attrs = {
            'connection': self,
            'database': self[document.__database__],
            'collection': self[document.__database__][document.__collection__],
        }
        return type('Connected{0}'.format(document.__name__),
                    (document,),
                    attrs)

    @property
    def models(self):

# Path: scalymongo/document.py
# def get_concrete_classes():
#     """Return a set of all non-abstract :class:`Document` subclasses."""
#     return DocumentMetaclass.concrete_classes


# Path: scalymongo/connection.py
import warnings
from pymongo import MongoClient
from scalymongo.document import get_concrete_classes

==========

"""




class Connection(MongoClient):
    """A connection to a MongoDB database.

    This is a wrapper for a :class:`pymongo.mongo_client.MongoClient`.

    """

    def connect_document(self, document):
        """Connect a document by creating a new type and injecting the
        connection.

        """
        attrs = {
            'connection': self,
            'database': self[document.__database__],
            'collection': self[document.__database__][document.__collection__],
        }
        return type('Connected{0}'.format(document.__name__),
                    (document,),
                    attrs)

    @property
    def models(self):

        return DocumentProxy(self, get_concrete_classes())