overwrite attribute as function Django
<p>I have <code>class A(models.Model)</code> with attr <code>name</code>. I use it in template and view as <code>obj_a.name</code>. I need overwrite <code>name</code> attr as function and when I write <code>obj_a.name</code> I would get response from function <code>getName</code>. How can I do it in <code>Django</code> and <code>Python</code> ? 
In <code>Laravel PHP</code> it is <code>$this-&gt;getNameAttribute()</code> and I can overwrite returning <code>name</code> from object. <code>Name</code> is only example and I want use it with almost all attr given class.</p>

<pre><code>class Item(caching.base.CachingMixin, models.Model):
    _name = models.CharField(_('Name'), max_length=100, db_column="name",
                         help_text=_('Item name'))

    @property
    def name(self):
        return self._name

    @name.setter
    def name(self, value):
        self._name = value
</code></pre>

<p>You can achieve this behavior with <a href="https://docs.python.org/2/library/functions.html#property" rel="nofollow"><code>property</code></a>.</p>

<pre><code>class A(models.Model):
    _name = Field()

    @property
    def name(self):
        return self._name
</code></pre>

python django object django-models attributes