本文整理汇总了Python中tx2.Misc.MIscFunctions1.AppendMessageList类的典型用法代码示例。如果您正苦于以下问题:Python AppendMessageList类的具体用法?Python AppendMessageList怎么用?Python AppendMessageList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了AppendMessageList类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: noticeitemIndex
def noticeitemIndex(HttpRequest,page,item):
try:
msglist = AppendMessageList(HttpRequest)
logindetails = GetLoginDetails(HttpRequest)
if( logindetails["userid"] == -1):
msglist.append('Please Login to continue')
HttpRequest.session[SESSION_MESSAGE] = msglist
#return render_to_response("TwoColumnMaster.html",{'type':['NOTICE'],'title':"Notices"},context_instance=RequestContext(HttpRequest))
return HttpResponseRedirect('/user/login/')
else:
item=int(item)
res=GetCommunicationFnx().getNCommunicationsbyPageIndex("NOTICES", index=int(page))
if(res[0]==-1 ):
return HttpResponse("OOPS PAGE REQUESTED DOESNOT EXIST")
elif(res[0]==-5):
return HttpResponse("OOPS!!!! Something went wrong....Please Try sometime later, while we try to fix it")
else:
#print res
for i in res[0]:
if(i.id==item):
M=i
##print loads(M.Title.decode("base64").decode("zip"))
#print list
list1=[]
list1.append(str(loads(M.Title.decode("base64").decode("zip"))))
list1.append(str(M.Timestamp))
list1.append(str(loads(M.Content.decode("base64").decode("zip"))))
list1=zip(list1)
return render_to_response("Communication/User/ViewNewsitem.html",{'message':list1},context_instance=RequestContext(HttpRequest))
except:
return HttpResponse("OOPS PAGE REQUESTED DOESNOT EXIST")
开发者ID:sarvpriye98,项目名称:tx2-1,代码行数:32,代码来源:CommViews.py
示例2: GroupSecurity
def GroupSecurity(HttpRequest, ctid):
msglist = AppendMessageList(HttpRequest)
ip = HttpRequest.META["REMOTE_ADDR"]
logindetails = GetLoginDetails(HttpRequest)
print ctid
if logindetails["userid"] == -1:
msglist.append("Please Login to continue")
HttpRequest.session[SESSION_MESSAGE] = msglist
return HttpResponseRedirect("/user/login/")
try:
ContentTypeObj = ContentTypeFnx()
ContentSecurityList = ContentTypeObj.getGroupSecuritybyContentTypes(ctid)
if ContentSecurityList[0] == 1:
ContentSecurityList = ContentSecurityList[1]
if len(ContentSecurityList) == 0:
msglist.append("There are no content types in the system yet")
HttpRequest.session[SESSION_MESSAGE] = msglist
return render_to_response(
"SecuritySystem/GroupContentSecurity.html",
{"ContentSecurityList": ContentSecurityList, "GroupSecurityList": "true"},
context_instance=RequestContext(HttpRequest),
)
else:
msglist.append("Error Occured while fetching your request")
HttpRequest.session[SESSION_MESSAGE] = msglist
HttpResponseRedirect("/message/")
except:
Logger_User.exception("[%s][%s] == EXCEPTION ==" % ("GroupSecurity", ip))
msglist.append("Error Occured while fetching your request")
HttpRequest.session[SESSION_MESSAGE] = msglist
HttpResponseRedirect("/message/")
开发者ID:upcomingnewton,项目名称:tx2,代码行数:31,代码来源:ContentTypeViews.py
示例3: GroupSecurity
def GroupSecurity(HttpRequest,ctid):
msglist = AppendMessageList(HttpRequest)
ip = HttpRequest.META['REMOTE_ADDR']
logindetails = GetLoginDetails(HttpRequest)
print ctid
if( logindetails["userid"] == -1):
msglist.append('Please Login to continue')
HttpRequest.session[SESSION_MESSAGE] = msglist
return HttpResponseRedirect('/user/login/')
try:
ContentTypeObj = ContentTypeFnx()
ContentSecurityList = ContentTypeObj.getGroupSecuritybyContentTypes(ctid)
if(ContentSecurityList[0] == 1):
ContentSecurityList = ContentSecurityList[1]
if( len (ContentSecurityList) == 0):
msglist.append('There are no content types in the system yet')
HttpRequest.session[SESSION_MESSAGE] = msglist
return render_to_response("SecuritySystem/GroupContentSecurity.html",{'ContentSecurityList':ContentSecurityList,'GroupSecurityList':'true'},context_instance=RequestContext(HttpRequest))
else:
msglist.append('Error Occured while fetching your request')
HttpRequest.session[SESSION_MESSAGE] = msglist
HttpResponseRedirect('/message/')
except:
Logger_User.exception('[%s][%s] == EXCEPTION =='%('GroupSecurity',ip))
msglist.append('Error Occured while fetching your request')
HttpRequest.session[SESSION_MESSAGE] = msglist
HttpResponseRedirect('/message/')
开发者ID:jivjot,项目名称:tx2,代码行数:27,代码来源:ContentTypeViews.py
示例4: GroupTypeIndex
def GroupTypeIndex(HttpRequest):
msglist = AppendMessageList(HttpRequest)
ip = HttpRequest.META['REMOTE_ADDR']
logindetails = GetLoginDetails(HttpRequest)
if( logindetails["userid"] == -1):
msglist.append('Please Login to continue')
HttpRequest.session[SESSION_MESSAGE] = msglist
return HttpResponseRedirect('/user/login/')
try:
GroupTypeFnxObj = GroupTypeFnx()
GroupTypeList = GroupTypeFnxObj.ListAllGroupTypes()
if(GroupTypeList[0] == 1):
GroupTypeList = GroupTypeList[1]
if( len (GroupTypeList) == 0):
msglist.append('There are no group types in the system yet')
HttpRequest.session[SESSION_MESSAGE] = msglist
return render_to_response("UserSystem/GroupTypes/EditGroupTypes.html",{'grouptypelist':GroupTypeList,'GroupTypesCreate':'true','GroupTypesList':'true',},context_instance=RequestContext(HttpRequest))
else:
msglist.append('Error Occured while fetching your request')
HttpRequest.session[SESSION_MESSAGE] = msglist
HttpResponseRedirect('/message/')
except:
Logger_User.exception('[][] == EXCEPTION =='%('GroupTypeIndex',ip))
msglist.append('Error Occured while fetching your request')
HttpRequest.session[SESSION_MESSAGE] = msglist
HttpResponseRedirect('/message/')
开发者ID:jivjot,项目名称:tx2,代码行数:26,代码来源:GroupTypeViews.py
示例5: ListAllStates
def ListAllStates(HttpRequest):
msglist = AppendMessageList(HttpRequest)
ip = HttpRequest.META['REMOTE_ADDR']
logindetails = GetLoginDetails(HttpRequest)
if( logindetails["userid"] == -1):
msglist.append('Please Login to continue')
HttpRequest.session[SESSION_MESSAGE] = msglist
return HttpResponseRedirect('/user/login/')
try:
StateFnxObj = StateFnx()
StateList = StateFnxObj.ListAllStates()
if(StateList[0] == 1):
StateList = StateList[1]
if( len (StateList) == 0):
msglist.append('There are no states in the system yet')
HttpRequest.session[SESSION_MESSAGE] = msglist
return render_to_response("SecuritySystem/EditStates.html",{'StateList':StateList,'EditStateCreate':'false','EditStateList':'true','init_t':0,},context_instance=RequestContext(HttpRequest))
else:
msglist.append('Error Occured while fetching your request')
HttpRequest.session[SESSION_MESSAGE] = msglist
HttpResponseRedirect('/message/')
except:
Logger_User.exception('[][] == EXCEPTION =='%('ListAllStates',ip))
msglist.append('Error Occured while fetching your request')
HttpRequest.session[SESSION_MESSAGE] = msglist
HttpResponseRedirect('/message/')
开发者ID:jivjot,项目名称:tx2,代码行数:26,代码来源:StateViews.py
示例6: SessionTypeUpdate
def SessionTypeUpdate(HttpRequest):
msglist = AppendMessageList(HttpRequest)
ip = HttpRequest.META['REMOTE_ADDR']
logindetails = GetLoginDetails(HttpRequest)
print logindetails
if( logindetails["userid"] == -1):
msglist.append('Please Login to continue')
HttpRequest.session[SESSION_MESSAGE] = msglist
return HttpResponseRedirect('/user/login/')
try:
MarksObj=Marks()
flag=1
if "SessionTypeId" in HttpRequest.POST:
SessionTypeId=HttpRequest.POST["SessionTypeId"]
else:
msglist.append("Error fetching data from form for SessionTypeId");
flag=-1;
if "SessionTypeName" in HttpRequest.POST:
SessionTypeName=HttpRequest.POST["SessionTypeName"]
else:
msglist.append("Error fetching data from form for SessionTypeName");
flag=-1;
if flag==-1:
HttpRequest.session[SESSION_MESSAGE] = msglist
return render_to_response("UserProfile/Message.html",{'mylist':msglist,})
result=MarksObj.UpdateSessionType(SessionTypeId, SessionTypeName,logindetails["userid"], ip)
msglist.append("result is %s"%result);
return render_to_response("UserProfile/Message.html",{'mylist':msglist,})
except Exception as inst:
print type(inst) # the exception instance
print inst.args # arguments stored in .args
print inst # __str__ allows args to printed directly
x, y = inst.args
print 'x =', x
print 'y =', y
开发者ID:sarvpriye98,项目名称:tx2-1,代码行数:35,代码来源:Marks.py.REMOTE.4186.py
示例7: DegreeUpdate
def DegreeUpdate(HttpRequest):
msglist = AppendMessageList(HttpRequest)
ip = HttpRequest.META["REMOTE_ADDR"]
logindetails = GetLoginDetails(HttpRequest)
print logindetails
if logindetails["userid"] == -1:
msglist.append("Please Login to continue")
HttpRequest.session[SESSION_MESSAGE] = msglist
return HttpResponseRedirect("/user/login/")
try:
MarksObj = Marks()
flag = 1
if "DegreeId" in HttpRequest.POST:
DegreeId = HttpRequest.POST["DegreeId"]
else:
msglist.append("Error fetching data from form for DegreeId")
flag = -1
if "DegreeName" in HttpRequest.POST:
DegreeName = HttpRequest.POST["DegreeName"]
else:
msglist.append("Error fetching data from form for DegreeName")
flag = -1
if flag == -1:
HttpRequest.session[SESSION_MESSAGE] = msglist
return render_to_response("UserProfile/Message.html", {"mylist": msglist})
result = MarksObj.UpdateDegree(DegreeId, DegreeName, logindetails["userid"], ip)
msglist.append("result is %s" % result)
return render_to_response("UserProfile/Message.html", {"mylist": msglist})
except Exception as inst:
print type(inst) # the exception instance
print inst.args # arguments stored in .args
print inst # __str__ allows args to printed directly
x, y = inst.args
print "x =", x
print "y =", y
开发者ID:sarvpriye98,项目名称:tx2-1,代码行数:35,代码来源:Marks.py.LOCAL.4186.py
示例8: MarksIndex
def MarksIndex(HttpRequest):
msglist = AppendMessageList(HttpRequest)
logindetails = GetLoginDetails(HttpRequest)
if( logindetails["userid"] == -1):
msglist.append('Please Login to continue')
HttpRequest.session[SESSION_MESSAGE] = msglist
return HttpResponseRedirect('/user/login/')
else:
if( StudentDetails.objects.filter(User=logindetails["userid"]).exists()):
StudDetailStatus= True
else:
StudDetailStatus= False
return render_to_response("UserProfile/MarksCategory.html",context_instance=RequestContext(HttpRequest))
开发者ID:sarvpriye98,项目名称:tx2-1,代码行数:13,代码来源:Marks.py.REMOTE.4186.py
示例9: adminNoticeIndex
def adminNoticeIndex(HttpRequest):
msglist = AppendMessageList(HttpRequest)
logindetails = GetLoginDetails(HttpRequest)
if logindetails["userid"] == -1:
msglist.append("Please Login to continue")
HttpRequest.session[SESSION_MESSAGE] = msglist
return HttpResponseRedirect("/user/login/")
else:
return render_to_response(
"Communication/Admin/PostNotices.html",
{"type": ["NOTICE"], "title": "Post Notice"},
context_instance=RequestContext(HttpRequest),
)
开发者ID:sarvpriye98,项目名称:tx2-1,代码行数:13,代码来源:AdminCommViews.py
示例10: AdminIndex
def AdminIndex(HttpRequest):
msglist = AppendMessageList(HttpRequest)
ip = HttpRequest.META['REMOTE_ADDR']
try:
isLoggedIn = 'false'
#if logged in
if SYSTEM_INITIALISE_SESSION_NAME in HttpRequest.session.keys():
isLoggedIn = 'true'
HttpRequest.session[SESSION_MESSAGE] = msglist
return render_to_response("SecuritySystem/Admin/SecurityAdminLogin.html",{'isLoggedIn':isLoggedIn},context_instance=RequestContext(HttpRequest))
except:
msg = "== UNKNOWN SYSTEM EXCEPTION GENERATED =="
InitAdminLogger.exception('[%s][%s] %s'%('AdminIndex',ip,msg))
msglist.append(msg)
HttpRequest.session[SESSION_MESSAGE] = msglist
return HttpResponseRedirect('/user/login/')
开发者ID:sarvpriye98,项目名称:tx2-1,代码行数:16,代码来源:AdminInitializeViews.py
示例11: CreateNewStateIndex
def CreateNewStateIndex(HttpRequest,init):
msglist = AppendMessageList(HttpRequest)
ip = HttpRequest.META['REMOTE_ADDR']
logindetails = GetLoginDetails(HttpRequest)
#print logindetails
if( logindetails["userid"] == -1):
msglist.append('Please Login to continue')
HttpRequest.session[SESSION_MESSAGE] = msglist
return HttpResponseRedirect('/user/login/')
try:
HttpRequest.session[SESSION_MESSAGE] = msglist
return render_to_response("SecuritySystem/EditStates.html",{'StateList':{},'EditStateCreate':'true','EditStateList':'false','init_t':init,},context_instance=RequestContext(HttpRequest))
except:
Logger_User.exception('[][] == EXCEPTION =='%('CreateNewStateIndex',ip))
msglist.append('Error Occured while fetching your request')
HttpRequest.session[SESSION_MESSAGE] = msglist
HttpResponseRedirect('/message/')
开发者ID:jivjot,项目名称:tx2,代码行数:17,代码来源:StateViews.py
示例12: GroupSecurityCreateIndex
def GroupSecurityCreateIndex(HttpRequest):
msglist = AppendMessageList(HttpRequest)
ip = HttpRequest.META['REMOTE_ADDR']
logindetails = GetLoginDetails(HttpRequest)
if( logindetails["userid"] == -1):
msglist.append('Please Login to continue')
HttpRequest.session[SESSION_MESSAGE] = msglist
return HttpResponseRedirect('/user/login/')
try:
ContentTypeObj = ContentTypeFnx()
StatesObj = StateFnx()
PermissionObj = PermissionFnx()
GroupObj = GroupFnx()
ContentSecurityList = ContentTypeObj.getDjangoContentTypes()
StatesList = StatesObj.ListAllStates()
PermissionsList = PermissionObj.ListAllPermissions()
GroupsList = GroupObj.ListAllGroups()
if(ContentSecurityList[0] == 1 and StatesList[0] == 1 and PermissionsList[0] == 1 and GroupsList[0] == 1):
ContentSecurityList = ContentSecurityList[1]
StatesList = StatesList[1]
PermissionsList = PermissionsList[1]
GroupsList = GroupsList[1]
HttpRequest.session[SESSION_MESSAGE] = msglist
return render_to_response("SecuritySystem/GroupContentSecurity.html",{'ContentSecurityList':ContentSecurityList,'StatesList':StatesList,'PermissionsList':PermissionsList,'GroupList':GroupsList,'GroupSecurityInsert':'true','GroupSecurityList':'false'},context_instance=RequestContext(HttpRequest))
else:
msglist.append('Error Occured while fetching your request')
HttpRequest.session[SESSION_MESSAGE] = msglist
HttpResponseRedirect('/message/')
except:
Logger_User.exception('[%s][%s] == EXCEPTION =='%('GroupSecurityCreate',ip))
msglist.append('Error Occured while fetching your request')
HttpRequest.session[SESSION_MESSAGE] = msglist
HttpResponseRedirect('/message/')
开发者ID:jivjot,项目名称:tx2,代码行数:33,代码来源:ContentTypeViews.py
示例13: DegreeTypeSelect
def DegreeTypeSelect(HttpRequest):
msglist = AppendMessageList(HttpRequest)
ip = HttpRequest.META['REMOTE_ADDR']
logindetails = GetLoginDetails(HttpRequest)
print logindetails
if( logindetails["userid"] == -1):
msglist.append('Please Login to continue')
HttpRequest.session[SESSION_MESSAGE] = msglist
return HttpResponseRedirect('/user/login/')
try:
mylist=DegreeType.objects.all()
return render_to_response("UserProfile/ViewData.html",{'mydata':mylist,})
except Exception as inst:
print type(inst) # the exception instance
print inst.args # arguments stored in .args
print inst # __str__ allows args to printed directly
x, y = inst.args
print 'x =', x
print 'y =', y
开发者ID:sarvpriye98,项目名称:tx2-1,代码行数:21,代码来源:Marks.py.REMOTE.4186.py
示例14: BoardSelect
def BoardSelect(HttpRequest):
msglist = AppendMessageList(HttpRequest)
ip = HttpRequest.META["REMOTE_ADDR"]
logindetails = GetLoginDetails(HttpRequest)
print logindetails
if logindetails["userid"] == -1:
msglist.append("Please Login to continue")
HttpRequest.session[SESSION_MESSAGE] = msglist
return HttpResponseRedirect("/user/login/")
try:
mylist = Board.objects.all()
return render_to_response("UserProfile/ViewData.html", {"mydata": mylist})
except Exception as inst:
print type(inst) # the exception instance
print inst.args # arguments stored in .args
print inst # __str__ allows args to printed directly
x, y = inst.args
print "x =", x
print "y =", y
开发者ID:sarvpriye98,项目名称:tx2-1,代码行数:21,代码来源:Marks.py.LOCAL.4186.py
示例15: noticeIndex
def noticeIndex(HttpRequest,token):
msglist = AppendMessageList(HttpRequest)
logindetails = GetLoginDetails(HttpRequest)
if( logindetails["userid"] == -1):
msglist.append('Please Login to continue')
HttpRequest.session[SESSION_MESSAGE] = msglist
#return render_to_response("TwoColumnMaster.html",{'type':['NOTICE'],'title':"Notices"},context_instance=RequestContext(HttpRequest))
return HttpResponseRedirect('/user/login/')
else:
res=GetCommunicationFnx().getNCommunicationsbyPageIndex("NOTICES", index=int(token))
if(res[0]==-1 ):
return HttpResponse("OOPS PAGE REQUESTED DOESNOT EXIST")
elif(res[0]==-5):
return HttpResponse("OOPS!!!! Something went wrong....Please Try sometime later, while we try to fix it")
else:
list2=[]
for i in res[0]:
list1=[]
list1.append(loads(i.Title.decode("base64").decode("zip")))
list1.append(i.Timestamp)
list1.append(i.User)
content=loads(i.Content.decode("base64").decode("zip"))
content=replaceContentUrls(content)
preview=content.split(" ")
preview=preview[:40]
preview.append(".....")
preview= " ".join(preview)
list1.append(preview)
list1.append(content)
list1.append(i.id)
list2.append(list1)
list1=zip(list2)
return render_to_response("Communication/User/ViewNotices.html",{'pagerange':res[3],'next':res[1],'next_p':int(token)+1,'prev_p':int(token)-1,'prev':res[2],'list':list1,'title':"Notices"},context_instance=RequestContext(HttpRequest))
开发者ID:sarvpriye98,项目名称:tx2-1,代码行数:39,代码来源:CommViews.py
示例16: adminNewsPost
def adminNewsPost(HttpRequest):
msglist = AppendMessageList(HttpRequest)
logindetails = GetLoginDetails(HttpRequest)
ip = HttpRequest.META["REMOTE_ADDR"]
if logindetails["userid"] == -1:
msglist.append("Please Login to continue")
HttpRequest.session[SESSION_MESSAGE] = msglist
return HttpResponseRedirect("/user/login/")
else:
try:
print "1"
comm_call = CommunicationFunctions.PostCommunicationFnx()
print "2"
title = HttpRequest.POST["Title"]
_content = HttpRequest.POST["Content"]
print "fine"
tstamp = datetime.datetime.strptime(HttpRequest.POST["date_"], "%m/%d/%Y")
# print "fine2"
# print str(tstamp)
print "here"
result = comm_call.PostNews(title, _content, tstamp, logindetails["userid"], ip)
print result
if result["result"] == -2:
return HttpResponseRedirect("/user/login")
elif result["result"] == 1:
msglist.append("Notice Posted Successfully")
else:
msglist.append(result[1])
HttpRequest.session[SESSION_MESSAGE] = msglist
print msglist
return HttpResponseRedirect("/message/")
except Exception as inst:
LogUser.exception("[%s][%s] == EXCEPTION ==" % (ip, "NoticePost"))
msglist.append("Some Error has occoured")
HttpRequest.session[SESSION_MESSAGE] = msglist
return HttpResponseRedirect("/message/")
开发者ID:sarvpriye98,项目名称:tx2-1,代码行数:40,代码来源:AdminCommViews.py
示例17: adminNoticePost
def adminNoticePost(HttpRequest):
msglist = AppendMessageList(HttpRequest)
logindetails = GetLoginDetails(HttpRequest)
ip = HttpRequest.META["REMOTE_ADDR"]
if logindetails["userid"] == -1:
msglist.append("Please Login to continue")
HttpRequest.session[SESSION_MESSAGE] = msglist
return HttpResponseRedirect("/user/login/")
else:
try:
comm_call = CommunicationFunctions.PostCommunicationFnx()
title = HttpRequest.POST["Title"]
_content = HttpRequest.POST["Content"]
Users = "0"
result = comm_call.PostNotice(
title, _content, datetime.datetime.now(), Users, "Notice Post by Admin", logindetails["userid"], ip
)
# msglist.append(result[1])
if result[1]["result"] == -2:
return HttpResponseRedirect("/user/login")
elif result[1]["result"] == 1:
msglist.append("Notice Posted Successfully")
else:
msglist.append(result[1])
print msglist
HttpRequest.session[SESSION_MESSAGE] = msglist
return HttpResponseRedirect("/message/")
except Exception as inst:
LogUser.exception("[%s][%s] == EXCEPTION ==" % (ip, "NoticePost"))
msglist.append("Some Error has occoured")
HttpRequest.session[SESSION_MESSAGE] = msglist
return HttpResponseRedirect("/message/")
开发者ID:sarvpriye98,项目名称:tx2-1,代码行数:36,代码来源:AdminCommViews.py
示例18: GroupSecurityCreateIndex
def GroupSecurityCreateIndex(HttpRequest):
msglist = AppendMessageList(HttpRequest)
ip = HttpRequest.META["REMOTE_ADDR"]
logindetails = GetLoginDetails(HttpRequest)
if logindetails["userid"] == -1:
msglist.append("Please Login to continue")
HttpRequest.session[SESSION_MESSAGE] = msglist
return HttpResponseRedirect("/user/login/")
try:
ContentTypeObj = ContentTypeFnx()
StatesObj = StateFnx()
PermissionObj = PermissionFnx()
GroupObj = GroupFnx()
ContentSecurityList = ContentTypeObj.getDjangoContentTypes()
StatesList = StatesObj.ListAllStates()
PermissionsList = PermissionObj.ListAllPermissions()
GroupsList = GroupObj.ListAllGroups()
if ContentSecurityList[0] == 1 and StatesList[0] == 1 and PermissionsList[0] == 1 and GroupsList[0] == 1:
ContentSecurityList = ContentSecurityList[1]
StatesList = StatesList[1]
PermissionsList = PermissionsList[1]
GroupsList = GroupsList[1]
HttpRequest.session[SESSION_MESSAGE] = msglist
return render_to_response(
"SecuritySystem/GroupContentSecurity.html",
{
"ContentSecurityList": ContentSecurityList,
"StatesList": StatesList,
"PermissionsList": PermissionsList,
"GroupList": GroupsList,
"GroupSecurityInsert": "true",
"GroupSecurityList": "false",
},
context_instance=RequestContext(HttpRequest),
)
else:
msglist.append("Error Occured while fetching your request")
HttpRequest.session[SESSION_MESSAGE] = msglist
HttpResponseRedirect("/message/")
except:
Logger_User.exception("[%s][%s] == EXCEPTION ==" % ("GroupSecurityCreate", ip))
msglist.append("Error Occured while fetching your request")
HttpRequest.session[SESSION_MESSAGE] = msglist
HttpResponseRedirect("/message/")
开发者ID:upcomingnewton,项目名称:tx2,代码行数:44,代码来源:ContentTypeViews.py
示例19: AddUserForReg
def AddUserForReg(HttpRequest):
msglist = AppendMessageList(HttpRequest)
ip = HttpRequest.META['REMOTE_ADDR']
details = GetLoginDetails(HttpRequest)
if( details['userid'] == -1):
msglist.append('Please Login to continue')
HttpRequest.session[SESSION_MESSAGE] = msglist
return HttpResponseRedirect('/user/login/')
try:
UserRegFnxObj = UserRegFnx()
_SelectedUsers = HttpRequest.POST.getlist('SelectedUsers')
_App_label,_Model = str(HttpRequest.POST['ContentType']).split('-')
_Record = int(HttpRequest.POST['RecordID'])
print _SelectedUsers,_App_label,_Model,_Record
result = UserRegFnxObj.AdduserData(_App_label,_Model,_Record,'test',_SelectedUsers,int(details['userid']),ip)
msglist.append(result)
HttpRequest.session[SESSION_MESSAGE] = msglist
HttpResponseRedirect('/userreg/users/')
except:
Logger.exception('[%s][%s] == EXCEPTION ==' % (ip, 'AddUserForReg'))
msglist.append('Some Error has occoured')
HttpRequest.session[SESSION_MESSAGE] = msglist
return HttpResponseRedirect('/message/')
开发者ID:jivjot,项目名称:tx2,代码行数:23,代码来源:UserRegViews.py
示例20: MarksUpdate
def MarksUpdate(HttpRequest):
msglist = AppendMessageList(HttpRequest)
ip = HttpRequest.META['REMOTE_ADDR']
logindetails = GetLoginDetails(HttpRequest)
print logindetails
if( logindetails["userid"] == -1):
msglist.append('Please Login to continue')
HttpRequest.session[SESSION_MESSAGE] = msglist
return HttpResponseRedirect('/user/login/')
try:
MarksObj=Marks()
flag=1
if "Id" in HttpRequest.POST:
Id=HttpRequest.POST["Id"]
else:
msglist.append("Error fetching data from form for SessionStart");
flag=-1;
if "SessionStart" in HttpRequest.POST:
SessionStart=HttpRequest.POST["SessionStart"]
else:
msglist.append("Error fetching data from form for SessionStart");
flag=-1;
if "SessionEnd" in HttpRequest.POST:
SessionEnd=HttpRequest.POST["SessionEnd"]
else:
msglist.append("Error fetching data from form for SessionEnd");
flag=-1;
if "SessionNumber" in HttpRequest.POST:
SessionNumber=HttpRequest.POST["SessionNumber"]
else:
msglist.append("Error fetching data from form for SessionNumber");
flag=-1;
if "SessionType" in HttpRequest.POST:
SessionType=HttpRequest.POST["SessionType"]
else:
msglist.append("Error fetching data from form for SessionType");
flag=-1;
if "TotaMarks" in HttpRequest.POST:
TotaMarks=HttpRequest.POST["TotaMarks"]
else:
msglist.append("Error fetching data from form for TotaMarks");
flag=-1;
if "SecuredMarks" in HttpRequest.POST:
SecuredMarks=HttpRequest.POST["SecuredMarks"]
else:
msglist.append("Error fetching data from form for SecuredMarks");
flag=-1;
if "TotalReappears" in HttpRequest.POST:
TotalReappears=HttpRequest.POST["TotalReappears"]
else:
msglist.append("Error fetching data from form for TotalReappears");
flag=-1;
if "ReappearsRemaining" in HttpRequest.POST:
ReappearsRemaining=HttpRequest.POST["ReappearsRemaining"]
else:
msglist.append("Error fetching data from form for ReappearsRemaining");
flag=-1;
if "DegreeType" in HttpRequest.POST:
DegreeType=HttpRequest.POST["DegreeType"]
else:
msglist.append("Error fetching data from form for DegreeType");
flag=-1;
if "Board" in HttpRequest.POST:
Board=HttpRequest.POST["Board"]
else:
msglist.append("Error fetching data from form for Board");
flag=-1;
if "Degree" in HttpRequest.POST:
Degree=HttpRequest.POST["Degree"]
else:
msglist.append("Error fetching data from form for Degree");
flag=-1;
if "UserId" in HttpRequest.POST:
UserId=HttpRequest.POST["UserId"]
else:
msglist.append("Error fetching data from form for UserId");
flag=-1;
if flag==-1:
HttpRequest.session[SESSION_MESSAGE] = msglist
return render_to_response("UserProfile/Message.html",{'mylist':msglist,})
result=MarksObj.UpdateMarks(Id,SessionStart, SessionEnd, SessionNumber, SessionType, TotaMarks, SecuredMarks, TotalReappears, ReappearsRemaining, DegreeType, Board, Degree, UserId,logindetails["userid"], ip)
msglist.append("result is %s"%result);
return render_to_response("UserProfile/Message.html",{'mylist':msglist,})
except Exception as inst:
print type(inst) # the exception instance
print inst.args # arguments stored in .args
print inst # __str__ allows args to printed directly
x, y = inst.args
print 'x =', x
print 'y =', y
开发者ID:sarvpriye98,项目名称:tx2-1,代码行数:94,代码来源:Marks.py.REMOTE.4186.py
注:本文中的tx2.Misc.MIscFunctions1.AppendMessageList类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论