

@classmethod
def _get_or_create_host(cls, hostname, create=True):
    try:
        return (Host.get((Host.hostname == hostname)), False)
    except DoesNotExist:
        if create:
            return (Host.create(hostname=hostname), True)
        return (None, None)

dataset/ETHPy150Open CacheBrowser/cachebrowser/cachebrowser/bootstrap.py Bootstrapper._get_or_create_host/original