nodes: 0, module; 1, function_definition; 2, function_name:get_unique_fields; 3, parameters; 4, block; 5, identifier:self; 6, expression_statement; 7, for_statement; 8, return_statement; 9, comment:"""List field names that are unique_together with `sort_order`."""; 10, identifier:unique_together; 11, attribute; 12, block; 13, list; 14, attribute; 15, identifier:unique_together; 16, if_statement; 17, identifier:self; 18, identifier:_meta; 19, comparison_operator:'sort_order' in unique_together; 20, block; 21, string; 22, identifier:unique_together; 23, expression_statement; 24, expression_statement; 25, return_statement; 26, string_content:sort_order; 27, assignment; 28, call; 29, list_comprehension; 30, identifier:unique_fields; 31, call; 32, attribute; 33, argument_list; 34, binary_operator:'%s_id' % f; 35, for_in_clause; 36, identifier:list; 37, argument_list; 38, identifier:unique_fields; 39, identifier:remove; 40, string; 41, string; 42, identifier:f; 43, identifier:f; 44, identifier:unique_fields; 45, identifier:unique_together; 46, string_content:sort_order; 47, string_content:%s_id
code: def get_unique_fields(self):
          """List field names that are unique_together with `sort_order`."""
          for unique_together in self._meta.unique_together:
              if 'sort_order' in unique_together:
                  unique_fields = list(unique_together)
                  unique_fields.remove('sort_order')
                  return ['%s_id' % f for f in unique_fields]
          return []