Logo Search packages:      
Sourcecode: zope-coreblog version File versions

def zope-coreblog-1.0::COREBlog::COREBlog::rev_day_entry_items (   self,
  count = 1,
  start_year = 0,
  start_month = 0,
  start_day = 0 
)

Return list of Entry,based on date(reversed indexing).

Definition at line 720 of file COREBlog.py.

00720                                                                                 :
        """Return list of Entry,based on date(reversed indexing)."""
      count = r2i(count,0)
      start_year = r2i(start_year,0)
      start_month = r2i(start_month,0)
      start_day = r2i(start_day,0)
        if start_year == 0 or start_month == 0 or start_day == 0:
            #Base date is today
            t = localtime(time())
            year = t[0]
            month = t[1]
            day = t[2]
        else:
            year = start_year
            month = start_month
            day = start_day

        ent_l = []
        if not self.datemap:
            #No entry...
            return ent_l
        c = 0
        day_l = []
        year_list = list(self.datemap.keys())
        year_list.sort()
        year_list.reverse()
        #start from 'year'
        if year != year_list[0]:
            for key in year_list:
                if key > year:
                    year_list.remove(key)

        for y_key in year_list:
            month_set = self.datemap[y_key]
            month_list = list(self.datemap[y_key].keys())
            month_list.sort()
            month_list.reverse()
            if year == y_key and month_list:
                #start from 'month'
                for m_key in month_list:
                    if m_key > month:
                        month_list.remove(m_key)
            for m_key in month_list:
                day_set = month_set[m_key]
                day_list = list(month_set[m_key].keys())
                day_list.sort()
                day_list.reverse()
                if year == y_key and month == m_key and day_list:
                    #start from 'day'
                    for d_key in day_list:
                        if d_key > day:
                            day_list.remove(d_key)
                for d_key in day_list:
                    day_l = list(day_set[d_key])
                    day_l.reverse()
                    for id in day_l:
                        obj = self.getEntry(id)
                        obj.__of__(self)
                        ent_l.append(obj)
                    c = c + 1
                    if c >= count:
                        break
                if c >= count:
                    break
            if c >= count:
                break

        return ent_l


    security.declareProtected(View, 'month_entry_items')
    def month_entry_items(self,count=1,year=0,month=0):


Generated by  Doxygen 1.6.0   Back to index