Hi All,

I'm in the process of learning Django by example - creating a blog
application.
SO, I have my blog up and running using the date based generics but
would like to limit the number of posts that appear in the main archive
(/path/to/site/blog/) to 10, which i've done in the urls.py like so:
blog_dict = {
        'queryset': Post.objects.all().order_by('-publish_date')[:10],
        'date_field': 'publish_date',
}
urlpatterns = patterns('',
        (r'^/?$',  'django.views.generic.date_based.archive_index',
blog_dict),
#etc.
)

Now what I'm trying to figure out is how to have a view that will
display a certain number of posts (i.e the main page shows the 10
latest, a link on the page shows you the 10 before that, etc.)

What's the best way to go about this?
I know I'll have to use a queryset like 'queryset':
Post.objects.all().order_by('-publish_date')[a:b],
but how can I have the values of a and b taken from the url? (e.g.
/path/to/site/blog/11-20/ would show posts 11 to 20)

Any help greatly appreciated
--
bb


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to