peewee.OperationalError: no such column: t2.subforum_id
I'm guessing you added that column to your model class without also ensuring it was added to the database. Try dropping and recreating your table, or migrating the schema using the migrate extension.

Please post questions on stackoverflow from now on. This is the issue tracker.
I have such models. Everything looks good

```
class Cats(db.Model):
     name = CharField()

 class Forums(db.Model):
     cat = ForeignKeyField(Cats)
     name = CharField()
 
 class SubForums(db.Model):
     forum = ForeignKeyField(Forums)
     name = CharField()
     description = CharField(default="")
 
     def messages(self):
         print("Messages of " + str(self.id))
         return Messages.select().where(Messages.topic.subforum == self.id).count()
     def topics(self):
         print("Topics of " + str(self.id))
         return Topics.select().where(Topics.subforum == self.id).count()
     #def last(self):
         #last = Messages.select().where(Messages.topic.subforum == self.id).order_by(Messages.created.desc()).first()
 
         #return [last.topic.title, last.author.name, last.created.strftime("%m.%d.%Y %H:%M:%S")]
 
 class Topics(db.Model):
     author = ForeignKeyField(User)
     subforum = ForeignKeyField(SubForums)
 
     title = CharField()
     text = CharField()
 
 class Messages(db.Model):
     topic = ForeignKeyField(Topics)
     author = ForeignKeyField(User)
 
     text = CharField()
     created = DateTimeField(default=datetime.datetime.now)
```

But when I call messages() function I got 

`peewee.OperationalError: no such column: t2.subforum_id`

Why?Is this my fault or peewee?