[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gnue/designer/src/forms/wizards CreateSchema.py
From: |
Jason Cater |
Subject: |
gnue/designer/src/forms/wizards CreateSchema.py |
Date: |
Fri, 04 Apr 2003 21:48:17 -0500 |
CVSROOT: /cvsroot/gnue
Module name: gnue
Changes by: Jason Cater <address@hidden> 03/04/04 21:48:17
Modified files:
designer/src/forms/wizards: CreateSchema.py
Log message:
disabling schema generator from form support for release
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/designer/src/forms/wizards/CreateSchema.py.diff?tr1=1.11&tr2=1.12&r1=text&r2=text
Patches:
Index: gnue/designer/src/forms/wizards/CreateSchema.py
diff -c gnue/designer/src/forms/wizards/CreateSchema.py:1.11
gnue/designer/src/forms/wizards/CreateSchema.py:1.12
*** gnue/designer/src/forms/wizards/CreateSchema.py:1.11 Wed Jan 1
19:45:46 2003
--- gnue/designer/src/forms/wizards/CreateSchema.py Fri Apr 4 21:48:17 2003
***************
*** 46,84 ****
###############
#
- # Define some settings, which could be configured
- #
-
- # the DEFAULT data type
- DEFAULT_TYPE="varchar"
-
- # the data type for numeric fields
- NUMERIC_TYPE="int"
-
- # the data type for text fields
- TEXT_TYPE="text"
-
- # the data type for string/char/varchar fields
- STRING_TYPE="varchar"
-
- # the data type for date fields
- DATE_TYPE="date"
-
- # the data type for boolean fields
- DATE_TYPE="boolean"
-
- # The default length of varchar fields in a database
- DEFAULT_SIZE = 30
-
-
- ###############
- #
# Initialize any runtime variables
#
def Start(self, root, current):
self.form = root
self.current = current
!
return 0
--- 46,57 ----
###############
#
# Initialize any runtime variables
#
def Start(self, root, current):
self.form = root
self.current = current
!
return 0
***************
*** 88,94 ****
#
def GetStep(self, step):
! # 0 - Get name / Source (existing datasource, new
# bound datasource, fixed set of choices)
# 1 - Select / Create Source
--- 61,67 ----
#
def GetStep(self, step):
! # 0 - Get name / Source (existing datasource, new
# bound datasource, fixed set of choices)
# 1 - Select / Create Source
***************
*** 97,111 ****
#
if step == '0':
! content = [WizardText('This will create a GNUe schema definition '+
! 'according to the needs of this form.'),
! WizardInput('file',label='File Name:',required=1,size=20)]
return { 'title': 'Create Schema Definition',
'content': content,
'prev': None,
'next': None }
!
###############
#
--- 70,84 ----
#
if step == '0':
! content = [WizardText(_('This will create a GNUe schema definition '+
! 'according to the needs of this form.')),
! WizardInput('file',label=_('Write to
File:'),required=1,size=20)]
return { 'title': 'Create Schema Definition',
'content': content,
'prev': None,
'next': None }
!
###############
#
***************
*** 141,149 ****
self.form.walk(self.PopulateSchema)
dest = open(self.variables['file'],"w")
!
dest.write("""<?xml version="1.0"?>
! <!-- Schema definition created by GNUe Designer's
"Create Schema from Form" plugin -->
""")
--- 114,122 ----
self.form.walk(self.PopulateSchema)
dest = open(self.variables['file'],"w")
!
dest.write("""<?xml version="1.0"?>
! <!-- Schema definition created by GNUe Designer's
"Create Schema from Form" plugin -->
""")
***************
*** 154,166 ****
def CreateTables(self,obj):
if obj._type=='GFDataSource':
!
if hasattr(obj,'table'):
#
# add the table
#
!
newtable = GSTable(self.gstables)
newtable.name=obj.table
GSFields(newtable)
--- 127,139 ----
def CreateTables(self,obj):
if obj._type=='GFDataSource':
!
if hasattr(obj,'table'):
#
# add the table
#
!
newtable = GSTable(self.gstables)
newtable.name=obj.table
GSFields(newtable)
***************
*** 170,184 ****
else:
print "WARNING: You defined a datasource without an 'table' "+\
"attribute."
-
- elif obj._type=='GFBlock':
- # if no datasource is defined for this block, create a default one
- # or step over it (should be defined by options)
- pass
-
-
def PopulateSchema(self,obj):
# TODO: * care for multiple fields in fk_descriptions
# * add error messages in case of missing/wrong datasources
--- 143,150 ----
***************
*** 186,194 ****
# * add a way to check for a datasource name with right case before
# just don't care for the case
# * add a function for guessing row types
!
if obj._type=='GFEntry':
!
myblock=obj.findParentOfType('GFBlock')
#
--- 152,160 ----
# * add a way to check for a datasource name with right case before
# just don't care for the case
# * add a function for guessing row types
!
if obj._type=='GFEntry':
!
myblock=obj.findParentOfType('GFBlock')
#
***************
*** 196,202 ****
#
if hasattr(obj,'field') and hasattr(myblock,'datasource') and \
self.tablelist.has_key(string.lower(myblock.datasource)):
!
table=self.tablelist[string.lower(myblock.datasource)]
type = self.DEFAULT_TYPE # standart type
--- 162,168 ----
#
if hasattr(obj,'field') and hasattr(myblock,'datasource') and \
self.tablelist.has_key(string.lower(myblock.datasource)):
!
table=self.tablelist[string.lower(myblock.datasource)]
type = self.DEFAULT_TYPE # standart type
***************
*** 213,222 ****
if hasattr(obj,'typecast'):
if obj.typecast=='number':
type = self.NUMERIC_TYPE
!
if obj.typecast=='date':
type = self.DATE_TYPE
!
if obj.typecast=='text' and hasattr(obj,'numeric') and \
obj.numeric==1: # reset previous numeric fields
type = self.STRING_TYPE
--- 179,188 ----
if hasattr(obj,'typecast'):
if obj.typecast=='number':
type = self.NUMERIC_TYPE
!
if obj.typecast=='date':
type = self.DATE_TYPE
!
if obj.typecast=='text' and hasattr(obj,'numeric') and \
obj.numeric==1: # reset previous numeric fields
type = self.STRING_TYPE
***************
*** 345,351 ****
#
# Basic information about this template
#
! TemplateInformation = {
'Product': 'forms',
'BaseClass' : CreateSchemaWizard,
'Name' : 'Create Schema Definition',
--- 311,319 ----
#
# Basic information about this template
#
! # TODO: This is temporarily disabled for 0.5.0 release
! # TODO: Needs some overhauling to be compatable w/0.5
! __DISABLE__TemplateInformation = {
'Product': 'forms',
'BaseClass' : CreateSchemaWizard,
'Name' : 'Create Schema Definition',
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- gnue/designer/src/forms/wizards CreateSchema.py,
Jason Cater <=