Re: date display problem?
model
class Offer(models.Model):
product_id = models.ForeignKey(Product)
merchant_id = models.ForeignKey(Merchant)
offer_id = models.AutoField(primary_key=True)
description = models.CharField(max_length=100,null=False)#Not NULL
effective_date = models.DateField()
expiration_date = models.DateField()
view.py
HTML = HTML + "<div>"
HTML = HTML + "<b>Offer Description : </b>"+offer.description+"<br>"
HTML = HTML + "<b>Coupon Number : </b>"+coupon_no.coupon_detail+"<br>"
HTML = HTML + "<b>Effective Date : </b>"+str(offer.effective_date)+"<br>"
HTML = HTML + "<b>Expiration Date : </b>"+str(offer.expiration_date)+"<br>"
HTML = HTML + "<hr>"
HTML = HTML + "</div>"
at the time of create offer i print variable for expiration and effective date in view it worked fine.
but in temlate it did't other fields displays.
effective date and expiration date not displaying on browser..
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/cTFKSlnEUEsJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home