示例#1
0
文件: routes.py 项目: songokunr1/IBS
def backup_structure_of_db():
    form = GetNameForBackupForm()
    if form.validate_on_submit():
        all_records = Activity.json_all()
        Template.create_new_record_from_template(name=form.backup_name.data,
                                                 instances=all_records)
        return redirect(url_for('backup_structure_of_db'))
    return render_template('backup.html', form=form)
示例#2
0
文件: routes.py 项目: songokunr1/IBS
def get_activity():
    return jsonify(Activity.json_all())
示例#3
0
 def __init__(self, *args, **kwargs):
     super().__init__(*args, **kwargs)
     self.all_cat = Activity.json_all()
     self.activity_id.choices = [(single['id'], single['name'])
                                 for single in self.all_cat]