title: Django: why are Django model fields class attributes?
body: <p>In Django a model's fields are defined as class attributes.</p>
  
  <p>So that would mean all instances of a model would share the same values for those fields, no?</p>
  
  <p>Say I have a model</p>
  
  <pre><code>class Tag(models.Model):
      name = models.CharField(max_length=30)
  </code></pre>
  
  <p>And I have a form in which users can submit tags. Say a user submitted 2 tags: "Python" and "Django". If I create 2 instances of Tag in my view:</p>
  
  <pre><code>t1 = Tag(name="Python")
  t2 = Tag(name="Django")
  </code></pre>
  
  <p>Since <code>name</code> is a class attribute shouldn't both <code>t1</code> and <code>t2</code> have the same value for <code>name</code> which in this case should be "Django"?</p>
  
  <p>But in reality <code>name</code> behaves like an instance attribute instead of a class attribute. Can you explain what is going on?</p>