root/tags/dabo-0.1.1/dConstants.py

Revision 299, 0.5 kB (checked in by ed, 5 years ago)

dBizobj:
- changed a single cursor reference to a list of cursors, keyed on parent
key. For independent cursors, this key is simply None.
- modified all methods to support this new cursor design.
- created read-only property 'Cursor' which will return the current cursor.
- removed getRowNumber(), setRowNumber() and getRowCount() methods. Replaced
them with the properties RowNumber? and RowCount?.
- removed temp PK generation and management. Moved that logic to the cursor
class.
- there is now isChanged(), which only tests the current row, and
isAnyChanged(), which tests the entire recordset.
- save(), cancel(), etc., no longer accept an 'allrows' parameter. Instead,
there are new saveAll(), cancelAll(), etc. methods to be called.
- added scan() function which takes a function that will be called once for
each record in the current recordset.
- added setChildLinkFilter() method, which tells the child bizobjs which
cursor to use as their current cursor when the parent record changes.
- added getChangedRecordNumbers(), which will return a list containing the
record numbers of all records for which isChanged() returns True. Since the
change might be in a related child record, a record number may appear in the
list even though none of its fields have changed.
- added getRecordStatus(), which accepts a record number as a parameter
(default=current record). Will return a dictionary containing an element for
each modified field. The field name will be the element key, and the element
value will be a tuple whose zeroth element is the original value, and whose
first element is its current value.

dCursorMixin:
- temp PK support is now handled here instead of the bizobj.
- getPK() will return the temp PK for a new, unsaved record
- implemented getRecordStatus() - see bizobj notes above.
- fixed bug introduced into the SQL update statements wwhen datetime support was
added.

dSqlBuilderMixin:
- added childFilterClause, to handle auto-filtering of child record sets by
the parent FK.

dForm:
- removed references to 'allrows' in save(), cancel(), etc., and replaced
them with the appropriate methods (saveAll(), etc.)

dConstants:
- added constant for the temp PK field name

  • Property svn:eol-style set to native
Line 
1 """ dConstants.py """
2
3 # Return values for most operations
4 # FILE_OK = 0
5 # FILE_CANCEL = -1
6 # FILE_NORECORDS = -2
7 # FILE_BOF = -3
8 # FILE_EOF = -4
9
10 # Return values for updates to the database
11 # UPDATE_OK = 0
12 # UPDATE_NORECORDS = -2
13
14 # Return values from Requery
15 # REQUERY_SUCCESS = 0
16 # REQUERY_ERROR = -1
17
18 # Referential Integrity constants
19 REFINTEG_IGNORE = 1
20 REFINTEG_RESTRICT = 2
21 REFINTEG_CASCADE = 3
22
23 # Constants specific to cursors
24 CURSOR_MEMENTO = "dabo-memento"
25 CURSOR_NEWFLAG = "dabo-newrec"
26 CURSOR_TMPKEY_FIELD = "dabo-tmpKeyField"
Note: See TracBrowser for help on using the browser.