commit-gnue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnue] r6910 - in trunk/gnue-appserver/samples: . testing testing/joins


From: johannes
Subject: [gnue] r6910 - in trunk/gnue-appserver/samples: . testing testing/joins
Date: Tue, 18 Jan 2005 02:20:13 -0600 (CST)

Author: johannes
Date: 2005-01-18 02:20:12 -0600 (Tue, 18 Jan 2005)
New Revision: 6910

Added:
   trunk/gnue-appserver/samples/testing/sorting.py
Modified:
   trunk/gnue-appserver/samples/sample.gfd
   trunk/gnue-appserver/samples/testing/joins/joins.py
Log:
Updated samples


Modified: trunk/gnue-appserver/samples/sample.gfd
===================================================================
--- trunk/gnue-appserver/samples/sample.gfd     2005-01-17 20:21:04 UTC (rev 
6909)
+++ trunk/gnue-appserver/samples/sample.gfd     2005-01-18 08:20:12 UTC (rev 
6910)
@@ -9,8 +9,11 @@
 
   <parameter name="von" default="2270-06-20 09:00"/>
   <parameter name="bis" default="2270-06-25 20:00"/>
-  <datasource name="dtsPerson" connection="appserver" table="address_person"
-    order_by="address_nextmeeting,address_zip">
+  <datasource name="dtsPerson" connection="appserver" table="address_person">
+    <sortorder>
+      <sortfield name="address_name" descending="True"/>
+      <sortfield name="address_zip" descending="False" />
+    </sortorder>
     <!--
     <condition>
       <and>

Modified: trunk/gnue-appserver/samples/testing/joins/joins.py
===================================================================
--- trunk/gnue-appserver/samples/testing/joins/joins.py 2005-01-17 20:21:04 UTC 
(rev 6909)
+++ trunk/gnue-appserver/samples/testing/joins/joins.py 2005-01-18 08:20:12 UTC 
(rev 6910)
@@ -50,6 +50,7 @@
     print "-" * 70
     print "Invoice   :", inv.number
     print "  Customer:", inv.customer.name
+    print "  Country :", repr (inv.customer.country)
     print "  Country :", inv.customer.country.address_name
 
   print "=" * 70

Added: trunk/gnue-appserver/samples/testing/sorting.py
===================================================================
--- trunk/gnue-appserver/samples/testing/sorting.py     2005-01-17 20:21:04 UTC 
(rev 6909)
+++ trunk/gnue-appserver/samples/testing/sorting.py     2005-01-18 08:20:12 UTC 
(rev 6910)
@@ -0,0 +1,48 @@
+# GNU Enterprise Application Server - Testing unit - Sorting
+#
+# Copyright 2003-2004 Free Software Foundation
+#
+# This file is part of GNU Enterprise.
+#
+# GNU Enterprise is free software; you can redistribute it 
+# and/or modify it under the terms of the GNU General Public 
+# License as published by the Free Software Foundation; either 
+# version 2, or (at your option) any later version.
+#
+# GNU Enterprise is distributed in the hope that it will be 
+# useful, but WITHOUT ANY WARRANTY; without even the implied 
+# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
+# PURPOSE. See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public 
+# License along with program; see the file COPYING. If not, 
+# write to the Free Software Foundation, Inc., 59 Temple Place 
+# - Suite 330, Boston, MA 02111-1307, USA.
+#
+# $Id$
+
+from gnue.appserver.language import App
+
+
+def runFind (session, order = [], plist = None):
+
+  fields = ['address_name', 'address_street', 'address_zip']
+  if plist: fields.extend (plist)
+
+  for guy in session.find ('person', [], order, fields):
+    print "%-35s|%-35s" % (guy.nextmeeting, guy.name)
+
+
+if __name__ == "__main__":
+  app = App.App ()
+
+  print "requesting new session ..."
+  session = app.newSession ('test', 'test')
+
+  session.setcontext ('address')
+
+  #print "-" * 70
+  #runFind (session, ['address_name'])
+
+  print "-" * 70
+  runFind (session, [('address_nextmeeting', False), 'address_name'])


Property changes on: trunk/gnue-appserver/samples/testing/sorting.py
___________________________________________________________________
Name: svn:keywords
   + Id





reply via email to

[Prev in Thread] Current Thread [Next in Thread]