-
MultiView
This is the work horse of Prism where most of the work is done. Most for the function called return True or False, but if you get a False, you can find the prism error code using getlasterror(). This is a thin layer over direct prism calls, but it usually do all the stuff needed to do actual operations, not just the raw calls to the DP C functions in prism. This is a call into the DEB_Multiview C++ library that hides to ugliness of the C calls.
addcoldef int Add a column to the tdf with given name and return the column number given in tv 0 or - 1 if an error happened.
Parameters
- cname | column name to use
addmainrelation
Boolean Add a the main table view to the multiview.
Parameters
- tablename | the name of the table to add as tv 0
- autoadd | automatically add all columns if True
- fulltdf | generate a comple tdf if True, if False generate a minimum one
cleartablefilter Boolean Clear all multiview selections. commitdeletes
Boolean Execute the deletes done and store them to disk.
createdef Boolean Make ready for creation a table with the name given to the multiview when created. This should be followed by addcoldef and finalized by savedef. deletemainrow
Boolean Mark row in tv 0 for deletion and all related as well if subform is True. To actually do the deletion you need to commitdeletes. This mean that you can do many deletes before hitting the disk with doing it.
Parameters
- row | the row to mark for deletion
- subforms | True if do this to subforms as well ( that is related table views)
destroy Boolean Destroy the multiview. This must be done after end. end Boolean Close the multiview for read or write operations
getcoldefchoices List
None
Return array of choices defined for column or None if column not defined
Parameters
- columnnr | the pos in tv 0 for the column to inquire
getcoldefdecimals int
None
Number of decimals on a numeric value
Parameters
- columnnr | the pos in tv 0 for the column to inquire
getcoldefderived str
None
Return the derivation on the column
Parameters
- columnnr | the pos in tv 0 for the column to inquiregetcoldefdoprevent Boolean
None
Write protected field if True
Parameters
- columnnr | the pos in tv 0 for the column to inquiregetcoldefformat str
None
Return format used for column
Parameters
- columnnr | the pos in tv 0 for the column to inquiregetcoldefhasderived
Boolean
None
True if this field has a derivation defined
Parameters
- columnnr | the pos in tv 0 for the column to inquire
getcoldefhasformat Boolean
None
True if the column has formattion defined
Parameters
- columnnr | the pos in tv 0 for the column to inquire
getcoldefhashelp Boolean
None
True if the column has help defined
Parameters
- columnnr | the pos in tv 0 for the column to inquire
getcoldefhasindex Boolean
None
True if the column has an index
Parameters
- columnnr | the pos in tv 0 for the column to inquire
getcoldefhasrule Boolean
None
True if the column has a rule defined
Parameters
- columnnr | the pos in tv 0 for the column to inquire
getcoldefidx Int Return the index into the table definition in tv 0 for the name given. Return -1 if not found.
Parameters
- name | the name of the columngetcoldefisaggrigate Boolean True if this is a aggregate field
Parameters
- columnnr | the pos in tv 0 for the column to inquiregetcoldefiscompressed Boolean
None
True if compressed (no idea of what that is)
Parameters
- columnnr | the pos in tv 0 for the column to inquire
getcoldefisdeleted Boolean
None
True if this column is marked for deletion on next savedef
Parameters
- columnnr | the pos in tv 0 for the column to inquire
getcoldefismultibox Boolean
None
True if column is defined as multibox
Parameters
- columnnr | the pos in tv 0 for the column to inquire
getcoldefisrequired Boolean
None
True if value is required in this column
Parameters
- columnnr | the pos in tv 0 for the column to inquire
getcoldefisunique Boolean
None
True if this column must be unique
Parameters
- columnnr | the pos in tv 0 for the column to inquire
getcoldefisvirtual Boolean
None
True if this column is a virtual column
Parameters
- columnnr | the pos in tv 0 for the column to inquire
getcoldeflength int
None
Return length of the field if column is defined None if not
Parameters
- columnnr | the pos in tv 0 for the column to inquire
getcoldefname str
None
Return defined name of the column and None if not defined
Parameters
- columnnr | the pos in tv 0 for the column to inquire
getcoldefreadsecurity int
None
Return read securtiy 1-7 or None if column not defined
Parameters
- columnnr | the pos in tv 0 for the column to inquire
getcoldefrule str
None
Return the rule set on the column
Parameters
- columnnr | the pos in tv 0 for the column to inquiregetcoldeftype int
Bone
The column type
DP_TEXT 0
DP_NUMERIC_STRING 1
DP_INTEGER 2
DP_FIXED 3
DP_FLOAT 4
DP_TIME 5
DP_DATE 6
DP_MONEY 7
DP_BOOLEAN 8
DP_CHOICE 9
DP_MEMO 13
Parameters
- columnnr | the pos in tv 0 for the column to inquire
getcoldefwritesecurity int
None
Write security 1-7
Parameters
- columnnr | the pos in tv 0 for the column to inquire
getcolumndata str Return data for the given column
Paramters
- colnamegetcolumndatabyindex str Return data for the given index
Paramters
- colidxgetcolumnfilter str Return filter set on field
Parameters
- colname | name of the column read filter fromgetcolumnfilterbyindex str Return filter set on field
Parameters
- col | index to tv 0 to read filter fromgetcolumnsortorder int Return sortorder 0 = no order 1 = acending 2 = decending
Parameters
- colname | name of the coulmn to set read sort order fromgetcolumnsortorderbyindex int Return sortorder 0 = no order 1 = acending 2 = decending
Parameters
- col | index for tv 0 for the column to read sort order forgetisstarted Boolean Return True if multiview is started.
getlasterror int Last errorcode returned by a multiview operation getlasterrorasstring str Return the extended error description as done by prism as a string. getmaincolumncount int Return the total number of columns added to tv 0 getmainrow int Return current active row if available or -1 if not getmainrowcount int Return number of records found in started multiview. getsaveerrors List Return stored error list from save operation and clear it. gettabledefcreatesecurity int return the create security level as described under
HIGHLEVEL 1
MED1LEVEL 2
MED2LEVEL 3
MED3LEVEL 4
LOW1LEVEL 5
LOW2LEVEL 6
LOW3LEVEL 7gettabledefdeletesecurity int return the delete security level as described in gettabledefcreatesecurity
gettabledefdopreservedate Boolean gettabledefisinmemorytable Boolean gettabledefhasencrypteddata Boolean gettabledefmodifysecurity int return the modify security level as described in gettabledefcreatesecurity gettabledefownership int 0 = Not Owned, 1 = DFD, 2 = DFW gettabledefviewsecurity int return the view security level as described in gettabledefcreatesecurity gettablefilter str Get the table filter set for tv 0 listmaincolumnnames List Return all column names in tv 0 savedata Boolean Save the data changes back to disk
Parameters
- createnew | if True the record will be saved as a new record
- saveparent | save subforms or not (not i use for now)savedef Boolean Go through all changed done to tdf by setcolumn class functions and save them to disk. All errors happening during the walk trough are logged and can be fetched by getsaveerrors() after. This function returns True of the save command was successful and False if not. This is not necessary without any errors during the column changes. To find those have a look at saveerrors. setcoldefchoices setcoldefdecimals setcoldefderived setcoldefdoprevent setcoldefformat setcoldefhasindex setcoldefisdeleted setcoldefisunique setcoldefisvirtual setcoldeflength setcoldefname setcoldefisrequired setcoldefreadsecurity setcoldefrule setcoldeftype setcoldefwritesecurity setcolumndata Boolean Set data to current row by column name
Parameters
- colname
- stringdatasetcolumndatabyindex Boolean Set data to current row by column index
Parameters
- colidx- stringdatasetcolumnfilter Boolean Set column filter and return True if it is set
Paramters
- columname
- filtersetcolumnfilterbyindex Boolean Set column filter and return True if it is set
Paramters
- colidx
- filtersetcolumnsortorder Boolean Set to order to sort the column: sortorder 0 = no order 1 = acending 2 = decending and return True if able to set it
Parameters
- colname | name of column to set
- order | int value with sort ordersetcolumnsortorderbyindex Boolean Set to order to sort the column: sortorder 0 = no order 1 = acending 2 = decending and return True if able to set it
Parameters
- col | index to tv 0 for column to sort
- order | int value with sort ordersettabledefcreatesecurity None Set the create security level on tv 0
Parameters
- level as described in gettabledefcreatesecuritysettabledefdeletesecurity None Set the delete security level on tv 0
Parameters
- level as described in gettabledefcreatesecuritysettabledefdopreservedate None Set if table should preserve current date set on creation
Parameters
- preserve | True do preserve it False change it on save to now
settabledefhasencrypteddata None Change table attributes to 1 or 0
Parameters
- hasencrypt | True set 1 False set 0
settabledefmodifysecurity None Set the modify security level on tv 0
Parameters
- level as described in gettabledefcreatesecuritysettabledefownership None Set if you have ownership of table definition
Parameters
- ownershipval | 0 = Not Owned, 1 = DFD, 2 = DFW
settabledefviewsecurity None Set the view security level on tv 0
Parameters
- level as described in gettabledefcreatesecuritysetmainrow Boolean Set the row to work on in tv 0. It able to find it return True else return False.
Parameters
- row | the row to select. If not valid, the routine will return False
settablefilter Boolean Set the table filter for tv 0 and return True if successful. If False check errorcode with geterrorcode()
Paramters
- filterstartasreadonly Boolean Start the multiview for reading data startasreadwrite Boolean Start the multiview for reading and writing data testcoldefderived str Test if a derivation will be valid for a field and return the generated error string from prism
Parameters
- columnnr | the pos in tv 0 for the column to inquire
- derivation | derivation to test
testcoldefformat str Test if a format will be valid for a field and return the generated error string from prism
Parameters
- columnnr | the pos in tv 0 for the column to inquire
- derivation | derivation to testtestcoldefrule str Test if a rule will be valid for a field and return the generated error string from prism
Parameters
- columnnr | the pos in tv 0 for the column to inquire
- derivation | derivation to testEx.