def register_internal_data(cls):
    """Register a new class, *cls*, with various internal data structures.

    :params `sandman.model.Model` cls: class to register

    """
    with app.app_context():
        if getattr(cls, 'endpoint', None) is None:
            orig_class = cls
            cls = type('Sandman' + cls.__name__, (cls, Model), {})
            cls.__from_class__ = orig_class
        current_app.class_references[cls.__tablename__] = cls
        current_app.class_references[cls.__name__] = cls
        current_app.class_references[cls.endpoint()] = cls
        if not getattr(cls, '__related_tables__', None):
            cls.__related_tables__ = set()
Register a new class, *cls*, with various internal data structures.

    :params `sandman.model.Model` cls: class to register