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

 main


Search by Date?
Squishdot Posted by Ryan Winfield Woodings on Wednesday July 25, 10:38PM, 2001
from the dept.
Is there a way to search articles and comments by date?

I would like to have a link on the leftbox that when clicked will show all posts from the last XX days. This is similar to 'Previous Articles', except that I want it to show comments as well. I've dug into the python code, but I'm inexperienced at python and have been unable to figure this out.

<  |  >

 

Related Links
  • Articles on Squishdot
  • Also by Ryan Winfield Woodings
  • Contact author
  • The Fine Print: The following comments are owned by whoever posted them.
    ( Reply )

    Re: Search by Date?
    by Navindra Umanee on Tuesday July 31, 04:46PM, 2001
    How about:
        # protected by 'View' permission
        def getAllPostings(self):
            postList = []
            for id in self.data.keys():
                obj = self.data[id]
                if obj.reviewed:
                   postList.append(obj.__of__(self))
            postList.reverse()
            return postList
    
    You can limit what it returns by using getAllPostings()[0:40] or something. Unfortunately it is very Zope intensive, which is why we generate the page statically on the dot.
    [ Reply to this ]
    • Please don't hurt Zope so much! ;-)
      by Chris Withers on Tuesday July 31, 05:09PM, 2001
      Ow!

      Why not just do:

      &lt;dtml-in "YourSquish(sort_on='Date', sort_order='reversed')[0:40])">

      ?!

      If you read up on ZCatalog searching, yuo can find otu how to use the same index to onyl return postings added within the last week or so.

      cheers,

      Chris

      [ Reply to this ]
      • Re: Please don't hurt Zope so much! ;-)
        by Navindra Umanee on Tuesday July 31, 05:54PM, 2001
        Ow! Looks cool, I didn't know about that. :)

        I was pulling my hair out trying to do it in a sane way in python and ending up with what you saw.

        Hmmm, unfortunately our site does not want to re-catalog. Something is broken that I'll have to track and fix eventually.

        Cheers,
        -N.
        [ Reply to this ]
      • Re: Please don't hurt Zope so much! ;-)
        by Rick Bartels on Wednesday August 01, 12:42AM, 2001
        Hey,

        I used your code and it worked for me, but what if I wanted to do something like this:



        How would I query by date using this search method?

        Thanks much,

        Rick
        [ Reply to this ]
        • Bah :-(
          by Chris Withers on Thursday August 02, 11:01AM, 2001
          Squishdot hate you looked-like-html stuff so I cant' tell.

          Try the squishdot@yahoogroups.com mailing list...

          cheers,

          Chris
          [ 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 Butch Landingin, ©2000-2002 Chris Withers.