def create_welcome_forum():
 if (User.query.count() < 1):
  return False
 user = User.query.filter_by(id=1).first()
 category = Category(title=u'My Category', position=1)
 category.save()
 forum = Forum(title=u'Welcome', description=u'Your first forum', category_id=category.id)
 forum.save()
 topic = Topic(title=u'Welcome!')
 post = Post(content=u'Have fun with your new FlaskBB Forum!')
 topic.save(user=user, forum=forum, post=post)
 return True

def create_welcome_forum ( ) : if ( User . query . count ( ) < 1 ) : return False user = User . query . filter_by ( id = 1 ) . first ( ) category = Category ( title = u'My Category' , position = 1 ) category . save ( ) forum = Forum ( title = u'Welcome' , description = u'Your first forum' , category_id = category . id ) forum . save ( ) topic = Topic ( title = u'Welcome!' ) post = Post ( content = u'Have fun with your new FlaskBB Forum!' ) topic . save ( user = user , forum = forum , post = post ) return True
this will create the welcome forum with a welcome topic .