Last page update: November 23, 2011
Main class:
Exceptions classes:
- GnrSqlSaveException
- GnrSqlDeleteException
- GnrSqlProtectUpdateException
- GnrSqlProtectDeleteException
- GnrSqlProtectValidateException
Complete reference:
This class has a consistent number of methods. They are listed here in alphabetical order.
there is no public method.
there is no public method.
there is no public method.
there is no public method.
there is no public method.
Standard Genro SQL Delete Exception
Standard Genro SQL Protect Delete Exception
Standard Genro SQL Save Exception
Standard Genro SQL Protect Validate Exception
Standard Genro SQL Save Exception
The base class for database tables.
Your tables will inherit from it (altough it won’t be explicit in your code, since it’s done by GenroPy mixin machinery).
In your webpage, package or table methods, you can get a reference to a table by name it in this way:
self.db.table('packagename.tablename')
You can also get them from the application instance:
app = GnrApp('instancename')
app.db.table('packagename.tablename')
TODO
TODO
A batch used to update a database. For more information, check the batchUpdate section
| Parameters: |
|
|---|
Build a new record and return it
| Parameters: |
|
|---|
TODO
| Parameters: | fields – TODO |
|---|
TODO
| Parameters: | record – TODO |
|---|
TODO
| Parameters: | record – TODO |
|---|
TODO
| Parameters: | record – TODO |
|---|
TODO
| Parameters: | col – TODO |
|---|
Returns a column object.
| Parameters: | name – A column’s name or a relation starting from the current table. (eg. @director_id.name) |
|---|
Returns the columns DbColumnListObj object
TODO
| Parameters: | columns – it represents the columns to be returned by the “SELECT” clause in the traditional sql query. For more information, check the columns section |
|---|
TODO
| Parameters: |
|
|---|
TODO
| Parameters: |
|
|---|
Return the GnrSqlDb object
Return the GnrSqlDb object
Override this method to assign defaults to new record. Return a dictionary - fill it with defaults
Delete a single record from this table.
| Parameters: | record – a dictionary, bag or pkey (string) |
|---|
TODO
| Parameters: | record – a dictionary, bag or pkey (string) |
|---|
TODO
| Parameters: |
|
|---|
TODO
| Parameters: |
|
|---|
TODO
| Parameters: |
|
|---|
Return the draftField DbColumnObj object
TODO
TODO
| Parameters: |
|
|---|
Check if a record already exists in the table and return it (if it is not already in the keys)
| Parameters: | record – the record to be checked |
|---|
TODO
| Parameters: |
|
|---|
Get a pickled selection and return it
| Parameters: | fpath – TODO |
|---|
TODO
| Parameters: | name – TODO |
|---|
Allow to find the correct width for printing and return it
| Parameters: | column – the column to print |
|---|
TODO
| Parameters: |
|---|
TODO
| Parameters: | path – TODO |
|---|
TODO
| Parameters: |
|
|---|
TODO
| Parameters: | path – TODO |
|---|
Returns the indexes DbIndexListObj object
Insert a single record
| Parameters: | record – a dictionary representing the record that must be inserted |
|---|
Insert a single record if it doesn’t exist, else update it
| Parameters: | record – a dictionary that represent the record that must be updated |
|---|
Return the lastTS DbColumnObj object
TODO
| Parameters: |
|
|---|
Return the logicalDeletionField DbColumnObj object
Return the corresponding DbTableObj object
Get a new unique id to use as primary key on the current database table
TODO
| Parameters: |
|
|---|
Return the noChangeMerge DbColumnObj object
Hook method called on... TODO
Hook method called on... TODO
Return the pkey DbColumnObj object
Return the DbPackageObj object that contains the current table
TODO
| Parameters: | record – TODO |
|---|
TODO
| Parameters: |
|
|---|
TODO
| Parameters: |
|
|---|
Return a SqlQuery (a method of gnr/sql/gnrsqldata) object representing a query. This query is executable with different modes.
| Parameters: |
|
|---|
TODO
| Parameters: |
|
|---|
Get a single record of the table. It returns a SqlRecordResolver.
The record can be identified by:
| Parameters: |
|
|---|
Accept and return a record as a bag, dict or primary pkey (as a string)
| Parameters: |
|
|---|
TODO
| Parameters: |
|
|---|
Check and coerce types in record.
| Parameters: |
|
|---|
TODO
| Parameters: |
|
|---|
TODO
| Parameters: | relpath – TODO |
|---|
Returns the relations DbColumnListObj object
Return a bag of relations that point to the current table
Return a Bag of relations that start from the current table
Return the table’s rowcaption
TODO
| Parameters: | rowcaption – TODO |
|---|
TODO
| Parameters: |
|
|---|
Not sure what this is, but here is the previous existing docstrings in all their glory:
<c_0 column="invoice_num" op="ISNULL" rem='without invoice' />
<c_1 column="@anagrafica.provincia" op="IN" jc='AND'>MI,FI,TO</condition>
<c_2 not="true::B" jc='AND'>
<condition column="" op=""/>
<condition column="" op="" jc='OR'/>
</c_2>
Delete a selection from the table. It works only in SQL so no python trigger is executed
| Parameters: |
|
|---|
TODO
| Parameters: | where – the sql “WHERE” clause. For more information check the where section |
|---|
Hook method. Allow to act on record after the record delete
| Parameters: | record – the new record |
|---|
Hook method. Allow to act on record during the record delete
| Parameters: | record – the new record |
|---|
Hook method. Allow to act on record after the record insertion
| Parameters: | record – the record |
|---|
Hook method. Allow to act on record during the record insertion
| Parameters: | record – the record |
|---|
Hook method. Allow to act on record and old_record after the record update
| Parameters: |
|
|---|
Hook method. Allow to act on record and old_record during the record update
| Parameters: |
|
|---|
Update a single record
| Parameters: |
|
|---|
TODO
Receive a changeSet and execute insert, delete or update
| Parameters: |
|
|---|
TODO
| Parameters: |
|
|---|
TODO
| Parameters: | path – TODO |
|---|