[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gnue/forms samples/geas/person.gfd samples/inve...
From: |
Jason Cater |
Subject: |
gnue/forms samples/geas/person.gfd samples/inve... |
Date: |
Mon, 17 Jun 2002 20:57:35 -0400 |
CVSROOT: /home/cvs
Module name: gnue
Changes by: Jason Cater <address@hidden> 02/06/17 20:57:34
Modified files:
forms/samples/geas: person.gfd
forms/samples/inventory/forms: inv_maintenance.gfd
forms/samples/location/forms: county_maint.gfd
zip_coords_maint.gfd
zipcode_maint.gfd
forms/samples/track/forms: contact_manager.gfd
forms/samples/zipcode: zipcode.gfd
forms/src : GFParser.py
forms/src/GFObjects: GFEntry.py
Log message:
reworked the foreign_key support in <entry> tags: instead of
foreign_key & foreign_key_description, use fk_source, fk_key, and
fk_description (forms will implicitly convert old-style)
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/forms/samples/geas/person.gfd.diff?cvsroot=OldCVS&tr1=1.2&tr2=1.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/forms/samples/inventory/forms/inv_maintenance.gfd.diff?cvsroot=OldCVS&tr1=1.2&tr2=1.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/forms/samples/location/forms/county_maint.gfd.diff?cvsroot=OldCVS&tr1=1.3&tr2=1.4&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/forms/samples/location/forms/zip_coords_maint.gfd.diff?cvsroot=OldCVS&tr1=1.5&tr2=1.6&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/forms/samples/location/forms/zipcode_maint.gfd.diff?cvsroot=OldCVS&tr1=1.5&tr2=1.6&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/forms/samples/track/forms/contact_manager.gfd.diff?cvsroot=OldCVS&tr1=1.11&tr2=1.12&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/forms/samples/zipcode/zipcode.gfd.diff?cvsroot=OldCVS&tr1=1.20&tr2=1.21&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/forms/src/GFParser.py.diff?cvsroot=OldCVS&tr1=1.65&tr2=1.66&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/forms/src/GFObjects/GFEntry.py.diff?cvsroot=OldCVS&tr1=1.60&tr2=1.61&r1=text&r2=text
Patches:
Index: gnue/forms/samples/geas/person.gfd
diff -c gnue/forms/samples/geas/person.gfd:1.2
gnue/forms/samples/geas/person.gfd:1.3
*** gnue/forms/samples/geas/person.gfd:1.2 Sun Nov 4 22:21:11 2001
--- gnue/forms/samples/geas/person.gfd Mon Jun 17 20:57:34 2002
***************
*** 36,43 ****
</entry>
<label x="1" y="7" name="Label_3" text="Country"/>
<entry x="10" y="7" field="countrycode" name="countrycode" case="upper"
! width="10" style="dropdown" foreign_key="countrylookup.id"
! foreign_key_description="name">
<options>
<option name="tip" value="Country"/>
</options>
--- 36,43 ----
</entry>
<label x="1" y="7" name="Label_3" text="Country"/>
<entry x="10" y="7" field="countrycode" name="countrycode" case="upper"
! width="10" style="dropdown" fk_source="countrylookup" fk_key="id"
! fk_description="name">
<options>
<option name="tip" value="Country"/>
</options>
Index: gnue/forms/samples/inventory/forms/inv_maintenance.gfd
diff -c gnue/forms/samples/inventory/forms/inv_maintenance.gfd:1.2
gnue/forms/samples/inventory/forms/inv_maintenance.gfd:1.3
*** gnue/forms/samples/inventory/forms/inv_maintenance.gfd:1.2 Sun Nov 4
22:21:11 2001
--- gnue/forms/samples/inventory/forms/inv_maintenance.gfd Mon Jun 17
20:57:34 2002
***************
*** 44,51 ****
field="reorder_point" typecast="number"/>
<label x="16" y="9" name="Label_9" text="Quantity represented in "/>
<entry x="16" y="10" field="qty_unit" name="ntryqty_unit" width="10"
! style="dropdown" foreign_key="available_units.id"
! foreign_key_description="description"/>
</block>
</page>
<database provider="postgresql" dbname="devel" host="gnue" name="devel"
--- 44,51 ----
field="reorder_point" typecast="number"/>
<label x="16" y="9" name="Label_9" text="Quantity represented in "/>
<entry x="16" y="10" field="qty_unit" name="ntryqty_unit" width="10"
! style="dropdown" fk_source="available_units" fk_key="id"
! fk_description="description"/>
</block>
</page>
<database provider="postgresql" dbname="devel" host="gnue" name="devel"
Index: gnue/forms/samples/location/forms/county_maint.gfd
diff -c gnue/forms/samples/location/forms/county_maint.gfd:1.3
gnue/forms/samples/location/forms/county_maint.gfd:1.4
*** gnue/forms/samples/location/forms/county_maint.gfd:1.3 Fri Jan 4
09:59:07 2002
--- gnue/forms/samples/location/forms/county_maint.gfd Mon Jun 17 20:57:34 2002
***************
*** 21,28 ****
</entry>
<label x="12" y="1" name="Label_2" text="State"/>
<entry x="12" y="2" field="state" name="state" width="10" rows="10"
! style="dropdown" foreign_key="validator.state"
! foreign_key_description="description">
<options>
<option name="tip" value="The state in which the county is
located"/>
</options>
--- 21,28 ----
</entry>
<label x="12" y="1" name="Label_2" text="State"/>
<entry x="12" y="2" field="state" name="state" width="10" rows="10"
! style="dropdown" fk_source="validator" fk_key="state"
! fk_description="description">
<options>
<option name="tip" value="The state in which the county is
located"/>
</options>
Index: gnue/forms/samples/location/forms/zip_coords_maint.gfd
diff -c gnue/forms/samples/location/forms/zip_coords_maint.gfd:1.5
gnue/forms/samples/location/forms/zip_coords_maint.gfd:1.6
*** gnue/forms/samples/location/forms/zip_coords_maint.gfd:1.5 Thu Jan 10
11:51:18 2002
--- gnue/forms/samples/location/forms/zip_coords_maint.gfd Mon Jun 17
20:57:34 2002
***************
*** 29,36 ****
</entry>
<label x="23" y="1" name="Label_3" text="State"/>
<entry x="23" y="2" field="state" name="state" case="upper" width="15"
! rows="15" style="dropdown" foreign_key="validator.state"
! foreign_key_description="description">
<options>
<option name="tip" value="State"/>
</options>
--- 29,36 ----
</entry>
<label x="23" y="1" name="Label_3" text="State"/>
<entry x="23" y="2" field="state" name="state" case="upper" width="15"
! rows="15" style="dropdown" fk_source="validator" fk_key="state"
! fk_description="description">
<options>
<option name="tip" value="State"/>
</options>
Index: gnue/forms/samples/location/forms/zipcode_maint.gfd
diff -c gnue/forms/samples/location/forms/zipcode_maint.gfd:1.5
gnue/forms/samples/location/forms/zipcode_maint.gfd:1.6
*** gnue/forms/samples/location/forms/zipcode_maint.gfd:1.5 Sun Nov 4
22:21:11 2001
--- gnue/forms/samples/location/forms/zipcode_maint.gfd Mon Jun 17 20:57:34 2002
***************
*** 16,23 ****
<block name="zip" rows="10" datasource="zips">
<entry name="city" x="1" y="2" width="30" field="city" case="upper"/>
<entry x="32" y="2" field="state" name="state" width="10"
! style="dropdown" foreign_key="validator.state"
! foreign_key_description="description"/>
<entry x="42" y="2" field="zipcode" name="zip" max_length="5" width="7"
typecast="number"/>
</block>
--- 16,23 ----
<block name="zip" rows="10" datasource="zips">
<entry name="city" x="1" y="2" width="30" field="city" case="upper"/>
<entry x="32" y="2" field="state" name="state" width="10"
! style="dropdown" fk_source="validator" fk_key="state"
! fk_description="description"/>
<entry x="42" y="2" field="zipcode" name="zip" max_length="5" width="7"
typecast="number"/>
</block>
Index: gnue/forms/samples/track/forms/contact_manager.gfd
diff -c gnue/forms/samples/track/forms/contact_manager.gfd:1.11
gnue/forms/samples/track/forms/contact_manager.gfd:1.12
*** gnue/forms/samples/track/forms/contact_manager.gfd:1.11 Thu Nov 8
04:14:21 2001
--- gnue/forms/samples/track/forms/contact_manager.gfd Mon Jun 17 20:57:34 2002
***************
*** 116,130 ****
<label x="2" y="18" name="Label_6" rows="1" text="Assignment Status"/>
<entry x="2" y="19" field="assignment_status"
name="ntryAssignmentStatus" width="65" rows="1" style="dropdown"
! foreign_key="dtsrcAssignmentStatus.id"
foreign_key_description="status"/>
</block>
<block name="blckAddress" datasource="dtsrcaddress">
<box x="35" y="0" width="33" label="Address Information" name="Box_2"
height="11"/>
<label x="37" y="1" name="Label_7" rows="1" text="Address Type"/>
<entry x="37" y="2" field="address_type" name="ntryAddrContext"
! width="20" rows="1" style="dropdown"
foreign_key="dtsrcAddressType.id"
! foreign_key_description="description"/>
<button x="58" y="2" trigger="addrPrev" width="2" label="<"
name="Button_1" height="1"/>
<button x="60" y="2" trigger="addrNext" width="2" label=">"
--- 116,131 ----
<label x="2" y="18" name="Label_6" rows="1" text="Assignment Status"/>
<entry x="2" y="19" field="assignment_status"
name="ntryAssignmentStatus" width="65" rows="1" style="dropdown"
! fk_source="dtsrcAssignmentStatus" fk_key="id"
! fk_description="status"/>
</block>
<block name="blckAddress" datasource="dtsrcaddress">
<box x="35" y="0" width="33" label="Address Information" name="Box_2"
height="11"/>
<label x="37" y="1" name="Label_7" rows="1" text="Address Type"/>
<entry x="37" y="2" field="address_type" name="ntryAddrContext"
! width="20" rows="1" style="dropdown"
fk_source="dtsrcAddressType" fk_key="id"
! fk_description="description"/>
<button x="58" y="2" trigger="addrPrev" width="2" label="<"
name="Button_1" height="1"/>
<button x="60" y="2" trigger="addrNext" width="2" label=">"
***************
*** 152,159 ****
<block name="blckPhone" datasource="dtsrcphone">
<label x="2" y="12" name="Label_13" rows="1" text="Phone Type"/>
<entry x="2" y="13" field="phone_type" name="ntryPhoneContext"
! width="20" rows="1" style="dropdown"
foreign_key="dtsrcPhoneType.id"
! foreign_key_description="description"/>
<button x="23" y="13" trigger="phonePrev" width="2" label="<"
name="Button_5" height="1"/>
<button x="25" y="13" trigger="phoneNext" width="2" label=">"
--- 153,160 ----
<block name="blckPhone" datasource="dtsrcphone">
<label x="2" y="12" name="Label_13" rows="1" text="Phone Type"/>
<entry x="2" y="13" field="phone_type" name="ntryPhoneContext"
! width="20" rows="1" style="dropdown" fk_source="dtsrcPhoneType"
fk_key="id"
! fk_description="description"/>
<button x="23" y="13" trigger="phonePrev" width="2" label="<"
name="Button_5" height="1"/>
<button x="25" y="13" trigger="phoneNext" width="2" label=">"
***************
*** 179,186 ****
<block name="blckEmail" datasource="dtsrcemail">
<label x="37" y="12" name="Label_19" rows="1" text="Email Type"/>
<entry x="37" y="13" field="email_type" name="ntryEmailContext"
! width="20" rows="1" style="dropdown"
foreign_key="dtsrcEmailType.id"
! foreign_key_description="description"/>
<button x="58" y="13" trigger="emailPrev" width="2" label="<"
name="Button_9" height="1"/>
<button x="60" y="13" trigger="emailNext" width="2" label=">"
--- 180,187 ----
<block name="blckEmail" datasource="dtsrcemail">
<label x="37" y="12" name="Label_19" rows="1" text="Email Type"/>
<entry x="37" y="13" field="email_type" name="ntryEmailContext"
! width="20" rows="1" style="dropdown" fk_source="dtsrcEmailType"
fk_key="id"
! fk_description="description"/>
<button x="58" y="13" trigger="emailPrev" width="2" label="<"
name="Button_9" height="1"/>
<button x="60" y="13" trigger="emailNext" width="2" label=">"
Index: gnue/forms/samples/zipcode/zipcode.gfd
diff -c gnue/forms/samples/zipcode/zipcode.gfd:1.20
gnue/forms/samples/zipcode/zipcode.gfd:1.21
*** gnue/forms/samples/zipcode/zipcode.gfd:1.20 Fri May 3 19:07:18 2002
--- gnue/forms/samples/zipcode/zipcode.gfd Mon Jun 17 20:57:34 2002
***************
*** 1,41 ****
! <?xml version="1.0"?>
!
! <!-- GNUe Designer (0.1.0)
! Form saved on: 2001-11-04 22:12:53 -->
!
! <form width="42" title="ZIP Code Maintenance" height="17">
! <options>
! <option value="0.0.1" name="version"/>
! </options>
! <datasource prequery="" cache="5" database="gnue" name="zips"
! order_by="state,city" table="zipcode"/>
! <datasource prequery="" database="gnue" name="validator"
! order_by="description" table="state"/>
!
! <page name="Page_1">
! <block name="zip" rows="15" datasource="zips">
! <label x="1" y="1" name="Label_1" text="City"/>
! <entry name="city" x="1" y="2" width="15" field="city" case="upper"
required="">
! <options>
! <option name="tip" value="Full name of city"/>
! </options>
! </entry>
! <label x="17" y="1" name="Label_2" text="State"/>
! <entry x="17" y="2" field="state" style="dropdown" name="state"
width="15"
! foreign_key="validator.state"
! foreign_key_description="description">
! <options>
! <option name="tip" value="State"/>
! </options>
! </entry>
! <label x="33" y="1" name="Label_3" text="Zip"/>
! <entry x="33" y="2" field="zip" name="zip" max_length="5" width="5"
! typecast="number">
! <options>
! <option name="tip" value="US Postal Zip Code"/>
! </options>
! </entry>
! <scrollbar x="40" y="2" width="1" height="15"/>
! </block>
! </page>
! </form>
--- 1,41 ----
! <?xml version="1.0"?
!
! <!-- GNUe Designer (0.1.0)
! Form saved on: 2001-11-04 22:12:53 -->
!
! <form width="42" title="ZIP Code Maintenance" height="17">
! <options>
! <option value="0.0.1" name="version"/>
! </options>
! <datasource prequery="" cache="5" database="gnue" name="zips"
! order_by="state,city" table="zipcode"/>
! <datasource prequery="" database="gnue" name="validator"
! order_by="description" table="state"/>
!
! <page name="Page_1">
! <block name="zip" rows="15" datasource="zips">
! <label x="1" y="1" name="Label_1" text="City"/>
! <entry name="city" x="1" y="2" width="15" field="city" case="upper"
required="">
! <options>
! <option name="tip" value="Full name of city"/>
! </options>
! </entry>
! <label x="17" y="1" name="Label_2" text="State"/>
! <entry x="17" y="2" field="state" style="dropdown" name="state"
width="15"
! fk_source="validator" fk_key="state
! fk_description="description">
! <options>
! <option name="tip" value="State"/>
! </options>
! </entry>
! <label x="33" y="1" name="Label_3" text="Zip"/>
! <entry x="33" y="2" field="zip" name="zip" max_length="5" width="5"
! typecast="number">
! <options>
! <option name="tip" value="US Postal Zip Code"/>
! </options>
! </entry>
! <scrollbar x="40" y="2" width="1" height="15"/>
! </block>
! </page>
! </form>
Index: gnue/forms/src/GFObjects/GFEntry.py
diff -c gnue/forms/src/GFObjects/GFEntry.py:1.60
gnue/forms/src/GFObjects/GFEntry.py:1.61
*** gnue/forms/src/GFObjects/GFEntry.py:1.60 Mon Jun 17 20:18:16 2002
--- gnue/forms/src/GFObjects/GFEntry.py Mon Jun 17 20:57:34 2002
***************
*** 95,110 ****
--- 95,113 ----
# Convert deprecated attributes
# Numeric attributes (now typecast="..")
+ # DEPRECATED with 0.1.x
if hasattr(self,'numeric') and self.numeric:
del self.numeric
self.typecast = 'number'
# visibleCount attributes... (now rows="..")
+ # DEPRECATED with 0.1.x
if not hasattr(self, 'rows') and hasattr(self,'visibleCount'):
self.rows = self.visibleCount
del self.visibleCount
# Case attributes... (now case="..")
+ # DEPRECATED with 0.1.x
if hasattr(self,'uppercase') and self.uppercase:
del self.uppercase
self.case = 'upper'
***************
*** 112,124 ****
del self.lowercase
self.case = 'lower'
# Force 'label' styles into "readonly" mode
if self.style == 'label':
self.readonly = 1
self._queryable = 0
return GFValue._buildObject(self)
!
def initialize(self):
if self.typecast == 'number':
self._numeric = 1
--- 115,137 ----
del self.lowercase
self.case = 'lower'
+ # Foreign keys
+ # DEPRECATED with 0.4.x
+ if hasattr(self,'foreign_key') and self.foreign_key:
+ (self.fk_source, self.fk_key) = string.split(self.foreign_key,'.')
+ del self.foreign_key
+ if hasattr(self,'foreign_key_description') and
self.foreign_key_description:
+ self.fk_description = self.foreign_key_description
+ del self.foreign_key_description
+
+
# Force 'label' styles into "readonly" mode
if self.style == 'label':
self.readonly = 1
self._queryable = 0
return GFValue._buildObject(self)
!
def initialize(self):
if self.typecast == 'number':
self._numeric = 1
***************
*** 147,156 ****
self._block._dataSourceLink.referenceField(self.field, default)
self._bound = 1
! if hasattr(self,'foreign_key'):
! datasourceName,self.fieldName = string.split(self.foreign_key,'.')
! self.datasource = \
! self._block._form._datasourceDictionary[string.lower(datasourceName)]
if hasattr(self, 'queryDefault') and \
self.queryDefault != None and \
--- 160,178 ----
self._block._dataSourceLink.referenceField(self.field, default)
self._bound = 1
! if hasattr(self,'fk_source'):
! try:
! self.fk_key
! except NameError:
! raise "fk_source specified, but no fk_key"
!
! try:
! self.fk_description
! except NameError:
! self.fk_description = self.fk_key
!
! self._fk_datasource = \
! self._block._form._datasourceDictionary[string.lower(self.fk_source)]
if hasattr(self, 'queryDefault') and \
self.queryDefault != None and \
***************
*** 248,275 ****
# allowedValues
#
def allowedValues(self):
! if not self._allowedValues and hasattr(self,'datasource'):
! rs = self.datasource.createResultSet()
more = rs.firstRecord()
self._allowedValues = {"":""}
self._allowedValuesDescr = [""]
self._allowedValuesReverse = {"":""}
while more:
try:
! if hasattr(self,'foreign_key_description'):
! key = "%s" % rs.current.getField(self.fieldName)
! descr = "%s" % rs.current.getField(self.foreign_key_description)
!
! self._allowedValues[key] = descr
! self._allowedValuesDescr.append(descr)
! self._allowedValuesReverse[descr] = key
! else:
! # No descriptions defined
! self._allowedValues["%s" % rs.current.getField(self.fieldName)] =
""
except AttributeError:
! self._allowedValues[rs.current.getField(self.fieldName)] = None
more = rs.nextRecord()
- ## self._allowedValuesDescr.sort()
GDebug.printMesg (5,'Created for DropDown: %s' % self._allowedValues)
return (self._allowedValues, self._allowedValuesDescr)
--- 270,293 ----
# allowedValues
#
def allowedValues(self):
! if not self._allowedValues and hasattr(self,'_fk_datasource'):
! rs = self._fk_datasource.createResultSet()
more = rs.firstRecord()
self._allowedValues = {"":""}
self._allowedValuesDescr = [""]
self._allowedValuesReverse = {"":""}
while more:
try:
! key = "%s" % rs.current.getField(self.fk_key)
! descr = "%s" % rs.current.getField(self.fk_description)
!
! self._allowedValues[key] = descr
! self._allowedValuesDescr.append(descr)
! self._allowedValuesReverse[descr] = key
except AttributeError:
! # TODO: What's this for?
! self._allowedValues[rs.current.getField(self.fk_key)] = None
more = rs.nextRecord()
GDebug.printMesg (5,'Created for DropDown: %s' % self._allowedValues)
return (self._allowedValues, self._allowedValuesDescr)
Index: gnue/forms/src/GFParser.py
diff -c gnue/forms/src/GFParser.py:1.65 gnue/forms/src/GFParser.py:1.66
*** gnue/forms/src/GFParser.py:1.65 Thu Jun 13 12:10:10 2002
--- gnue/forms/src/GFParser.py Mon Jun 17 20:57:34 2002
***************
*** 212,218 ****
'BaseClass': GFObjects.GFEntry,
'Attributes': {
'name': {
! 'Required': 1,
'Unique': 1,
'Typecast': GTypecast.name },
'field': {
--- 212,218 ----
'BaseClass': GFObjects.GFEntry,
'Attributes': {
'name': {
! 'Required': 1,
'Unique': 1,
'Typecast': GTypecast.name },
'field': {
***************
*** 284,296 ****
'value': {
'Typecast': GTypecast.text },
'foreign_key': {
! 'Typecast': GTypecast.name },
'default': {
! 'Typecast': GTypecast.text },
'queryDefault':{
! 'Typecast': GTypecast.text },
! 'foreign_key_description': {
! 'Typecast': GTypecast.text },
'sloppyQuery': {
'Typecast': GTypecast.text },
'ignoreCaseOnQuery': {
--- 284,304 ----
'value': {
'Typecast': GTypecast.text },
'foreign_key': {
! 'Typecast': GTypecast.name,
! 'Deprecated': 'Use fk_source and fk_key instead.' },
! 'foreign_key_description': {
! 'Typecast': GTypecast.text,
! 'Deprecated': 'Use fk_description instead.' },
! 'fk_source': {
! 'Typecast': GTypecast.name },
! 'fk_key': {
! 'Typecast': GTypecast.name },
! 'fk_description': {
! 'Typecast': GTypecast.name },
'default': {
! 'Typecast': GTypecast.text },
'queryDefault':{
! 'Typecast': GTypecast.text },
'sloppyQuery': {
'Typecast': GTypecast.text },
'ignoreCaseOnQuery': {
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- gnue/forms samples/geas/person.gfd samples/inve...,
Jason Cater <=