def image_attachment(*args, **kwargs):
    """The helper function, decorates raw
    :func:`~sqlalchemy.orm.relationship()` function, sepcialized for
    relationships between :class:`Image` subtypes.

    It takes the same parameters as :func:`~sqlalchemy.orm.relationship()`.

    If ``uselist`` is :const:`True`, it becomes possible to attach multiple
    image sets.  In order to attach multiple image sets, image entity types
    must have extra discriminating primary key columns to group each image set.

    If ``uselist`` is :const:`False` (which is default), it becomes
    possible to attach only a single image.

    :param \*args: the same arguments as
                   :func:`~sqlalchemy.orm.relationship()`
    :param \*\*kwargs: the same keyword arguments as
                       :func:`~sqlalchemy.orm.relationship()`
    :returns: the relationship property
    :rtype: :class:`sqlalchemy.orm.properties.RelationshipProperty`

    .. versionadded:: 1.0.0
       The ``uselist`` parameter.

    .. todo::

       It currently doesn't support population (eager loading) on
       :func:`image_attachment()` relationships yet.

       We seem to need to work something on attribute instrumental
       implementation.

    """
    if kwargs.get('uselist', False):
        kwargs.setdefault('query_class', MultipleImageSet)
    else:
        kwargs.setdefault('query_class', SingleImageSet)
    kwargs['uselist'] = True
    kwargs.setdefault('lazy', 'dynamic')
    kwargs.setdefault('cascade', 'all, delete-orphan')
    return relationship(*args, **kwargs)
The helper function, decorates raw
    :func:`~sqlalchemy.orm.relationship()` function, sepcialized for
    relationships between :class:`Image` subtypes.

    It takes the same parameters as :func:`~sqlalchemy.orm.relationship()`.

    If ``uselist`` is :const:`True`, it becomes possible to attach multiple
    image sets.  In order to attach multiple image sets, image entity types
    must have extra discriminating primary key columns to group each image set.

    If ``uselist`` is :const:`False` (which is default), it becomes
    possible to attach only a single image.

    :param \*args: the same arguments as
                   :func:`~sqlalchemy.orm.relationship()`
    :param \*\*kwargs: the same keyword arguments as
                       :func:`~sqlalchemy.orm.relationship()`
    :returns: the relationship property
    :rtype: :class:`sqlalchemy.orm.properties.RelationshipProperty`

    .. versionadded:: 1.0.0
       The ``uselist`` parameter.

    .. todo::

       It currently doesn't support population (eager loading) on
       :func:`image_attachment()` relationships yet.

       We seem to need to work something on attribute instrumental
       implementation.