Source

HackersEdge / he_one / lookups.py

from selectable.base import ModelLookup
from he_one.models import NameSystem
from selectable.decorators import ajax_required, login_required
from selectable.registry import registry

@ajax_required
@login_required
class HostLookup(ModelLookup):
    model = NameSystem
    search_fields = ('domain__startswith','hostname__startswith',)
    def get_item_value(self, item):
        return item.get_ipaddr()

registry.register(HostLookup)