Welcome to Squishdot Websites Squishdot How-To
 about
 search
 post article
 Documentation
 Mailing Lists
 Bug Tracking
 Development
 Installation
 Upgrading
 Download
 admin
 rdf

 main


Improvement suggestion: filtering by subjects
How-To Posted by on Friday June 22, 06:18PM, 2001
from the dept.

This small patch in SquishSite.py enables to filter lists of news by subject (means display news of a particular subject).

This small patch in SquishSite.py enables to filter lists of news by subject.
i.e. this DTML shows the news headlines from squishdot folder "news" which subject is "fun".


 
  

 


Of course, this does not alter usual Squishdot features, as far as I tested.

Edit the SquishSite.py file and change the "item_list" method with what follows:

  def item_list(self, subject = None):
    # """ returns latest articles """
    # Modif by Gilles Lenfant (subject filtering)
    currtime = int(time())
    l = map(lambda x, p=self: x.__of__(p), self.data.map(self.id_list(currtime)))
    if subject:
       return filter(lambda x, s=subject: x.subject==s, l)
    else:
      return l

Of course, the SquishDot team is strongly encouraged to include this in the next release.

Warning: this patch has been done on a Squishdot 1.0.0 ! Check if relevant for your version.

TIA for feedback.

--Gilles

<  |  >

 

Related Links

The Fine Print: The following comments are owned by whoever posted them.
( Reply )

Over 10 comments listed. Printing out index only.
Nah...
by on Monday June 25, 09:24AM, 2001
I wouldn't do it this way.

Since Squishdot is now a ZCatalog, it's much simpler and more flexible to use catalog queries to do this kind of thing.

For example, the above can be achieved, with no patching, as follows:






cheers,

Chris
[ Reply to this ]
  • Re: Nah... by on Sunday July 08, 09:02PM, 2001
    • Hmmm... by on Friday August 17, 06:11PM, 2001
      • Re: Hmmm... by on Sunday August 19, 09:59PM, 2001
        • TRACEBACK! ;-) by on Sunday August 19, 10:01PM, 2001
          • Re: TRACEBACK! ;-) by on Monday August 20, 12:05PM, 2001
      • Re: Hmmm... by on Sunday August 19, 10:03PM, 2001
        • :-( by on Sunday August 19, 11:05PM, 2001
          • Re: :-( by on Monday August 20, 11:32AM, 2001
        • try this... by on Monday August 20, 12:43PM, 2001
          • Re: try this... by on Wednesday August 22, 06:56AM, 2001
Re: Improvement suggestion: filtering by subjects
by on Sunday July 15, 06:28PM, 2001
I am slightly confused about this. I want to filter message posts. Where does the news object come from in Squishdot?
[ Reply to this ]
The Fine Print: The following comments are owned by whoever posted them.
( Reply )

Powered by Zope  Squishdot Powered
  "Any system that depends on reliability is unreliable." -- Nogg's Postulate
All trademarks and copyrights on this page are owned by their respective companies. Comments are owned by the Poster. The Rest ©1999 , ©2000-2002 .