code: def get_field_name(self, field):
          
          for field_name, f in self.fields.items():
              if f == field:
                  return field_name
          raise AttributeError("Field %s does not exists in %s resource" % (
              field, self.__class__))
docs: Returns the field name for a given field.