views:

14

answers:

1

I got 2 models

class Category(models.Model):
    name = models.CharField(max_length=30, unique=True)
class Post(models.Model): 
    ......
    category = models.ForeginKey(Category)
    ........

And when I create a form, in select box i got options "Category object", but i would like to display name of category, i am sure it's basic, just missed it in doc's :C

+1  A: 
class Category(models.Model):
   name = models.CharField(max_length=30, unique=True)

   def __unicode__(self):
        return self.name
Matthew Christensen
I knew that will be so simple ;) thanks
rysio_z_klanu