gws.plugin.model_field.file

File field.

Source code: gws.plugin.model_field.file

Package Contents

class gws.plugin.model_field.file.ClientFileProps(*args, **kwargs)

Basic data object.

This object can be instantiated by passing one or or dict arguments and/or keyword args. All dicts keys and keywords become attributes of the object.

Accessing an undefined attribute returns None and no error is raised, unless the attribute name starts with an underscore.

content: bytes
name: str
class gws.plugin.model_field.file.Config

Configuration for the file field.

contentColumn: str = ''

Column name for the file content, if stored in the database.

nameColumn: str = ''

Column name for the file name, if stored in the database or filesystem.

pathColumn: str = ''

Column name for the file path, if stored in the filesystem.

class gws.plugin.model_field.file.FileInputProps(*args, **kwargs)

Basic data object.

This object can be instantiated by passing one or or dict arguments and/or keyword args. All dicts keys and keywords become attributes of the object.

Accessing an undefined attribute returns None and no error is raised, unless the attribute name starts with an underscore.

content: bytes
name: str
class gws.plugin.model_field.file.FileValue(*args, **kwargs)

Basic data object.

This object can be instantiated by passing one or or dict arguments and/or keyword args. All dicts keys and keywords become attributes of the object.

Accessing an undefined attribute returns None and no error is raised, unless the attribute name starts with an underscore.

content: bytes
name: str
path: str
size: int
class gws.plugin.model_field.file.Object
attributeType
contentColumn: gws.lib.sa.Column | None = None
model: gws.DatabaseModel
nameColumn: gws.lib.sa.Column | None = None
pathColumn: gws.lib.sa.Column | None = None
activate()
after_select(features, mc)
before_create(feature, mc)
before_select(mc)
before_update(feature, mc)
can_preview(mime) bool
configure_columns()
configure_widget()
from_props(feature, mc)
from_record(feature, mc)
get_mime_type(fv: FileValue) str
handle_web_file_request(feature_uid: str, preview: bool, mc: gws.ModelContext) gws.ContentResponse | None
load_value(attributes: dict, mc) FileValue | None
post_configure()
prop_to_python(feature, value, mc) FileValue
python_to_prop(feature, value, mc) ServerFileProps
select_columns(mc)
to_props(feature, mc)
to_record(feature, mc)
class gws.plugin.model_field.file.Props
class gws.plugin.model_field.file.ServerFileProps(*args, **kwargs)

Basic data object.

This object can be instantiated by passing one or or dict arguments and/or keyword args. All dicts keys and keywords become attributes of the object.

Accessing an undefined attribute returns None and no error is raised, unless the attribute name starts with an underscore.

downloadUrl: str
extension: str
label: str
previewUrl: str
size: int