Create a Prefix object from a dict.

            Suitable for creating Prefix objects from XML-RPC input.

def from_dict(cls, pref, prefix = None):
        """ Create a Prefix object from a dict.

            Suitable for creating Prefix objects from XML-RPC input.
        """

        if prefix is None:
            prefix = Prefix()

        prefix.id = pref['id']
        if pref['vrf_id'] is not None: # VRF is not mandatory
            prefix.vrf = VRF.get(pref['vrf_id'])
        prefix.family = pref['family']
        prefix.prefix = pref['prefix']
        prefix.display_prefix = pref['display_prefix']
        prefix.description = pref['description']
        prefix.comment = pref['comment']
        prefix.node = pref['node']
        if pref['pool_id'] is not None: # Pool is not mandatory
            prefix.pool = Pool.get(pref['pool_id'])
        prefix.type = pref['type']
        prefix.indent = pref['indent']
        prefix.country = pref['country']
        prefix.order_id = pref['order_id']
        prefix.customer_id = pref['customer_id']
        prefix.external_key = pref['external_key']
        prefix.authoritative_source = pref['authoritative_source']
        prefix.alarm_priority = pref['alarm_priority']
        prefix.monitor = pref['monitor']
        prefix.vlan = pref['vlan']
        prefix.added = pref['added']
        prefix.last_modified = pref['last_modified']
        prefix.total_addresses = int(pref['total_addresses'])
        prefix.used_addresses = int(pref['used_addresses'])
        prefix.free_addresses = int(pref['free_addresses'])
        prefix.status = pref['status']
        prefix.avps = pref['avps']
        prefix.expires = pref['expires']

        prefix.inherited_tags = {}
        for tag_name in pref['inherited_tags']:
            tag = Tag.from_dict({'name': tag_name })
            prefix.inherited_tags[tag_name] = tag

        prefix.tags = {}
        for tag_name in pref['tags']:
            tag = Tag.from_dict({'name': tag_name })
            prefix.tags[tag_name] = tag

        if 'match' in pref:
            prefix.match = pref['match']
        if 'display' in pref:
            prefix.display = pref['display']
        if 'children' in pref:
            prefix.children = pref['children']

        return prefix