title: Django model class and custom property
body: <p>today a weird problem occurred to me:</p>
  <p>I have a model class in Django and added a custom property to it that shall not be saved into the database and therefore is not representative in the model's structure:</p>
  <pre><code>class Category(models.Model):
      groups = models.ManyToManyField(Group)
      title = defaultdict()
  </code></pre>
  <p>Now, when I'm within the shell or writing a test and I do the following:</p>
  <pre><code>c1 = Category.objects.create()
  c1.title['de'] = 'german title'
  print c1.title['de'] # prints &quot;german title&quot;
  
  c2 = Category.objects.create()  
  print c2.title['de'] # prints &quot;german title&quot; &lt;-- WTF?
  </code></pre>
  <p>It seems that 'title' is kind of global. If I change the title to a simple string it works as expected, so it has to do something with the dict? I also tried setting title as a property:</p>
  <pre><code>title = property(_title)
  </code></pre>
  <p>But that did not work, too. So, how can I solve this? Thank you in advance!</p>
  <p>EDIT:</p>
  <p>Here is the intention of the base problem to provide you with a better look at the whole surrounding environment as requested:
  In our model structure, we have a model class that stores translations. This class is unbound from all the other classes that have relations with each other. The translation class stores the translated value, a language key, a translation key and the package and class the translation belongs to. Some model classes can have properties that can be translated into different languages. These properties are not mapped within the Django model structure as this is not truly possible in our eyes. Each of these classes with translatable properties, let's call them translatable, can have one or more of these properties. That's what the translation key is for. E.g. if there is a class Category with a translatable property &quot;title&quot;, the model translation will store &quot;module.somewhere.Category&quot; as package/class, &quot;title&quot; as translation key, and e.g. for german the translation value &quot;Kategorie&quot; and the language key &quot;de&quot;.
  My aim is to ease the access to these properties. So all these model classes inherit from a plain class called &quot;Translatable&quot;. It has a method for resolving the module path and name of the class (for the later storing within the translation database table) and a &quot;_propertize&quot; method that takes the name of the property. Properties instantiate a class &quot;Translator&quot; that is unique for each translatable property name. This class does the resolving of the real translation value from the translation model class and some stuff for automatically resolving the translation of the currently chosen language.</p>