def adapt_node_type(self, d): """Transform the node type to the JSON API type.""" type_name = inflector.plural(d['node_type'][:-6]) d['node_type'] = underscores_to_dashes(type_name)
def get_type(self, obj): type_name = obj.type[:-6] return underscores_to_dashes(type_name)