title: Django how to select multiple columns on a single model instance
body: <p>This seems like something simple that I've overlooked, but here goes anyway.</p>
  
  <p>I have a model defined, and I want to retrieve certain columns from the model (NOT via QuerySet API/model manager), but within the model class.</p>
  
  <p>Example:</p>
  
  <pre><code>class mymodel(models.Model):
      col1 = ...
      col2 = ...
      col3 = ...
  
  def __unicode__(self):
      return '%s %s' % (self.col1, self.col3) # Notice I'm omitting col2.
  </code></pre>
  
  <p>In the <code>__unicode__</code> class method this counts as at least 2 DB queries. How can I retrieve col1 and col3 within this class method in only 1 DB query? Seems like it should be so simple, that I feel like I'm doing something dumb.</p>
  
  <p>UPDATE:</p>
  
  <p>Based on the feedback, I created a test model, test form, etc... and found what several users stated is correct. However, in my <em>actual</em> code (using multiple forms), changing the <code>__unicode__</code> method to return a column of concatenated values changed the number of SQL queries went from 601 to 34. I only changed that single line. Based on my test cases, perhaps something else is going on, but to reiterate, <em>I only changed the unicode method</em> and I got a drastically different quantity of DB hits.</p>
  
  <p>I'm not sure what is going on with my other code and I'll have to try and look at it closer. In the mean time here are the test cases, which prove you guys are correct:</p>
  
  <pre><code># Models.py
  class TestModelFK(models.Model):
      col1    = models.CharField(max_length=8)
      col2    = models.CharField(max_length=8)
      col3    = models.CharField(max_length=8)
      col4    = models.CharField(max_length=8)
      allcols = models.CharField(max_length=32, blank=True, editable=False)    
  
      class Meta:
          ordering        = ('col1', 'col2')
  
      def __unicode__(self):
          return '%s %s %s %s' % (self.col1, self.col2, self.col3, self.col4)
  
      def save(self, *args, **kwargs):
          self.allcols    = '%s %s %s %s' % (self.col1, self.col2, self.col3, self.col4)
  
          super(TestModelFK, self).save()
  
  class TestModel(models.Model):
      quantity    = models.IntegerField()
      test_fk     = models.ForeignKey(TestModelFK)
  
  
  # forms.py
  class TestModelForm(forms.ModelForm):
  class Meta:
      model = TestModel
  
  
  # views.py
  if request.method == 'GET':
      post['TestModelFormSet'] = formset_factory(TestModelForm, extra=4)
  </code></pre>