Commits

Anonymous committed 0711e7a

批量添加愿望

Comments (0)

Files changed (2)

 		if USER.count()>0:
 			user=USER[0]
 			NowTerm=db.get(db.get(user).nowterm)
-			KCB = kcb()
-			KCB.name=cgi.escape(self.request.get('additem'))
-			KCB.term = NowTerm
-			KCB.type=True
-			KCB.settime=getCNnow()
-			KCB.put()
+			for i in cgi.escape(self.request.get('additem')).split('\n'):
+				# self.response.out.write(i+'ssss')
+				KCB = kcb()
+				KCB.name=i
+				KCB.term = NowTerm
+				KCB.type=True
+				KCB.settime=getCNnow()
+				KCB.put()
 			self.redirect('/admin')
 		else:
 			self.redirect('/signup')
 <div >
 <fieldset>
 
-	<legend>↓添加一个愿望↓</legend>
+	<legend>↓添加愿望↓(每行一个)</legend>
 
 
 <form action="/admin/add" method="post">
 
 
-<input type="text"  name='additem'   />
+ <div><textarea name="additem" rows="10" cols="50"></textarea></div>
 
 
 <input type="Submit" id="submit_btn" value="提交" >
 	</div>
 
 
+
+
+
 	<div >
 <fieldset>
 
 
 
 {% for TERM in TERMS %}
+<form action="/admin/term" method="post">
+<input type="hidden" name="nowterm" value= {{TERM.key}} >
+<input type="Submit" value="置为当前"  />
+</form>
+<form action="/admin/termname" method="post">
 
-<form action="/admin/termname" method="post">
-修改愿望列表名称:
-<input type="text"  name='termname' value={{TERM.name}}   />
+<input type="text"  name='termname' value='{{TERM.name}}'  />
 <input type="hidden" name='termkey' value={{TERM.key}}   />
-<input type="Submit"  value="提交"  />
+<input type="Submit"  value="改名"  />
 </form>
 
 <form action="/admin/delterm" method="post">
 <form action="/admin/termweight" method="post">
 <input type="text"  name='termweight' value={{TERM.weight}}   />
 <input type="hidden" name='termkey' value={{TERM.key}}   />
-<input type="Submit"  value="设置重量(整数)(重的在展示页面会下沉)设为0时不显示"  />
+<input type="Submit"  value="设置重量"  />(整数)(重的在展示页面会下沉)设为0时不显示
 </form>
 
-<form action="/admin/term" method="post">
-<input type="hidden" name="nowterm" value= {{TERM.key}} >
-<input type="Submit" value="置为当前"  />
-</form>
+
 <br />
     {% endfor %}