=============
 wicked link
=============

link.WickedLink is a class for binding to a view / multiadapter for
rendering wicked links.

this is a basic documentation of the linking class::

    >>> class mock(object):
    ...     def physicalPathToURL(self, obj, i):
    ...         return '/here/we/are'

    >>> context, request = mock(), mock()
    >>> wlink = BasicLink(context, request)
    >>> context == wlink.context
    True

    >>> link = dict(path="/some/path")
    >>> wlink.load([link], 'whee')
    >>> wlink.section='fieldname'
    >>> wlink.multiple
    False

    >>> wlink.howmany
    1

    >>> wlink.singlelink
    {'url': '/here/we/are', 'path': '/some/path'}

    >>> wlink.links
    [{'url': '/here/we/are', 'path': '/some/path'}]

    >>> link2 = dict(path="/other/")
    >>> wlink.load([link, link2], 'Title')
    >>> wlink.section='fieldname'
    >>> wlink.multiple
    True

    >>> list(sorted(wlink.singlelink.values()))
    ['/here/we/are', '/some/path']

    >>> [list(sorted(link.values())) for link in  wlink.links]
    [['/here/we/are', '/some/path'], ['/here/we/are', '/other/']]
