title: Django: debug AttributeError: can't set attribute
body: <p>NOTE: I finally found the bug, so the below text was valuable perhaps only to me. The short answer: I decided to create a model field out of an attribute I had earlier defined as a <code>@property-method</code>. The only place where I hadn't removed the <code>@property-method</code> was in the Orchid model.</p>
  
  <hr>
  
  <p>After some tweaked and poking to my code, I suddenly get this error: <code>AttributeError: can't set attribute</code>. I haven't changed any of the code for <code>Orchid</code>, but I now get this error:</p>
  
  <pre><code>&gt;&gt;&gt; orc = Orchid.objects.get(id=1)
  Traceback (most recent call last):
    File "&lt;input&gt;", line 1, in &lt;module&gt;
    File "/Users/cole/PycharmProjects/Sites/virtualenvs/orchidislandcapital.com/lib/python2.7/site-packages/django/db/models/manager.py", line 151, in get
      return self.get_queryset().get(*args, **kwargs)
    File "/Users/cole/PycharmProjects/Sites/virtualenvs/orchidislandcapital.com/lib/python2.7/site-packages/django/db/models/query.py", line 301, in get
      num = len(clone)
    File "/Users/cole/PycharmProjects/Sites/virtualenvs/orchidislandcapital.com/lib/python2.7/site-packages/django/db/models/query.py", line 77, in __len__
      self._fetch_all()
    File "/Users/cole/PycharmProjects/Sites/virtualenvs/orchidislandcapital.com/lib/python2.7/site-packages/django/db/models/query.py", line 854, in _fetch_all
      self._result_cache = list(self.iterator())
    File "/Users/cole/PycharmProjects/Sites/virtualenvs/orchidislandcapital.com/lib/python2.7/site-packages/django/db/models/query.py", line 230, in iterator
      obj = model(*row_data)
    File "/Users/cole/PycharmProjects/Sites/virtualenvs/orchidislandcapital.com/lib/python2.7/site-packages/django/db/models/base.py", line 347, in __init__
      setattr(self, field.attname, val)
  AttributeError: can't set attribute
  </code></pre>
  
  <p>The definition for Orchid is <code>class Orchid(FinancialReturnMixin, PeerPerformance)</code>. I haven't changed the <code>FinancialReturnMixin</code>, whose code is:</p>
  
  <pre><code>class FinancialReturnMixin(models.Model):
      exclude_special_dividend = True
      round_to = 4
  
      shares_outstanding = models.FloatField(blank=True, null=True)
      stock_price = models.FloatField(
          verbose_name='quarter-end stock price',
          blank=True, null=True)
  
      class Meta:
          abstract = True
          app_label = 'snippets'
  </code></pre>
  
  <p>The second part of the <code>Orchid</code> class definition is <code>PeerPerformance</code> from which I have commented out the one change I had made. The definition for <code>PeerPerformance</code> is <code>class PeerPerformance(DividendBookValueMixin)</code> and all I did here was add 1 additional field to the model. <code>DividendBookValueMixin</code> is an abstract model.</p>
  
  <p>I deleted my Orchid migrations, datatable and relevant south_migrationhistory entries. With <code>class Orchid(models.Model)</code>, the Orchid model sets up fine. With <code>class Orchid(PeerPerformance)</code> the Orchid error remains. All my tests against <code>PeerPerformance</code> run. I can read and save <code>PeerPerformance</code> objects just fine.</p>
  
  <pre><code>&gt;&gt;&gt; from peer.models import PeerPerformance as PP
  &gt;&gt;&gt; pp1 = PP.objects.get(id=1)
  &gt;&gt;&gt; pp1.dividend = 0.135
  &gt;&gt;&gt; pp1.save()
  </code></pre>
  
  <p><code>DividendBookValueMixin</code> is the parent class for <code>PeerPerformance</code>. With <code>class Orchid(DividendBookValueMixin)</code> the error remains. All my tests agains <code>DividendBookValueMixin</code> run.</p>
  
  <p>Any thoughts where to look?</p>