def build_dump_order(orm_class, orm_classes):
if orm_class in orm_classes: return<EOL>for field_name, field_val in orm_class.schema.fields.items():<EOL><INDENT>if field_val.is_ref():<EOL><INDENT>build_dump_order(field_val.schema.orm_class, orm_classes)<EOL><DEDENT><DEDENT>if orm_class not in orm_classes:<EOL><INDENT>orm_classes.append(orm_class)<EOL><DEDENT>
pass in an array, when you encounter a ref, call this method again with the array
    when something has no more refs, then it gets appended to the array and returns, each
    time something gets through the list they are added, but before they are added to the
    list it is checked to see if it is already in the listt