gws.plugin.model_field.file

File field.

Source code: gws.plugin.model_field.file

Package Contents

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

Bases: gws.base.model.field.Config

Basic config with permissions.

contentColumn: str = ''
pathColumn: str = ''
nameColumn: str = ''
class gws.plugin.model_field.file.Props(*args, **kwargs)

Bases: gws.base.model.field.Props

Object properties.

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

Bases: gws.Data

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: gws.lib.sa.Column | None
path: gws.lib.sa.Column | None
name: gws.lib.sa.Column | None
class gws.plugin.model_field.file.FileInputProps(*args, **kwargs)

Bases: gws.Data

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.ServerFileProps(*args, **kwargs)

Bases: gws.Data

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
class gws.plugin.model_field.file.ClientFileProps(*args, **kwargs)

Bases: gws.Data

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.

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

Bases: gws.Data

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

Bases: gws.base.model.field.Object

Model field.

attributeType
cols: Cols
post_configure()

Post-configuration hook.

activate()

Activation hook.

configure_columns()
configure_widget()
before_select(mc)
after_select(features, mc)
before_create(feature, mc)
before_update(feature, mc)
from_record(feature, mc)
to_record(feature, mc)
from_props(feature, mc)
to_props(feature, mc)
prop_to_python(feature, value, mc) FileValue
python_to_prop(feature, value, mc) ServerFileProps
get_mime_type(fv: FileValue) str
handle_web_file_request(feature_uid: str, preview: bool, mc: gws.ModelContext) gws.ContentResponse | None
select_columns(with_content, mc)
load_value(attributes: dict, mc) FileValue