Re: Why is this view not displaying data?
Thanks Karen! That did the trick. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Why is this view not displaying data?
On Sun, Sep 27, 2009 at 8:41 PM, jeffself wrote: > > Here's my url.py: > > from django.conf.urls.defaults import * > > urlpatterns = patterns('Rankings.college.views', >url(r'^rankings/division/(\w+)/$', 'rankings_by_league'), > ) > > views.py > > def rankings_by_league(request, league): >try: >league = League.objects.get(slug__iexact=league) >except League.DoesNotExist: >raise Http404 > >return list_detail.object_list( >request, >queryset = SchoolSeason.objects.all(), >template_name = "college/rankings_by_league.html", >template_object_name = "rankings", >extra_context = {"league": league} >) > > rankings_by_league.html > {% extends "base.html" %} > > {% block title %}My rankings {% endblock %} > > {% block content %} > > 2009 {{ league.league_name }} Rankings > > >{% for ranking in rankings %} >{{ ranking.school.school_name}} {{ ranking.wins}} > {{ ranking.losses}} {{ ranking.rating}} >{% endfor %} > > > {% endblock %} > > I've spent my entire Sunday looking at this and can't figure it out. > Only thing that displays is the tag. > Doc here: http://docs.djangoproject.com/en/dev/ref/generic-views/#django-views-generic-list-detail-object-list states that _list will be appended to the value of your template_object_name to create the variable name used in the context. So try iterating through rankings_list. Karen --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Why is this view not displaying data?
Here's my url.py: from django.conf.urls.defaults import * urlpatterns = patterns('Rankings.college.views', url(r'^rankings/division/(\w+)/$', 'rankings_by_league'), ) views.py def rankings_by_league(request, league): try: league = League.objects.get(slug__iexact=league) except League.DoesNotExist: raise Http404 return list_detail.object_list( request, queryset = SchoolSeason.objects.all(), template_name = "college/rankings_by_league.html", template_object_name = "rankings", extra_context = {"league": league} ) rankings_by_league.html {% extends "base.html" %} {% block title %}My rankings {% endblock %} {% block content %} 2009 {{ league.league_name }} Rankings {% for ranking in rankings %} {{ ranking.school.school_name}} {{ ranking.wins}} {{ ranking.losses}} {{ ranking.rating}} {% endfor %} {% endblock %} I've spent my entire Sunday looking at this and can't figure it out. Only thing that displays is the tag. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Not displaying data...
I have the following code, http://dpaste.com/73388/ For some reason the data in the rows is not displaying, there are the correct number of rows in each table so the for tag is working correctly. Any ideas why the content is not displaying? --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Not displaying data...
Actually I was completely wrong, I figured it out though and it is working properly now. thnx! On Aug 23, 12:37 pm, DailyPuppyGuy <[EMAIL PROTECTED]> wrote: > Should you have: > > {{ object.start_date }} > > instead of just: > > {{ start_date }} > > ?? > > On Aug 23, 11:29 am, [EMAIL PROTECTED] wrote: > > > > > Actually. I was wrong. It is not displaying the right number of > > rows... > > > On Aug 23, 11:06 am, [EMAIL PROTECTED] wrote: > > > > I have the following code,http://dpaste.com/73388/ > > > > For some reason the data in the rows is not displaying, there are the > > > correct number of rows in each table so the for tag is working > > > correctly. Any ideas why the content is not displaying?- Hide quoted text > > > - > > - Show quoted text - --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Not displaying data...
Should you have: {{ object.start_date }} instead of just: {{ start_date }} ?? On Aug 23, 11:29 am, [EMAIL PROTECTED] wrote: > Actually. I was wrong. It is not displaying the right number of > rows... > > On Aug 23, 11:06 am, [EMAIL PROTECTED] wrote: > > > I have the following code,http://dpaste.com/73388/ > > > For some reason the data in the rows is not displaying, there are the > > correct number of rows in each table so the for tag is working > > correctly. Any ideas why the content is not displaying? --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Not displaying data...
Actually. I was wrong. It is not displaying the right number of rows... On Aug 23, 11:06 am, [EMAIL PROTECTED] wrote: > I have the following code,http://dpaste.com/73388/ > > For some reason the data in the rows is not displaying, there are the > correct number of rows in each table so the for tag is working > correctly. Any ideas why the content is not displaying? --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---