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

Class File

source code


Sqlalchemy column type to store files. Only the location of the file is stored

This column type accepts and returns a StoredFile, and stores them in the directory specified by settings.MEDIA_ROOT. The name of the file is stored as a string in the database. A subdirectory upload_to can be specified:

class Movie(Entity):
  script = Field(camelot.types.File(upload_to='script'))
../_static/editors/FileEditor_editable.png
Nested Classes
  impl
A variable length Unicode string.
  stored_file_implementation
Helper class for the File field type. Stored file objects can be used within the GUI thread, as none of its methods should block.
Instance Methods
 
__init__(self, max_length=100, upload_to='', storage=<class 'camelot.core.files.storage.Storage'>, **kwargs)
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, max_length=100, upload_to='', storage=<class 'camelot.core.files.storage.Storage'>, **kwargs)
(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)