本文整理汇总了Python中apps.dajax.core.Dajax.append方法的典型用法代码示例。如果您正苦于以下问题:Python Dajax.append方法的具体用法?Python Dajax.append怎么用?Python Dajax.append使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类apps.dajax.core.Dajax
的用法示例。
在下文中一共展示了Dajax.append方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: add_to_downloadpopup
# 需要导入模块: from apps.dajax.core import Dajax [as 别名]
# 或者: from apps.dajax.core.Dajax import append [as 别名]
def add_to_downloadpopup(request):
print "inside add_to_downloadpopup ^^^^^^^^^^^^^^^^^"
dajax = Dajax()
if isinstance(request.user,Reseller) and request.user.user_type == 'R':
dajax.assign('#download-items', 'innerHTML', '')
if 'download' in request.session:
print "inside the Add to Popup"
download_list = request.session['download']
print "Download List###########",download_list
if download_list:
dajax.assign('#download-count', 'innerHTML',
'''<span class="download_count download_delay_hover circle">{0}</span>'''.format(len(download_list)))
for download_item in download_list:
product = Product.objects.get(id=int(download_item['id']))
dajax.append('#download-items','innerHTML', '''
<tr id="downid_{5}" class="downloadItemsRow" >
<td class="downloaded_pro_name">
<div class="downloaded_thumb"><a href="/product-detail/{2}"><img src="{0}"
alt="{1}" class=""></a></div>
</td>
<td class="downloaded_pro_name">
<a href="javascript:;" alt="download"><span>{1}</span></a>
<label class="item_upc_code"><a href="/product-detail/{2}" alt="item_upc_code"><span>{3}</span></a><label>
</td>
<td class="downloaded_pro_name">
<a href="javascript:;" alt="download"><span>{4}</span></a>
</td>
<td class="downloaded_pro_name">
<span style="cursor:pointer" onclick="RemoveDownload_Item({5})" title="Remove"><i class="fa fa-remove"> Remove</i></span>
</td>
</tr>'''.format(product.prod_f_photo()[0], product.name, product.slug, product.upc, format(product.network_price,'.2f'),product.id))
else:
dajax.assign('#download-count', 'innerHTML',
'''<span class="download_count download_delay_hover circle">{0}</span>'''.format(len(download_list)))
dajax.assign(
'#download-items', 'innerHTML', '''<tr class="" >
<td class="downloaded_pro_name">
<a href="" alt="download"><span>Currently no items for downloading..!</span></a>
</td> </tr>''')
return dajax.json()
示例2: get_discount
# 需要导入模块: from apps.dajax.core import Dajax [as 别名]
# 或者: from apps.dajax.core.Dajax import append [as 别名]
def get_discount(request,product):
dajax = Dajax()
product = get_object_or_404(Product, id=int(product))
dajax.assign('#discount_rows', 'innerHTML', '')
discounts = product.discount.all().order_by('-id')
if discounts:
for counter,discount in enumerate(discounts):
if discount.is_active():
dajax.append('#discount_rows', 'innerHTML','''
<tr id="dis{5}">
<td>{0}</td>
<td>{1}</td>
<td>{2}%</td>
<td>{3}</td>
<td>{4}</td>
<td><a class="btn btn-success btn-icon btn-circle"><i class="fa fa-check"></i></a></td>
<td>
<button type="button" onclick="DeleteDiscount({5});" class="btn btn-sm btn-warning"><i class="fa fa-trash"></i> Delete</button>
</td>
</tr>
'''.format(counter+1,discount.name,discount.discount,discount.effe_date.strftime("%d %b %Y"),discount.expi_date.strftime("%d %b %Y"),discount.id))
else:
dajax.append('#discount_rows', 'innerHTML','''
<tr id="dis{5}">
<td>{0}</td>
<td>{1}</td>
<td>{2}%</td>
<td>{3}</td>
<td>{4}</td>
<td><a class="btn btn-danger btn-icon btn-circle"><i class="fa fa-times"></i></a></td>
<td>
<button type="button" onclick="DeleteDiscount({5});" class="btn btn-sm btn-warning"><i class="fa fa-trash"></i> Delete</button>
</td>
</tr>
'''.format(counter+1,discount.name,discount.discount,discount.effe_date.strftime("%d %b %Y"),discount.expi_date.strftime("%d %b %Y"),discount.id))
dajax.script('ShowDiscountTable();')
return dajax.json()
示例3: viewz_customer
# 需要导入模块: from apps.dajax.core import Dajax [as 别名]
# 或者: from apps.dajax.core.Dajax import append [as 别名]
def viewz_customer(request, cid=None):
dajax = Dajax()
print "inside tha ajax........"
customer = Customer.objects.get(id=int(cid))
dajax.assign("#man_id", "value", "")
dajax.assign("#birth_day_id", "value", "")
dajax.assign("#added_day", "value", "")
dajax.assign("#download_link", "innerHTML", "")
dajax.assign("#phone_numbers", "innerHTML", "")
dajax.assign("#custmor_name", "innerHTML", "")
dajax.assign("#man_id", "value", "{0}".format(customer.name))
dajax.assign("#birth_day", "value", "{0}".format(customer.birth_date))
dajax.assign("#added_day", "value", "{0}".format(customer.date))
dajax.append(
"#download_link",
"innerHTML",
"""<label>Download link</label><a href="{0}" download>click here</a>""".format(customer.policy),
)
dajax.append("#custmor_name", "innerHTML", """<span>{0}</span>""".format(customer.name))
count = 0
for phone in customer.phone.all():
count += 1
dajax.append(
"#phone_numbers",
"innerHTML",
"""<label>Phone Number {1}</label><input type="text" class="form-control" value="{0}" id="phone_numbers">""".format(
phone.phone_no, count
),
)
dajax.script("viewcutomer_modal();")
return dajax.json()