This is probably really basic stuff, but I just can't get my head
around it. Sorry if this has been asked and answered before, I tried
to look for it, but maybe I wasn't looking for the right thing.

So on my blog pages I want a list of previous entries. I'm mostly
using date based generic views, so what I'd like is to see the current
entry and links to the previous x entries in a sidebar.  I also want
them displayed on a more specialized front page, as well as a couple
of flatpages.

The natural thing to do seemed to be to write an inclusion tag.
Initially I simply wrote one that would return a slice of
Entry.objects.all(). This was easy enough.

However, this only displayed the last entries, not the previous
entries to the one being currently displayed.

So now I'm trying to make a more generic inclusion tag that takes
parameters, something like oldentries(current, offset), but this is
where I get stuck. How can I see which entry I'm currently looking at?
Is there a way to get its index number? I know I can get its ID, but
how to convert that into a useable number for the slice I can't figure
out.

Is there perhaps a much simpler way of doing this?

Thanks alot,
Björn


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to