So, i have posts, and category:
class Post(models.Model):
...
category = models.ForeignKey(Category)
def __unicode__(self):
return self.title
class Category(models.Model):
category = models.CharField(max_length = 30, unique=True)
id_post = models.ForeignKey(Post)
def __unicode__(self):
return self.category
i write
python manage.py validate
and NameError: Name Category is not defined. WHY???
i`m use sqllite, thanks!