Howdy - today a weird problem occured to me:
I have a modle class in Django and added a custom property to it that shall not be saved into the database and therefore
Don't do it that way. Your title
attribute is completely "global". It's part of the class, not part of each instance.
Do something like this.
class Category(models.Model):
groups = models.ManyToManyField(Group)
@property
def title(self):
return self._title
def save( self, *args, **kw ):
try:
self._title
except AttributeError:
self._title= defaultdict()
super( Category, self ).save( *args, **kw )
If you could define your actual use case, it might be possible to simplify this a great deal.