@classmethod<EOL><INDENT>def from_dict(cls, pref, prefix = None):<DEDENT>
if prefix is None:<EOL><INDENT>prefix = Prefix()<EOL><DEDENT>prefix.id = pref['<STR_LIT:id>']<EOL>if pref['<STR_LIT>'] is not None: <EOL><INDENT>prefix.vrf = VRF.get(pref['<STR_LIT>'])<EOL><DEDENT>prefix.family = pref['<STR_LIT>']<EOL>prefix.prefix = pref['<STR_LIT>']<EOL>prefix.display_prefix = pref['<STR_LIT>']<EOL>prefix.description = pref['<STR_LIT:description>']<EOL>prefix.comment = pref['<STR_LIT>']<EOL>prefix.node = pref['<STR_LIT>']<EOL>if pref['<STR_LIT>'] is not None: <EOL><INDENT>prefix.pool = Pool.get(pref['<STR_LIT>'])<EOL><DEDENT>prefix.type = pref['<STR_LIT:type>']<EOL>prefix.indent = pref['<STR_LIT>']<EOL>prefix.country = pref['<STR_LIT>']<EOL>prefix.order_id = pref['<STR_LIT>']<EOL>prefix.customer_id = pref['<STR_LIT>']<EOL>prefix.external_key = pref['<STR_LIT>']<EOL>prefix.authoritative_source = pref['<STR_LIT>']<EOL>prefix.alarm_priority = pref['<STR_LIT>']<EOL>prefix.monitor = pref['<STR_LIT>']<EOL>prefix.vlan = pref['<STR_LIT>']<EOL>prefix.added = pref['<STR_LIT>']<EOL>prefix.last_modified = pref['<STR_LIT>']<EOL>prefix.total_addresses = int(pref['<STR_LIT>'])<EOL>prefix.used_addresses = int(pref['<STR_LIT>'])<EOL>prefix.free_addresses = int(pref['<STR_LIT>'])<EOL>prefix.status = pref['<STR_LIT:status>']<EOL>prefix.avps = pref['<STR_LIT>']<EOL>prefix.expires = pref['<STR_LIT>']<EOL>prefix.inherited_tags = {}<EOL>for tag_name in pref['<STR_LIT>']:<EOL><INDENT>tag = Tag.from_dict({'<STR_LIT:name>': tag_name })<EOL>prefix.inherited_tags[tag_name] = tag<EOL><DEDENT>prefix.tags = {}<EOL>for tag_name in pref['<STR_LIT>']:<EOL><INDENT>tag = Tag.from_dict({'<STR_LIT:name>': tag_name })<EOL>prefix.tags[tag_name] = tag<EOL><DEDENT>if '<STR_LIT>' in pref:<EOL><INDENT>prefix.match = pref['<STR_LIT>']<EOL><DEDENT>if '<STR_LIT>' in pref:<EOL><INDENT>prefix.display = pref['<STR_LIT>']<EOL><DEDENT>if '<STR_LIT>' in pref:<EOL><INDENT>prefix.children = pref['<STR_LIT>']<EOL><DEDENT>return prefix<EOL>
Create a Prefix object from a dict.

            Suitable for creating Prefix objects from XML-RPC input.