Esempio n. 1
0
 def post(self, request, tcid):
     dbrow = get_testcase(tcid)
     try:
         webhelpers.update_row(request.POST, models.TestCase, dbrow)
     except types.ValidationError, err:
         webhelpers.dbsession.rollback()
         resp = self.get_page(request, dbrow, err)
         return resp.finalize()
Esempio n. 2
0
 def post(self, request, tcid):
     dbrow = get_testcase(tcid)
     try:
         webhelpers.update_row(request.POST, models.TestCase, dbrow)
     except types.ValidationError, err:
         webhelpers.dbsession.rollback()
         resp = self.get_page(request, dbrow, err)
         return resp.finalize()
Esempio n. 3
0
 def post(self, request):
     dbrow = models.TestCase()
     try:
         webhelpers.update_row(request.POST, models.TestCase, dbrow)
     except types.ValidationError, err:
         webhelpers.dbsession.rollback()
         request.log_error("TC create ValidationError: %s\n" % (err, ))
         resp = self.get_page(request, err)
         return resp.finalize()
Esempio n. 4
0
 def post(self, request):
     dbrow = models.TestCase()
     try:
         webhelpers.update_row(request.POST, models.TestCase, dbrow)
     except types.ValidationError, err:
         webhelpers.dbsession.rollback()
         request.log_error("TC create ValidationError: %s\n" % (err,))
         resp = self.get_page(request, err)
         return resp.finalize()
Esempio n. 5
0
 def post(self, request, tablename=None, rowid=None):
     klass = get_model(tablename)
     dbrow = webhelpers.get_row(klass, rowid)
     try:
         webhelpers.update_row(request.POST, klass, dbrow)
     except types.ValidationError, err:
         webhelpers.dbsession.rollback()
         title = "Re-edit %s %s" % (tablename, dbrow)
         resp = self.get_response(request, title=title)
         resp.new_para(title)
         form = resp.add_form(action=request.get_url(edit, tablename=tablename, rowid=rowid))
         webhelpers.build_edit_form(form, klass, dbrow, err)
         return resp.finalize()
Esempio n. 6
0
 def post(self, request, tablename=None):
     klass = get_model(tablename)
     dbrow = klass()
     try:
         webhelpers.update_row(request.POST, klass, dbrow)
     except types.ValidationError, err:
         webhelpers.dbsession.rollback()
         request.log_error("create ValidationError: %s: %s\n" % (tablename, err))
         title = "Recreate new %s %s" % (tablename, dbrow)
         resp = self.get_response(request, title=title)
         resp.new_para(title)
         resp.new_para(err, class_="error")
         form = resp.add_form(action=request.get_url(addentry, tablename=tablename))
         webhelpers.build_add_form(form, klass)
         return resp.finalize()