def current_items(self, obj):
        """Display a list of the current position content

        Each item will be wrapped in a admin change form link if the item
        is editable via the admin. This list also only shows the first 5
        items in order not to clutter up the admin change list.

        A horizontal rule is placed between returned objects and
        overlap objects.

        """
        items = []
        position_contents = obj.positioncontent_set.all()
        for i, pobj in enumerate(position_contents[:5]):
            item = unicode(pobj.content_object)
            try:
                reverse_name = u'admin:{}_{}_change'.format(
                    pobj.content_type.app_label,
                    pobj.content_type.model)
                item_link = reverse(reverse_name, args=[pobj.content_object.id])
                item = u'<a href="{}">{}</a>'.format(
                    item_link, unicode(pobj.content_object))
            except (NoReverseMatch, __HOLE__):
                pass
            items.append(u'<li>{}</li>'.format(item))
            if i+1 == obj.count:
                items.append(u'<hr style="background-color:#a2a2a2;"/>')

        if position_contents.count() > 5:
            items.append(u'<br/> and {} more'.format(
                position_contents.count() - 5))

        return u'<ul>{}</ul>'.format(''.join(items))
dataset/ETHPy150Open callowayproject/django-kamasutra/positions/admin.py/PositionAdmin.current_items