title: Python/DJango Attribute error : Model object has not attribute objects
body: <p>forms.py :</p>
  
  <pre><code>from django.db import models
  from django import forms
  from pset.models import problem , testcases 
  
  class problems(forms.ModelForm):
      class Meta:
          model=problem
          fields=['pcode','pdesc']
  
  class testcases(forms.ModelForm):
      class Meta:
          model=testcases
          fields=['pcode','inp','out']
  
      def __init__(self,*args,**kwargs):
          super(testcases,self).__init__(*args,**kwargs)
          self.fields['pcode']=forms.ChoiceField(choices=get_list())
  
  
  def get_list() :
      tup=((x,x) for x in problem.object.values_list('pcode',flat=True))
      return tup
  </code></pre>
  
  <p>here are two modelforms one is problems and other one is testcases .
  I was trying to include a dropdown menu in it. 
  For it tried to include the pcode column from problem Model.</p>
  
  <p>But don't know why it is shooting up an error :</p>
  
  <p><strong>AttributeError at /setup/add_cases/
  type object 'problem' has no attribute 'object'</strong>
  in the function get_list .</p>
  
  <p>In case required :</p>
  
  <p>Models.py</p>
  
  <pre><code>from django.db import models
  
  # Create your models here. 
  class problem(models.Model) :
      pcode=models.CharField(max_length=10,unique=True)
      pdesc=models.TextField() 
  
      def __str__(self) :
          return self.pcode   
  
  class testcases(models.Model):
      pcode=models.CharField(max_length=10)
      inp=models.FileField(upload_to='testcases',blank=True)
      out=models.FileField(upload_to='testcases',blank=True)
  
      def __str__(self):
          return self.pcode
  </code></pre>
  
  <p>apologies if any detail has been left out . </p>