def add(cm_id, caller_id, topic='', content='', sticky=False): """ @clmview_admin_clm @parameter{topic,string} @parameter{content,string} @parameter{sticky,bool} Whether should be kept displayed long-term Creates News described by params. Next it adds it to database. """ news = News() news.topic = topic news.content = content news.sticky = sticky news.date = datetime.now() try: news.save() except: raise CLMException('news_create')
def add(cm_id, caller_id, topic='', content='', sticky=False): """ Creates and saves new News. Such a News appears on the Web Interface's home screen. @clmview_admin_clm @param_post{topic,string} @param_post{content,string} @param_post{sticky,bool} whether the News should stay displayed long-term """ news = News() news.topic = topic news.content = content news.sticky = sticky news.date = datetime.now() try: news.save() except: raise CLMException('news_create')