Exemplo n.º 1
0
 def _process(self):
     form = TrackForm(event=self.event, obj=self.track)
     if form.validate_on_submit():
         update_track(self.track, form.data)
         flash(_('Track "{}" has been modified.').format(self.track.title), 'success')
         return jsonify_data(html=_render_track_list(self.event))
     return jsonify_form(form)
Exemplo n.º 2
0
 def _process(self):
     form = TrackForm(event=self.event, obj=self.track)
     if form.validate_on_submit():
         update_track(self.track, form.data)
         flash(_('Track "{}" has been modified.').format(self.track.title), 'success')
         return jsonify_data(html=_render_track_list(self.event))
     return jsonify_form(form)
Exemplo n.º 3
0
 def _process(self):
     form = TrackForm(event=self.event)
     if form.validate_on_submit():
         track = create_track(self.event, form.data)
         flash(_('Track "{}" has been created.').format(track.title), 'success')
         return jsonify_data(html=_render_track_list(self.event), new_track_id=track.id,
                             tracks=[{'id': t.id, 'title': t.title} for t in self.event.tracks])
     return jsonify_form(form)
Exemplo n.º 4
0
 def _process(self):
     form = TrackForm(event=self.event)
     if form.validate_on_submit():
         track = create_track(self.event, form.data)
         flash(_('Track "{}" has been created.').format(track.title), 'success')
         return jsonify_data(html=_render_track_list(self.event), new_track_id=track.id,
                             tracks=[{'id': t.id, 'title': t.title} for t in self.event.tracks])
     return jsonify_form(form)
Exemplo n.º 5
0
 def _process(self):
     form = TrackForm()
     if form.validate_on_submit():
         track = self._conf.newTrack()
         track.setTitle(form.title.data.encode('utf-8'))
         track.setDescription(form.description.data.encode('utf-8'))
         self._conf.addTrack(track)
         return jsonify_data(flash=False, new_track_id=int(track.getId()),
                             tracks=[{'id': int(t.getId()), 'title': to_unicode(t.getTitle())}
                                     for t in self._conf.getTrackList()])
     return jsonify_form(form)
Exemplo n.º 6
0
 def _process(self):
     form = TrackForm()
     if form.validate_on_submit():
         track = self._conf.newTrack()
         track.setTitle(form.title.data.encode('utf-8'))
         track.setDescription(form.description.data.encode('utf-8'))
         self._conf.addTrack(track)
         return jsonify_data(flash=False,
                             new_track_id=int(track.getId()),
                             tracks=[{
                                 'id': int(t.getId()),
                                 'title': to_unicode(t.getTitle())
                             } for t in self._conf.getTrackList()])
     return jsonify_form(form)