Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.
  • Root
  • » Django
  • » Appending a variable to the query string for the current URL [RSS Feed]

#1 March 9, 2008 19:05:05

s.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Appending a variable to the query string for the current URL


On each of my pages I want to show a link, which outputs the current
page in pdf. To do so I want to append ?pdf=1 or &pdf=1 to the current
url. I do so using the code

if request.META:
pdfpath = '%s&pdf=1' % request.get_full_path()
else:
pdfpath = '%s?pdf=1'% request.get_full_path()

and <a href="{{pdfpath}}"> in the template. Is there a simpler way?
(Some template tag maybe?)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en-~----------~----~----~----~------~----~------~--~---

Offline

  • Root
  • » Django
  • » Appending a variable to the query string for the current URL [RSS Feed]

Board footer

Moderator control

Enjoy the 11th of December
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support