def __init__(self, post, *args, **kwargs): Form.__init__(self, *args, **kwargs) self.title.data = post.title self.body.data = post.body self.image_url.data = post.image_url self.slug.data = post.slug self.category_id.data = post.category_id self.category_id.choices = Category.get_list()
def __init__(self, *args, **kwargs): Form.__init__(self, *args, **kwargs) self.category_id.data = 1 self.category_id.choices = Category.get_list()