[Zope] Need help w/Custom Memberdata - Birthdays and date format
Kevin Carlson
khcarlso at bellsouth.net
Mon Aug 18 15:00:53 EDT 2003
Jim Barbara wrote:
>
>The problem is that I cannot get the birthday date
>string data formatted with just Month, Day
>
>
>
Look into the strftime method. It can format dates however you like to
see them.
>and
>
>I have no idea as to how to sort this data my month.
>
>
As for sorting, you can call a list objects sort function and pass a
comparison function as an argument. Define this sort function in the
same script as your getMember script, if you'd like. Something like:
def memberCompare(a, b) :
#you'll get two list items from roster as a and b.
# compare and return -1, 0 or 1.
...rest of getMembers..then...
return roster.sort(memberCompare)
Hope that helps.
More information about the Zope
mailing list