def __setattr__(self, name, value):
		"""
		Updates :attr:`._changed_fields` when new values are set for fields.
		
		"""
		
		if hasattr(self, '_changed_fields') and name in super(BaseChangeTracker, self).__getattribute__('_meta')._forward_fields_map:
			try:
				field = self._meta.get_field(name)
			
			except FieldDoesNotExist:
				field = None
			
			if field and not field.hidden and field.__class__ not in (ManyToManyField, ManyToOneRel):
				old = self.__dict__.get(field.attname, DoesNotExist)
				
				if old is not DoesNotExist and field.is_relation:
					try:
						# If we've already got a hydrated object we can stash,
						# awesome.
						hydrated_old = getattr(self, getattr(self.__class__, field.name).cache_name)
						
						if hydrated_old.pk != old:
							hydrated_old = DoesNotExist
					
					except AttributeError:
						hydrated_old = DoesNotExist
				
				else:
					hydrated_old = DoesNotExist
				
				# A parent's __setattr__ may change value.
				super(BaseChangeTracker, self).__setattr__(name, value)
				
				new = self.__dict__.get(field.attname, DoesNotExist)
				
				try:
					changed = (old != new)
				
				except Exception: # pragma: no cover (covers naive/aware datetime comparison failure; unreachable in py3)
					changed = True
				
				if changed:
					if self._changed_fields in field.attname:
						if self._changed_fields[field.attname] == new:
							# We've changed this field back to its original
							# value from the database. No need to push it
							# back up.
							self._changed_fields.pop(field.attname, None)
							
							if field.attname != field.name:
								self._changed_fields.pop(field.name, None)
					
					else:
						self._changed_fields[field.attname] = copy(old)
						
						if field.attname != field.name and hydrated_old is not DoesNotExist:
							self._changed_fields[field.name] = copy(hydrated_old)
			
			else:
				super(BaseChangeTracker, self).__setattr__(name, value)
		
		else:
			super(BaseChangeTracker, self).__setattr__(name, value)
dataset/ETHPy150Open karanlyons/django-save-the-change/save_the_change/mixins.py/BaseChangeTracker.__setattr__/swapped operands of `in`