On Wed, Mar 31, 2004 at 11:17:48AM +0800, Ng Pheng Siong wrote:
> On Wed, Mar 31, 2004 at 10:59:37AM +0800, Ng Pheng Siong wrote:
> > On Wed, Mar 31, 2004 at 11:37:51AM +0900, Atsushi Shibata wrote:
> > > See COREBlog.py line 770 :-).
> >
> > The blog entries are at the bottom of the page, but they appear to be in
> > standard chronological order, not reverse order?
>
> Okay, fixed.
>
> Added "l.reverse()" right before "return l" in method
> rev_category_entry_items.
Hi,
I've rewritten rev_category_entry_items as follows, to honour the 'count'
parameter.
def rev_category_entry_items(self,category_id,start=0,count=-1,consider_mode
ration = 1):
#Return list of Entry.
l = []
try:
int_cat = int(category_id)
except:
return []
list_c = len(self.entry_list)
#if count == -1:
# count = list_c
actual_count = count
count = list_c
for c in range(start,start+count):
if list_c <= c:
#index out of range
break
id = self.entry_list[c]
obj = self.getEntry(id)
if obj.category and obj.category[0] == int_cat:
if not consider_moderation or obj.moderated:
l.append(obj)
l.reverse()
if actual_count > 0:
return l[:actual_count]
else:
return l
Cheers.
--
Ng Pheng Siong <[EMAIL PROTECTED]>
http://firewall.rulemaker.net -+- Firewall Change Management & Version Control
http://sandbox.rulemaker.net/ngps -+- ZServerSSL/Zope Windows Installers
_______________________________________________
COREblog-en mailing list
[EMAIL PROTECTED]
http://munin.nbi.dk/cgi-bin/mailman/listinfo/coreblog-en