def add_notice(info): notice = Notice() for k, v in info.iteritems(): setattr(notice, k, v) notice.persist()