def add_system_mail(info): system_mail_id = int(info["system_mail_id"]) if system_mail_id: system_mail = get_system_mail(system_mail_id) else: system_mail = SystemMail() if system_mail_id: del info["created_user"] for k, v in info.iteritems(): setattr(system_mail, k, v) system_mail.persist()
def get_system_mail_list(page=1, pagesize=20, status=-1): condition = "1=1" if status != -1: condition = "status=%s" % status return SystemMail.paging(page, pagesize, order="system_mail_id desc", condition=condition)
def get_system_mail(system_mail_id): return SystemMail.load(system_mail_id=system_mail_id)