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

 main


Sorting Problems
Squishdot Posted by Stoons - Thomas Søndergaard on Thursday October 19, 09:58AM, 2000
from the dept.
I am (was) having some touble with the sorting of the news on http://community.3dfestival.com

I am (was) having some touble with the sorting of the news on http://community.3dfestival.com If you check it out just select "news" and you will see.... I know what is wrong: "9/10/2000" is considered less than "11/10/2000" if you are comparing strings.... I fixed this problem by changing squishdot.py and squishfile.py # protected by 'View' permission def date_created(self): # """ date article was created """ t=localtime(self.created) return '%d/%d/%d' % (t[1],t[2],t[0]) and # protected by 'View' permission def date_created(self): t=time.localtime(self._created) return '%d/%d/%02d %02d:%02d' % (t[1],t[2],t[0],t[3],t[4]) # protected by 'View' permission def date_modified(self): t=time.localtime(self._modified) return '%d/%d/%02d %02d:%02d' % (t[1],t[2],t[0],t[3],t[4]) to # protected by 'View' permission def date_created(self): # """ date article was created """ t=localtime(self.created) return '%02d/%02d/%02d' % (t[1],t[2],t[0]) and # protected by 'View' permission def date_created(self): t=time.localtime(self._created) return '%02d/%02d/%02d %02d:%02d' % (t[1],t[2],t[0],t[3],t[4]) # protected by 'View' permission def date_modified(self): t=time.localtime(self._modified) return '%02d/%02d/%02d %02d:%02d' % (t[1],t[2],t[0],t[3],t[4]) but I want to be absolutely sure that it is all ok... therefore I am bothering you with this mail... Could you please answer me if it is all ok to use these changes (I know it is Open Source, but I am asking just to be sure....) Thomas Søndergaard @ StoonsDesign PS You might want to use these changes in future releases = )

<  |  >

 

Related Links
  • Articles on Squishdot
  • Also by Stoons - Thomas Søndergaard
  • Contact author
  • The Fine Print: The following comments are owned by whoever posted them.
    ( Reply )

    Re: Sorting Problems
    by Stoons - Thomas Søndergaard on Thursday October 19, 10:07AM, 2000
    This is how it is supposed to be looking = )


    I am (was) having some touble with the sorting of the news on http://community.3dfestival.com

    If you check it out just select "news" and you will see....



    My trouble is that we had hired a guy (no names) who said he knew stuff about
    Zope... He did know a bit, but not much... he could not fix the trouble with the
    news....



    I know what is wrong: "9/10/2000" is considered less than "11/10/2000"
    if you are comparing strings....



    I fixed this problem by changing squishdot.py and squishfile.py



    # protected by 'View' permission

    def date_created(self):

    # """ date article was created """

    t=localtime(self.created)

    return '%d/%d/%d' % (t[1],t[2],t[0])



    and



    # protected by 'View' permission

    def date_created(self):

    t=time.localtime(self._created)

    return '%d/%d/%02d %02d:%02d' % (t[1],t[2],t[0],t[3],t[4])



    # protected by 'View' permission

    def date_modified(self):

    t=time.localtime(self._modified)

    return '%d/%d/%02d %02d:%02d' % (t[1],t[2],t[0],t[3],t[4])

    to



    # protected by 'View' permission

    def date_created(self):

    # """ date article was created """

    t=localtime(self.created)

    return '%02d/%02d/%02d' % (t[1],t[2],t[0])

    and



    # protected by 'View' permission

    def date_created(self):

    t=time.localtime(self._created)

    return '%02d/%02d/%02d %02d:%02d' % (t[1],t[2],t[0],t[3],t[4])



    # protected by 'View' permission

    def date_modified(self):

    t=time.localtime(self._modified)

    return '%02d/%02d/%02d %02d:%02d' % (t[1],t[2],t[0],t[3],t[4])


    but I want to be absolutely sure that it is all ok... therefore I am bothering
    you with this mail... Could you please answer me if it is all ok to use these
    changes (I know it is Open Source, but I am asking just to be sure....)



    Thomas Søndergaard @ StoonsDesign



    PS You might want to use these changes in future releases = )


    [ Reply to this ]
    Re: Sorting Problems
    by Stoons - Thomas Søndergaard on Monday October 23, 10:53AM, 2000
    I fixed the problem = ) without changing any python....

    Stoonsdesign = )
    [ 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.