set __name__ attribute in foreign_fields