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)
def get_activity(): return jsonify(Activity.json_all())
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]