On Apr 21, 1:25 pm, Oto Brglez <otobrg...@gmail.com> wrote: > Hi all you coders outthere! > > I want to search for data in my database. Thats all fine. > I just need help with quetys in urls... > > I want to have link like this: > /search/q=cars > /search/q=car+red+blue > /search/q=my+search+query > > The problem is that i don't know what to write inside urls.py. > What should i write in urls so that its passed to view as plain text? > > Thanx for your responses and have a nice day! > Oto Brglez
Don't do it like that. For a search, pass it as a proper GET variable (note the question mark): /search/?q=cars /search/?q=car+red+blue That way, you don't need to put any variables in your urls.py, and you can get the value of the q parameter in your view by doing request.GET ['q'] Another reason to do it like this is that if you have a form with a method='get' the result will be passed this way automatically. -- DR. --~--~---------~--~----~------------~-------~--~----~ 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 django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---