diff --git a/congress_dashboard/datasources/views.py b/congress_dashboard/datasources/views.py index 48192f5..fde4f66 100644 --- a/congress_dashboard/datasources/views.py +++ b/congress_dashboard/datasources/views.py @@ -202,7 +202,7 @@ class DetailView(tables.DataTableView): # There could be another table with the same name and different # arity. Divide the rows into unnamed columns. Number them for # internal reference. - for i in xrange(0, row_len): + for i in range(0, row_len): col_name = str(i) column_names.append(col_name) table_class_attrs[col_name] = tables.Column( @@ -226,7 +226,7 @@ class DetailView(tables.DataTableView): try: row_data = row['data'] row.delete_by_key('data') - for i in xrange(0, num_cols): + for i in range(0, num_cols): row.set_value(column_names[i], row_data[i]) except Exception as e: msg_args = { diff --git a/congress_dashboard/policies/rules/workflows.py b/congress_dashboard/policies/rules/workflows.py index 0bc6f39..b5be295 100644 --- a/congress_dashboard/policies/rules/workflows.py +++ b/congress_dashboard/policies/rules/workflows.py @@ -98,7 +98,9 @@ class CreateConditions(workflows.Step): def _compare_mapping_columns(self, x, y): # x = "mapping_column_", y = "mapping_column_" - return cmp(int(x.split('_')[-1]), int(y.split('_')[-1])) + x = int(x.split('_')[-1]) + y = int(y.split('_')[-1]) + return (x > y) - (x < y) def render(self): # Overriding parent method to add extra template context variables.