Reputation: 733
I have this in urlconf
(r'^places/(\w+)/(\w+)/$', shopinfo),
View codes:
def shopinfo(request,c,s):
if c == 'eat':
shop=Eat.objects.get(slug=s)
nearby = Eat.objects.filter(location=shop.location.all()[0]).exclude(id=shop.id)
return render_to_response('shopinfo.html',{'s':shop,'c':c,'nearby':nearby,})
if c == 'shop':
shop=Shop.objects.get(slug=s)
nearby = Shop.objects.filter(location=shop.location.all()[0]).exclude(id=shop.id)
return render_to_response('shopinfo.html',{'s':shop,'c':c,'nearby':nearby,})
As you can see both of the view defs direct to that same html template ie 'shopinfo.html' but for 'eat' the page is all proper with right styling but when its for 'shop' then that same html page is all messed up and divs are all misplaced. This is very frustrating. I absolutely dont understand how can the same html page be displayed with so much difference and the worst part, I cant figure out whats the prob. Please help. I am struck in here. Thanks.
Upvotes: 0
Views: 93
Reputation: 783
It's almost impossible to say anything useful about this without the template as well as an example of a "good" and a "bad" rendering.
At this point, my only guess is that one of your shop objects' attributes contains unescaped html.
Upvotes: 1