Django "can't set attribute" in model
The problem was a name clash.
Apparently when querying the DB I had:
objs = MyReport.objects.annotate(location=F('test__location'))
This added location
to the objects (didn't see it in __dict__
, but maybe I just missed it). This means I could give up the property since I could call report_instance.location
. Of course, this means that all places that access MyReport I need to add the annotation (a special manager?).
I have the same problem. I solved it by
@location.setter
def location(self, val):
pass