initcrash/django-denorm — Issue #14: Can the @denormalized become a true replacement for @property including property.setter ?
Author: alanjds
Created: 2011-11-18 19:36:52+00:00
State: open

Hi. Is that hard to change @denormalized decorator to allow this?

``` python
class SomeModel(models.Model):
# the other fields

@denormalized(models.CharField,max_length=100)
def some_computation(self):
# your code
return some_value

@some_computation.setter
def some_computation(self, new_value):
# your code which let self.some_computation == new_value after the denormalization cleanup
assert self.some_computation == new_value
return
```

If this can be done, than it will really replace @property, as @property.deleter makes almost no sense for a Django field