コード例 #1
0
def trash():
    dao = MailDao()
    mails = dao.selectTrash(session['userid'])
    mails.reverse()
    mail = dao.selectById(request.form.get('ident', None))
    length = dao.numInbox(session['userid'])
    if ('log' in request.form):
        session['userid'] = None
        return redirect(url_for('login'))
    elif ('delete' in request.form):
        deleteMailTrash(request.form['delete'])
        return redirect(url_for('trash'))
    elif ('reply' in request.form):
        session['reply'] = request.form['reply']
        return redirect(url_for('new'))
    return render_template('trash.html', **locals())
コード例 #2
0
def outbox():
    ident = request.form.get('ident', None)
    if (session['mail'] is not None):
        ident = session['mail']
    session['mail'] = None
    dao = MailDao()
    mails = dao.selectOutbox(session['userid'])
    mails.reverse()
    mail = dao.selectById(ident)
    length = dao.numInbox(session['userid'])
    if ('log' in request.form):
        session['userid'] = None
        return redirect(url_for('login'))
    elif ('delete' in request.form):
        deleteMailOut(request.form['delete'])
        return redirect(url_for('outbox'))
    return render_template('outbox.html', **locals())
コード例 #3
0
def deleteMailTrash(ident):
    dao = MailDao()
    mail = dao.selectById(ident)
    mail.deletedInbox = 2
    dao.update(mail)
コード例 #4
0
def deleteMailOut(ident):
    dao = MailDao()
    mail = dao.selectById(ident)
    mail.deletedOutbox = 1
    dao.update(mail)
コード例 #5
0
def deleteMailIn(ident):
    dao = MailDao()
    mail = dao.selectById(ident)
    mail.deletedInbox = 1
    dao.update(mail)