當前位置: 首頁>>代碼示例>>Python>>正文


Python Dajax.alert方法代碼示例

本文整理匯總了Python中misc.dajax.core.Dajax.alert方法的典型用法代碼示例。如果您正苦於以下問題:Python Dajax.alert方法的具體用法?Python Dajax.alert怎麽用?Python Dajax.alert使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在misc.dajax.core.Dajax的用法示例。


在下文中一共展示了Dajax.alert方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: update_event

# 需要導入模塊: from misc.dajax.core import Dajax [as 別名]
# 或者: from misc.dajax.core.Dajax import alert [as 別名]
def update_event(request,form):
    dajax = Dajax()
    form = UpdateForm(deserialize_form(form))
    event_object = request.user.get_profile().event
    all_updates = Update.objects.filter(event=event_object)
    major_count = 0
    update_count = 0
    if form.is_valid():
        for u in all_updates:
            if u.category=='Updates' and u.expired is False:
                update_count = update_count + 1
                print update_count
            elif u.category=='Major Update' and u.expired is False:
                major_count = major_count + 1
                print major_count
            elif update_count>4 and u.category=='Updates':
                dajax.alert("This event already has 4 Updates.\
                    Please mark one update as Expired before adding a new update")
            elif major_count>1 and u.category=='Major Update':
                dajax.alert("This event already has one Major Update.\
                    Please mark the Major Update as Expired before adding another one")
    #Write to json here

    else :
        template = loader.get_template('events/home.html')
        t = template.render(RequestContext(request,locals()))
    return dajax.json()
開發者ID:ShaastraWebops,項目名稱:ERP14,代碼行數:29,代碼來源:ajax.py

示例2: hello

# 需要導入模塊: from misc.dajax.core import Dajax [as 別名]
# 或者: from misc.dajax.core.Dajax import alert [as 別名]
def hello(request, form=None):
    """
        Test dajax
    """
    dajax = Dajax()
    
    dajax.alert("got from dajax");
    
    return dajax.json()
開發者ID:PavithraNarayanaswamy,項目名稱:robocon_iitm,代碼行數:11,代碼來源:ajax.py

示例3: alerter

# 需要導入模塊: from misc.dajax.core import Dajax [as 別名]
# 或者: from misc.dajax.core.Dajax import alert [as 別名]
def alerter(request,**kwargs):
    print 'sssssssssssssssssss\n\n\n\n\n'
    dajax=Dajax()
    try:
        col=College(name=text1,city=text2,state=text3)
        col.save()
        #form['college']=col
    except:
        col=College.objects.get(name=text1)
        dajax.alert("Your college is already present")
    
    #return dajax.json()
    return simplejson.dumps({'message':'Added your college:: %s'% text1,'col':col})
開發者ID:gowtham-v,項目名稱:Shaastra_user,代碼行數:15,代碼來源:ajax.py


注:本文中的misc.dajax.core.Dajax.alert方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。