Object not iterable with django's pagination -


Showing a list of events I'm using common ideas to prepare a list of events, and Setting the 'paginate_by' parameter. It's amazing that when I load my page, I see:

  An exception has been caught in TemplateSyntaxError at / event / latest / rendering: 'int' object is not iterable < / Code> 

Pagination.html In the ninth row of the template:

  {% if_paginated%} {% load i18n%} & lt; Div class = "pagination" & gt; {% If page_obj.has_previous%} & lt; A href = "? Page = {{page_obj.previous_page_number}} {{getvars}}" class = "previous" & gt; & Amp; Amp; Lt; & Amp; the lift; Previous & lt; / A & gt; {% Else%} & lt; Span class = "pre-enabled" & gt; & Amp; Amp; Lt; & Amp; Lt; Previous & lt; / Span & gt; {% Endif%} #% {% page for page%} {% page if%} {% worth page page_bz.number%} & lt; Span class = "current page" & gt; {{Pages}} & lt; / Span & gt; {% Else%} & lt; A href = "page = {{page}} {{getvars}}" square = "page" & gt; {{Pages}} & lt; / A & gt; {% Endifequal%} {% else%} ... {% endif%} {% endfor%} {% if page_obj.has_next%} & lt; A href = "? Page = {{page_obj.next_page_number}} {{getvars}}" class = "next" & gt; Next & amp; Gt; & Amp; Gt; & Lt; / A & gt; {% Else%} & lt; Span class = "next disabled" & gt; Next & amp; Gt; & Amp; ;; & Lt; / Span & gt; {% Endif%} & lt; / Div & gt; {% Endif%}  

This is my view:

  def events_nearest (requested): events = Event.nearest.all () return object_list (request ), Queryset = events, extra_context = {'title': 'closest events'}, paginate_by = 12, template_name = 'event / events_date.html')  

and models:

category closest manager (models.Manager): def get_query_set (self): return super (closest manager, self) .get_query_set (). Order_by ('- data') class event (models.Model): Category = Model = Model about Textfield () city = model Exotic (model) objects = models Manager () Closest = Nearest Manager ()

Any ideas which may be due to this?

Your error in line # 9 {% for pages in page%} This is what pages

can not see anywhere in your code.


Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -