当前位置: 首页>>代码示例>>Python>>正文


Python AppendMessageList.append方法代码示例

本文整理汇总了Python中tx2.Misc.MIscFunctions1.AppendMessageList.append方法的典型用法代码示例。如果您正苦于以下问题:Python AppendMessageList.append方法的具体用法?Python AppendMessageList.append怎么用?Python AppendMessageList.append使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在tx2.Misc.MIscFunctions1.AppendMessageList的用法示例。


在下文中一共展示了AppendMessageList.append方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: noticeitemIndex

# 需要导入模块: from tx2.Misc.MIscFunctions1 import AppendMessageList [as 别名]
# 或者: from tx2.Misc.MIscFunctions1.AppendMessageList import append [as 别名]
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,代码行数:34,代码来源:CommViews.py

示例2: MarksIndex

# 需要导入模块: from tx2.Misc.MIscFunctions1 import AppendMessageList [as 别名]
# 或者: from tx2.Misc.MIscFunctions1.AppendMessageList import append [as 别名]
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,代码行数:15,代码来源:Marks.py.REMOTE.4186.py

示例3: adminNoticeIndex

# 需要导入模块: from tx2.Misc.MIscFunctions1 import AppendMessageList [as 别名]
# 或者: from tx2.Misc.MIscFunctions1.AppendMessageList import append [as 别名]
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,代码行数:15,代码来源:AdminCommViews.py

示例4: GroupSecurity

# 需要导入模块: from tx2.Misc.MIscFunctions1 import AppendMessageList [as 别名]
# 或者: from tx2.Misc.MIscFunctions1.AppendMessageList import append [as 别名]
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,代码行数:33,代码来源:ContentTypeViews.py

示例5: GroupSecurity

# 需要导入模块: from tx2.Misc.MIscFunctions1 import AppendMessageList [as 别名]
# 或者: from tx2.Misc.MIscFunctions1.AppendMessageList import append [as 别名]
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,代码行数:29,代码来源:ContentTypeViews.py

示例6: GroupTypeIndex

# 需要导入模块: from tx2.Misc.MIscFunctions1 import AppendMessageList [as 别名]
# 或者: from tx2.Misc.MIscFunctions1.AppendMessageList import append [as 别名]
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,代码行数:28,代码来源:GroupTypeViews.py

示例7: ListAllStates

# 需要导入模块: from tx2.Misc.MIscFunctions1 import AppendMessageList [as 别名]
# 或者: from tx2.Misc.MIscFunctions1.AppendMessageList import append [as 别名]
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,代码行数:28,代码来源:StateViews.py

示例8: SessionTypeUpdate

# 需要导入模块: from tx2.Misc.MIscFunctions1 import AppendMessageList [as 别名]
# 或者: from tx2.Misc.MIscFunctions1.AppendMessageList import append [as 别名]
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,代码行数:37,代码来源:Marks.py.REMOTE.4186.py

示例9: DegreeUpdate

# 需要导入模块: from tx2.Misc.MIscFunctions1 import AppendMessageList [as 别名]
# 或者: from tx2.Misc.MIscFunctions1.AppendMessageList import append [as 别名]
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,代码行数:37,代码来源:Marks.py.LOCAL.4186.py

示例10: AdminIndex

# 需要导入模块: from tx2.Misc.MIscFunctions1 import AppendMessageList [as 别名]
# 或者: from tx2.Misc.MIscFunctions1.AppendMessageList import append [as 别名]
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,代码行数:18,代码来源:AdminInitializeViews.py

示例11: CreateNewStateIndex

# 需要导入模块: from tx2.Misc.MIscFunctions1 import AppendMessageList [as 别名]
# 或者: from tx2.Misc.MIscFunctions1.AppendMessageList import append [as 别名]
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,代码行数:19,代码来源:StateViews.py

示例12: DegreeTypeSelect

# 需要导入模块: from tx2.Misc.MIscFunctions1 import AppendMessageList [as 别名]
# 或者: from tx2.Misc.MIscFunctions1.AppendMessageList import append [as 别名]
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,代码行数:23,代码来源:Marks.py.REMOTE.4186.py

示例13: BoardSelect

# 需要导入模块: from tx2.Misc.MIscFunctions1 import AppendMessageList [as 别名]
# 或者: from tx2.Misc.MIscFunctions1.AppendMessageList import append [as 别名]
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,代码行数:23,代码来源:Marks.py.LOCAL.4186.py

示例14: GroupSecurityCreateIndex

# 需要导入模块: from tx2.Misc.MIscFunctions1 import AppendMessageList [as 别名]
# 或者: from tx2.Misc.MIscFunctions1.AppendMessageList import append [as 别名]
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,代码行数:35,代码来源:ContentTypeViews.py

示例15: noticeIndex

# 需要导入模块: from tx2.Misc.MIscFunctions1 import AppendMessageList [as 别名]
# 或者: from tx2.Misc.MIscFunctions1.AppendMessageList import append [as 别名]
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,代码行数:41,代码来源:CommViews.py


注:本文中的tx2.Misc.MIscFunctions1.AppendMessageList.append方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。