@staticmethod
def _from_db_object(resource, db_resource):
    """Converts a database entity to a formal object."""
    for field in resource.fields:
        setattr(resource, field, db_resource[field])
    resource.obj_reset_changes()
    return resource
