title: How to get table name from Django filter objects
body: <p>I have diffrent tables with same columns
  Like</p>
  
  <pre><code>class teachers(models.Model):
      x= models..CharField(max_length=250, blank=True, null=True);
      y= models..CharField(max_length=250, blank=True, null=True);
  
  class students(models.Model):
      x= models..CharField(max_length=250, blank=True, null=True);
      z= models..CharField(max_length=250, blank=True, null=True);
  </code></pre>
  
  <p>I am using a function to process column x of both tables. So If any undesired values come in the value for x, I need to log that with the column name. </p>
  
  <p>Like 
      f = students.objects.filter()</p>
  
  <pre><code>def validate_x(obj):
      if obj.x == None:
          logger.error("None object found in table" + str(obj__tablename))
          return False
      else:
          return True
  
  for i in f:
      validate_result = validate_x(i)
  </code></pre>
  
  <p>My actual scenario is not null check. I just tried to explain it with this example.
  Is there any way to achieve this. I am using Django 1.6</p>