示例#1
0
def format_registrar(registrar):
    """
    format object of type registrar    
    add type as '!type' key and filters all internal id data  
    
    @param registrar: Registrar object to format
    
    @return: formated registrar as dict
    """
    x = objects.objref.todict(registrar)
    x['!type'] = 'Registrar'
    formater.filterROID(x)
    return x
示例#2
0
def format_contact(contact):
    """
    format object of type contact
    add type as '!type' key and filters all internal id data  
    
    @param contact: Contact object to format
    
    @return: formated contact as dict
    """
    formater.filterDisclosed(contact)
    x = objects.objref.todict(contact)
    x['!type'] = 'Contact'
    formater.filterROID(x)
    return x
示例#3
0
def format_host(host):
    """
    format object of type host
    add type as '!type' key and filters all internal id data  
    
    @param host: Host object to format
    
    @return: formated host as dict
    """
    x = objects.objref.todict(host)
    x['!type'] = 'Host'
    del x['id']
    formater.filterROID(x)
    return x
示例#4
0
def format_domain(domain):
    """
    format object of type domain
    add type as '!type' key and filters all internal id data  
    
    @param domain: Domain object to format
    
    @return: formated domain as dict
    """
    x = objects.objref.todict(domain)
    x['!type'] = 'Domain'
    if x['registrant'] :
        x['registrant'] = x['registrant']['roid']

    formater.filterROID(x)
    return x