Package orm2 :: Module datatypes :: Class expression
[hide private]
[frames] | no frames]

Class expression

source code

object --+            
         |            
  property --+        
             |        
      datatype --+    
                 |    
           wrapper --+
                     |
                    expression

Insert an arbitrary SQL expression into the SQL query.

The expression string may contain placeholders $relation, $table (which are the same thing) and $attribute_name which will be replaced prior to execution by appropriate strings. This is especially usefull when using inheritance.

The has_default and default parameters may be used to supply a default value which the expression dbproperty will contain it the dbobject has not been SELECTed from the database. Has_default must be set to True to use this feature. Default defaults to None ;-)

Instance Methods [hide private]
  __init__(self, inside_datatype, expression, has_default=False, default=None)
  __get__(self, dbobj, owner="I don't know about this")
See the Python Language Reference, chapter 3.3.2.2 for details on how this works.
  __init_dbclass__(self, dbclass, attribute_name)
This methods gets called by dbobject's metaclass.
  __copy__(self)

Inherited from wrapper: __eq__, __getattribute__, widget_specs

Inherited from datatype: __convert__, __delete__, __select_after_insert__, __select_this_column__, __set__, __set_from_result__, __setattr__, add_widget, check_dbobj, data_attribute_name, isset, sql_literal

Inherited from property: __new__

Inherited from object: __delattr__, __hash__, __reduce__, __reduce_ex__, __repr__, __str__


Class Variables [hide private]

Inherited from datatype: python_class, sql_literal_class

Inherited from property: fdel, fget, fset


Properties [hide private]

Inherited from object: __class__


Method Details [hide private]

__init__(self, inside_datatype, expression, has_default=False, default=None)
(Constructor)

source code 
None
Overrides: wrapper.__init__

__get__(self, dbobj, owner="I don't know about this")

source code 
See the Python Language Reference, chapter 3.3.2.2 for details on how this works. Be sure to be in a relaxed, ready-for-hard-figuring mood.
Overrides: datatype.__get__
(inherited documentation)

__init_dbclass__(self, dbclass, attribute_name)

source code 
This methods gets called by dbobject's metaclass. It supplies the db property with info about the class it belongs to and its attribute name.
Overrides: datatype.__init_dbclass__
(inherited documentation)

__copy__(self)

source code 
None
Overrides: wrapper.__copy__