def add_new_app(main,user): app=AppCode() app.user_id=user.user_id() author="none" bookmark=ApiObject.get_bookmark_of_user_id(app.user_id) if(bookmark and bookmark.name): author=bookmark.name app.author=author app.js_code="" app.css_code="" app.app_name=main.request.get("app_name") app.app_id=main.request.get("app_id") app.mode=int(main.request.get("mode")) app.plugin_args="" app.app_guide="" app.is_public=0 app.create_date=datetime.datetime.today() if(not DevPortal.check_id_available(main,app.app_id)): return if(app.app_name==""): main.response.out.write(Alert.alert_msg("アプリ名は必須です。",main.request.host)) return False app.put() return True