def to_dict(self):
fields = dict(vars(self).items())<EOL>if self.populated:<EOL><INDENT>fields['<STR_LIT>'] = []<EOL>fields['<STR_LIT>'] = []<EOL>for ip in self.ip_addresses:<EOL><INDENT>fields['<STR_LIT>'].append({<EOL>'<STR_LIT:address>': ip.address,<EOL>'<STR_LIT>': ip.access,<EOL>'<STR_LIT>': ip.family<EOL>})<EOL><DEDENT>for storage in self.storage_devices:<EOL><INDENT>fields['<STR_LIT>'].append({<EOL>'<STR_LIT:address>': storage.address,<EOL>'<STR_LIT>': storage.uuid,<EOL>'<STR_LIT>': storage.size,<EOL>'<STR_LIT>': storage.title,<EOL>'<STR_LIT:type>': storage.type,<EOL>})<EOL><DEDENT><DEDENT>del fields['<STR_LIT>']<EOL>del fields['<STR_LIT>']<EOL>return fields<EOL>
Prepare a JSON serializable dict for read-only purposes.

Includes storages and IP-addresses.
Use prepare_post_body for POST and .save() for PUT.