diff --git a/mibios/query.py b/mibios/query.py index af5752c..5862258 100644 --- a/mibios/query.py +++ b/mibios/query.py @@ -351,9 +351,14 @@ def update_bin(self, queryset): get_fk = attrgetter(self.attname) else: # values list queryset - get_fk = itemgetter( - queryset.get_output_field_names().index(self.field_name) - ) + try: + pos = queryset.get_output_field_names().index(self.field_name) + except ValueError: + # field_name is not in list, try attname + pos = queryset.get_output_field_names().index(self.attname) + + get_fk = itemgetter(pos) + del pos missing = set() for i in queryset: @@ -508,7 +513,7 @@ def _iter(self): """ The iterator/generator yielding the data. - inheriting classes must implement this + Must be provided by implementing class. """ raise NotImplementedError