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

 main


Can I change the format of Article ID's to a date-formatted style?
How-To Posted by Pieter Biemond on Monday February 12, 03:22PM, 2001
from the can-anybody-help-me dept.
I would like to change the ID's of Squishdot articles to a YYYYMMDDZZZZ style (YYYY = Year, MM=Month, DD=Day, ZZZZ=ArticleID per day). Or even better: a format like YYYY/MM/DD/ZZZZ so that I can easily archive the messages of one year or one month. Can I do that easily? How?

<  |  >

 

Related Links
  • Articles on How-To
  • Also by Pieter Biemond
  • Contact author
  • The Fine Print: The following comments are owned by whoever posted them.
    ( Reply )

    Re: Can I change the format of Article ID's to a date-formatted style?
    by Darrick Wong on Sunday February 18, 10:50AM, 2001
    Given Squishdot's structure, I'd use YYYY-MM-DD-ZZZZ to avoid slash ('/') collisions. Furthermore, doing this isn't easy, since you'd have to go rewrite Squishdot to handle these new IDs.

    Idea--for Swishdot, why not make it so that one can easily change the format of these time stamps? Admins would specify an article ID timestamp format (either the 952352352 stuff or Biemond's proposed YMDZ format, or even a custom format) and then Squishdot would convert that into whatever the database uses internally.
    [ Reply to this ]
    Hack the Source :-)
    by Chris Withers on Monday February 19, 05:55PM, 2001
    Got futz with the createId method of the SquishSite class to do what you want. This is at line 512 of SquishSite.py in the current CVS checkout.

    Bear in mind this method must return an integer...

    Good luck,

    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.