[Zope] Sorting on integers

Albert Kinderman albert.kinderman@csun.edu
Wed, 15 Dec 1999 23:24:25 +0000


I am just learning to use Zope with MySQL.  One field in my database is
an integer, goal.  When I get a list of items from the database and sort
on goal, the sorting is alphabetical (15 before 2 before 23 before 5). 
How do I get the sort order to reflect the order of the integers?

In the dtml below, sqlgetleaders is the ZSQL method that returns the
list of leaders (lastname, firstname, goal) from the database.


<table>
<tr>
<td>Last Name</td>
<td>First Name</td>
<td>Goal</td>
</tr>

<dtml-in sqlgetleaders sort=goal>
 <TR> 
  <TD> <dtml-var lastname></TD>
  <TD> <dtml-var firstname></TD>
  <TD> <dtml-var goal></TD>
 </TR>
</table>

Al

-- 
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Albert Kinderman              California State University, Northridge
albert.kinderman@csun.edu     Department of Management Science