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

def zope-coreblog-1.0::COREBlog::COREBlog::month_entry_items (   self,
  count = 1,
  year = 0,
  month = 0 
)

Return list of Entry on the month.

Definition at line 791 of file COREBlog.py.

00791                                                       :
        """Return list of Entry on the month."""
      count = r2i(count,1)
        year = r2i(year,0)
        month = r2i(month,0)
        if year == 0 or month == 0:
            #Base date is today
            t = localtime(time())
            show_year = t[0]
            show_month = t[1]
        else:
            show_year = int(year)
            show_month = int(month)
        show_day = 1
        ent_l = []
        if not self.datemap:
            #No entry...
            return ent_l

        if not self.getExistingDateSet(show_year,show_month,show_day):
            #There is no entry on the date.
            #So we are going to find date has some entry.
            while not self.getExistingDateSet(show_year,show_month,show_day) and \
                year == show_year and month == show_month:
                show_year,show_month,show_day = get_tomorrow_t(show_year,show_month,show_day)
        if show_year != year or show_month != month:
            return []

        c_year = show_year
        c_month = show_month
        while c_year == show_year and c_month == show_month:
            day_l = list(self.getExistingDateSet(show_year,show_month,show_day))
            for id in day_l:
                obj = self.getEntry(id)
                ent_l.append(obj)
            c_year = show_year
            c_month = show_month
            #get 'tomorrow'
            show_year,show_month,show_day = get_tomorrow_t(show_year,show_month,show_day)
            while not self.getExistingDateSet(show_year,show_month,show_day) and \
                c_year == show_year and c_month == show_month:
                show_year,show_month,show_day = get_tomorrow_t(show_year,show_month,show_day)
        return ent_l


    security.declareProtected(View, 'month_archive_items')
    def month_archive_items(self,count=1,start_year=0,start_month=0):


Generated by  Doxygen 1.6.0   Back to index