Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.

#1 March 27, 2008 00:56:37

D.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Loop Counter


I have a template that looks like such:

{% if object_list %}

{% for menu in object_list %}
<p>
<a href="{{ menu.get_absolute_slug }}">{{ menu.name }}</a><br />
Description: {{ menu.description }}
</p>

{% endfor %}

{% else %}

<p>No menus have been created yet, please check back soon.</p>

{% endif %}


Due to layout restrictions I would like to add "Page 1, 2" etc if
there are more then 7 menu items (e.g. display 7 items per page)

How would I go about this?

Thanks
Duncan

--~--~---------~--~----~------------~-------~--~----~
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
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en-~----------~----~----~----~------~----~------~--~---

Offline

#2 March 27, 2008 01:03:24

Brian A.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Loop Counter


On Mar 26, 6:56 pm, DuncanM <> wrote:
> I have a template that looks like such:
>
> {% if object_list %}
>
> {% for menu in object_list %}
> <p>
> <a href="{{ menu.get_absolute_slug }}">{{ menu.name }}</a><br />
> Description: {{ menu.description }}
> </p>
>
> {% endfor %}
>
> {% else %}
>
> <p>No menus have been created yet, please check back soon.</p>
>
> {% endif %}
>
> Due to layout restrictions I would like to add "Page 1, 2" etc if
> there are more then 7 menu items (e.g. display 7 items per page)
>
> How would I go about this?
>
> Thanks
> Duncan

Have you looked at Django's pagination?http://www.djangoproject.com/documentation/models/pagination/Brian
--~--~---------~--~----~------------~-------~--~----~
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
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en-~----------~----~----~----~------~----~------~--~---

Offline

#3 March 27, 2008 01:07:59

D.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Loop Counter


Ahh thanks very much

On Mar 27, 12:03 am, Brian Armstrong <> wrote:
> On Mar 26, 6:56 pm, DuncanM <> wrote:
>
>
>
> > I have a template that looks like such:
>
> > {% if object_list %}
>
> > {% for menu in object_list %}
> > <p>
> > <a href="{{ menu.get_absolute_slug }}">{{ menu.name }}</a><br />
> > Description: {{ menu.description }}
> > </p>
>
> > {% endfor %}
>
> > {% else %}
>
> > <p>No menus have been created yet, please check back soon.</p>
>
> > {% endif %}
>
> > Due to layout restrictions I would like to add "Page 1, 2" etc if
> > there are more then 7 menu items (e.g. display 7 items per page)
>
> > How would I go about this?
>
> > Thanks
> > Duncan
>
> Have you looked at Django's pagination?
>
>http://www.djangoproject.com/documentation/models/pagination/>
> Brian
--~--~---------~--~----~------------~-------~--~----~
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
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en-~----------~----~----~----~------~----~------~--~---

Offline

Board footer

Moderator control

Enjoy the 16th of December
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support