Re: NoReverseMatch Error

2012-08-24 Thread Syam Palakurthy
Hi, Can you please elaborate on how to use this block in the template code? 
 I've tried adding this into my details template code in various places and 
cannot get it to successfully work.  Also, any suggestions/examples you 
could point me to would be much appreciated.

{{ poll.question }}

{% if error_message %}{{ error_message }}{% endif %}


{% import url from future %}


{% csrf_token %}
{% for choice in poll.choice_set.all %}


{{ choice.choice_text 
}}
{% endfor %}



Thanks,
Syam

On Wednesday, August 15, 2012 4:53:23 AM UTC-7, Karen Tracey wrote:
>
> On Tue, Aug 14, 2012 at 10:46 AM, Serge G. Spaolonzi 
> 
> > wrote:
>
>> Try removing the quotes from 'polls.views.vote':
>>
>> 
>>
>>
>>
> Note that will work for 1.4 but it's doing things the old way, and that 
> will break in 1.5. Much better to add {% import url from future %} and have 
> code that will continue to work with the next release of Django. Removing 
> the quotes is not the best approach at this time.
>  
> Karen
> -- 
> http://tracey.org/kmt/
>
>

-- 
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/-/La3h_D5OnOQJ.
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.



Re: NoReverseMatch Error

2012-08-13 Thread Syam Palakurthy
Hi - I could not find any explanation that fixed the problem, until I ran 
across this person's abridged Django 
tutorial: 
http://tony.abou-assaleh.net/web-development/stripped-down-django-tutorial

It's basically a line in the details template, which should be:




Instead of:




I'm not sure why this fixed the issue, but it did for me.  I'd love an 
explanation if anyone has one.

Thanks,
Syam

On Thursday, June 9, 2011 12:28:30 AM UTC-7, bh.hoseini wrote:
>
> hi there,
> this is my views.py that doesn't have any problem:
>  
> from django.shortcuts import get_object_or_404, render_to_response
> from django.core.urlresolvers import reverse
> .
> .
> .
> return HttpResponseRedirect(reverse('polls.views.results', args=(
> p.id,)))
>
> def results(request, poll_id):
> p = get_object_or_404(Poll, pk=poll_id)
> return render_to_response('(...)/polls/results.html', {'poll': p})
>
> 
> but when i edit my urls.py like this:
>
> #...
> urlpatterns = patterns('',
> (r'^$',
> ListView.as_view(
> queryset=Poll.objects.order_by('-pub_date')[:5],
> context_object_name='latest_poll_list',
> template_name='(...)polls/index.html')),
> (r'^(?P\d+)/$',
> DetailView.as_view(
> model=Poll,
> template_name='(...)polls/detail.html')),
> url(r'^(?P\d+)/results/$',
> DetailView.as_view(
> model=Poll,
> template_name='(...)polls/results.html'),
> name='poll_results'),
> (r'^(?P\d+)/vote/$', 'polls.views.vote'),
>
> --
> and open my browser with the link (http://localhost:8000/polls/id=1/vote), 
> I'd face this error: can anybody help please?
>
> Reverse for 'polls.views.results' with arguments '(id=1,)' and keyword 
> arguments '{}' not found.
>
> can anybody help?
>
>
>

-- 
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/-/2MW2j_RVlfYJ.
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.