Beispiel #1
0
	def POST(self, cid):
		i = web.input(name='', description='', parent_id=0)

		if not i.name:
			return admin_render.category(cid, i, 'name must be provided.')
		elif model.update_category(name=i.name, description=i.description, parent_id=i.parent_id):
			return admin_render.category(cid, i, 'category update ok.')
Beispiel #2
0
	def POST(object):
		i = web.input(name=None, parent_id=0, description='')
		
		if i.name:
			cid = model.new_category(name=i.name, 
							  parent_id=i.parent_id, 
							  description=i.description)
		if cid:
			web.seeother('/admin/edit-category/%d?message="new category done."', cid)
		else:
			return admin_render.category(None, i, 'new category error.')
Beispiel #3
0
	def GET(self, cid):
		i = web.input(message=None)
		return admin_render.category(cid, None, None)
Beispiel #4
0
	def GET(object):
		return admin_render.category(None, None, None)