title: Change table name in Django
body: <p>I have read that the table name in Django can be customized using <a href="https://docs.djangoproject.com/en/dev/ref/models/options/" rel="noreferrer">Meta Options</a>. I'm wondering how the db_table option could be used to keep using the app name but modify the model name slightly without hardcoding the app name.</p>
  
  <p>For example, from the Django tutorial, the app name is "polls" and the model name is "poll". Lets say I want the table to be called "polls_mypoll" instead of "polls_poll". Here is what I tried, but the outer class cannot be accessed (Poll is not defined)</p>
  
  <pre><code>class Poll(models.Model):
      question = models.CharField(max_length=200)
      pub_date = models.DateTimeField('date published')
  
      class Meta:
          db_table = "%s_%s" % (Poll._meta.app_label, "mypoll")
  </code></pre>
  
  <p>Similarly, what if I wanted to define db_table explicitly to just be the default polls_poll? I know I could just leave off the class Meta entirely and that default name would be used, but what if I wanted to be explicit about it? </p>
  
  <pre><code>class Poll(models.Model):
      question = models.CharField(max_length=200)
      pub_date = models.DateTimeField('date published')
  
      class Meta:
          db_table = "%s_%s" % (Poll._meta.app_label, Poll._meta.model_name)
  </code></pre>
  
  <p>This doesn't work, again because Poll is not defined inside Meta.</p>