Package Camelot :: Package camelot :: Package types :: Class Color
[frames] | no frames]

Class Color

source code


The Color field returns and accepts tuples of the form (r,g,b,a) where r,g,b,a are integers between 0 and 255. The color is stored as an hexadecimal string of the form AARRGGBB into the database, where AA is the transparency, RR is red, GG is green BB is blue:

class MovieType(Entity):
  color = Field(camelot.types.Color())
../_static/editors/ColorEditor_editable.png

The colors are stored in the database as strings

Nested Classes
  impl
A variable length Unicode string.
Instance Methods
 
__init__(self)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
bind_processor(self, dialect)
Defines a bind parameter processing function.
source code
 
result_processor(self, dialect)
Defines a result-column processing function.
source code

Inherited from sqlalchemy.types.TypeDecorator: __getattr__, compare_values, copy, copy_value, dialect_impl, get_col_spec, get_dbapi_type, is_mutable, load_dialect_impl, process_bind_param, process_result_value

Inherited from sqlalchemy.types.AbstractType: __repr__, adapt_operator

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties

Inherited from object: __class__

Method Details

__init__(self)
(Constructor)

source code 
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
Overrides: object.__init__
(inherited documentation)

bind_processor(self, dialect)

source code 
Defines a bind parameter processing function.
Overrides: sqlalchemy.types.AbstractType.bind_processor
(inherited documentation)

result_processor(self, dialect)

source code 
Defines a result-column processing function.
Overrides: sqlalchemy.types.AbstractType.result_processor
(inherited documentation)