from functools import wraps def unique_boolean(field): def factory(func): @wraps(func) def decorator(self): if getattr(self, field): try: tmp = self.__class__.objects.get(**{ field: True }) if self != tmp: setattr(tmp, field, False) tmp.save() except self.__class__.DoesNotExist: pass return func(self) return decorator return factory # Usage: class MyDefaultUniqueModel(models.Model): default = models.BooleanField() @unique_boolean('default') def save(self): super(MyDefaultUniqueModel, self).save()