From: Philippe N. <sw...@fr...> - 2004-06-17 16:43:44
|
On Thu, Jun 17, 2004 at 01:18:08PM -0300, Michel Thadeu wrote: > Hi guys! >=20 > I know there is a count() method for the *.select() object... I know > Philippe Normand write a patch to sum() function too, does anyone have > write a max() method? >=20 At revision 152, there doesn't seem to have any max(). > If no one had write the patch, i change my own copy of sqlobject (the > ultimate version in svn), but I don?t know how to write the patch :) I > can write folowing the Philippe example (the change was made based on > the Phillipe change, almost everything the same code), but before learn > how to write a patch, I want to know if is there a patch made... >=20 Well it's quite simple. Add a "max" method in main.SelectResults. This method has to build an SQL expression which is then passed to the "accumulate" method. In your case the SQL expression would be "MAX(%s)" % attribute I guess. Finally to produce the patch, use svn diff :) --=20 Philippe Normand | base-art dot net |