gdritter repos frony-ritter-designs / 7018689
implement photo deletion Getty Ritter 3 years ago
1 changed file(s) with 4 addition(s) and 45 deletion(s). Collapse all Expand all
221221 else:
222222 return flask.redirect(f'/edit/design/{id:09}')
223223
224 # def POST(self):
225 # input = web.input(file={})
226 # try:
227 # id = int(input['id'])
228 # except:
229 # raise web.redirect('/design/')
230 # if 'file' in input:
231 # photo_id = db.add_photo(input['file'], id)
232 # if id == -1:
233 # raise web.redirect('/edit/view-photo/{0:09}/'.format(photo_id))
234 # else:
235 # raise web.redirect('/edit/design/{0:05}/'.format(id))
236
237224 @app.route("/edit/photo/<id>/")
238225 @main
239226 def modify_photo(id):
241228 return 'Delete Photo', Templates.photo_delete(id, design_id)
242229
243230 @app.route("/edit/photo/<id>/", methods=["POST"])
244 def do_modify_photo():
245 pass
246
247 # def POST(self, id):
248 # input = web.input()
249 # design_id = int(input['design_id'])
250 # db.delete_photo(id)
251 # raise web.redirect('/edit/design/{0:05}/'.format(
252 # design_id))
231 def do_modify_photo(id):
232 design_id = int(flask.request.form['design_id'])
233 db.delete_photo(id)
234 return flask.redirect(f'/edit/design/{design_id}/')
253235
254236 @app.route("/edit/view-photo/")
255237 @main
298280 title = flask.request.form.get('title', slug.capitalize())
299281 db.set_page(slug, title, text)
300282 return flask.redirect(f'/edit/pages/{slug}')
301
302 # def POST(self, name):
303 # input = web.input()
304 # text = input.get('text', '')
305 # title = input.get('title', name.capitalize())
306 # db.set_page(name, title, text)
307 # raise web.redirect('/edit/pages/{0}/'.format(name))
308
309 # class edit_about:
310
311
312 # @main
313 # def GET(self):
314 # return (
315 # 'Edit About',
316 # render.edit_about(db.get_about_text()))
317
318
319 # def POST(self):
320 # input = web.input()
321 # text = input.get('text', '')
322 # db.set_about_text(text)
323 # raise web.redirect('/edit/about/')
324283
325284
326285 # urls = (