Re: Help passing the url

2020-04-10 Thread Irfan Khan
Hi, Need to pass id in function as parameter as well as in that post obj On Tue, 7 Apr 2020 at 1:23 AM, Luka Nik wrote: > How do I pass it exactly? > > On Mon, 6 Apr 2020, 9:41 pm ola neat, wrote: > >> You need to add the id as argument in the function >> >> On Mon, Apr 6, 2020, 19:17 Luka

Re: Help passing the url

2020-04-06 Thread Luka Nik
How do I pass it exactly? On Mon, 6 Apr 2020, 9:41 pm ola neat, wrote: > You need to add the id as argument in the function > > On Mon, Apr 6, 2020, 19:17 Luka Nik wrote: > >> How can I alter this post_detail function: >> >> >> def post_detail(request): >> >> post = get_object_or_404(Post)

Re: Help passing the url

2020-04-06 Thread ola neat
You need to add the id as argument in the function On Mon, Apr 6, 2020, 19:17 Luka Nik wrote: > How can I alter this post_detail function: > > > def post_detail(request): > > post = get_object_or_404(Post) > comments = post.comments.filter(active=True) > new_comment = None > if

Help passing the url

2020-04-06 Thread Luka Nik
How can I alter this post_detail function: def post_detail(request): post = get_object_or_404(Post) comments = post.comments.filter(active=True) new_comment = None if request.method == 'POST': comment_form = CommentForm(data=request.POST) if

Re: passing '&' in url

2012-02-28 Thread Tom Evans
On Tue, Feb 28, 2012 at 11:13 AM, vijay shanker wrote: > i need to pass " & " as query e.g q=larsen & turbo > urlencode does not works as finally its as good as without it for > above eg. > please suggest. > >>> from django.http import QueryDict >>> qstring = QueryDict('',

passing '&' in url

2012-02-28 Thread vijay shanker
i need to pass " & " as query e.g q=larsen & turbo urlencode does not works as finally its as good as without it for above eg. please suggest. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: Passing optional URL params to reverse() function

2009-08-11 Thread nabucosound
Hi Malcolm, Thanks for your answer. Somehow I had a shortcircuit in my brain yerterday that made me try to do an impossible upon the framework, that is, using the same GET response with the same URL after an HTTP redirect, rendering extra information if extra params in the URLconf url were

Re: Passing optional URL params to reverse() function

2009-08-10 Thread Malcolm Tredinnick
On Mon, 2009-08-10 at 11:28 -0700, nabucosound wrote: > Hi all: > > I have a URLconf url entry like this: > > > url( > regex=r'^(?P\w+)/(?P[-\w]+)/$', > view='show_post', > name='show_post', > kwargs={'msg': None}, > ), > > > and I want to call it with

Passing optional URL params to reverse() function

2009-08-10 Thread nabucosound
Hi all: I have a URLconf url entry like this: url( regex=r'^(?P\w+)/(?P[-\w]+)/$', view='show_post', name='show_post', kwargs={'msg': None}, ), and I want to call it with HttpResponseRedirect and reverse(): filters = {'category': post.category.name, 'slug':

Passing optional URL params to reverse() function

2009-08-10 Thread nabucosound
Hi all: I have a URLconf url entry like this: url( regex=r'^(?P\w+)/(?P[-\w]+)/$', view='show_post', name='show_post', kwargs={'msg': None}, ), and I want to call it with HttpResponseRedirect and reverse(): filters = {'category': post.category.name,