-class DenormalizedField(models.PositiveIntegerField):
- __metaclass__ = models.SubfieldBase
-
- def contribute_to_class(self, cls, name):
- super (DenormalizedField, self).contribute_to_class(cls, name)
- if not hasattr(cls, '_denormalizad_fields'):
- cls._denormalizad_fields = []
-
- cls._denormalizad_fields.append(name)
-
-class BaseModel(models.Model):
- objects = CachedManager()
+class DenormalizedField(object):
+ def __init__(self, manager, *args, **kwargs):
+ self.manager = manager
+ self.filter = (args, kwargs)