:tocdepth: 3 :py:mod:`gws.plugin.model_field.file` ===================================== .. py:module:: gws.plugin.model_field.file .. autoapi-nested-parse:: File field. **Source code:** :source:`gws.plugin.model_field.file` Package Contents ---------------- .. py:class:: ClientFileProps(*args, **kwargs) Bases: :py:obj:`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. .. py:attribute:: content :type: bytes .. py:attribute:: name :type: str .. py:class:: Cols(*args, **kwargs) Bases: :py:obj:`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. .. py:attribute:: content :type: Optional[gws.lib.sa.Column] .. py:attribute:: name :type: Optional[gws.lib.sa.Column] .. py:attribute:: path :type: Optional[gws.lib.sa.Column] .. py:class:: Config Bases: :py:obj:`gws.base.model.field.Config` .. py:attribute:: contentColumn :type: str :value: '' .. py:attribute:: nameColumn :type: str :value: '' .. py:attribute:: pathColumn :type: str :value: '' .. py:class:: FileInputProps(*args, **kwargs) Bases: :py:obj:`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. .. py:attribute:: content :type: bytes .. py:attribute:: name :type: str .. py:class:: FileValue(*args, **kwargs) Bases: :py:obj:`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. .. py:attribute:: content :type: bytes .. py:attribute:: name :type: str .. py:attribute:: path :type: str .. py:attribute:: size :type: int .. py:class:: Object Bases: :py:obj:`gws.base.model.field.Object` .. py:attribute:: attributeType .. py:attribute:: cols :type: Cols .. py:attribute:: model :type: gws.DatabaseModel .. py:method:: activate() .. py:method:: after_select(features, mc) .. py:method:: before_create(feature, mc) .. py:method:: before_select(mc) .. py:method:: before_update(feature, mc) .. py:method:: configure_columns() .. py:method:: configure_widget() .. py:method:: from_props(feature, mc) .. py:method:: from_record(feature, mc) .. py:method:: get_mime_type(fv: FileValue) -> str .. py:method:: handle_web_file_request(feature_uid: str, preview: bool, mc: gws.ModelContext) -> Optional[gws.ContentResponse] .. py:method:: load_value(attributes: dict, mc) -> FileValue .. py:method:: post_configure() .. py:method:: prop_to_python(feature, value, mc) -> FileValue .. py:method:: python_to_prop(feature, value, mc) -> ServerFileProps .. py:method:: select_columns(with_content, mc) .. py:method:: to_props(feature, mc) .. py:method:: to_record(feature, mc) .. py:class:: Props Bases: :py:obj:`gws.base.model.field.Props` .. py:class:: ServerFileProps(*args, **kwargs) Bases: :py:obj:`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. .. py:attribute:: downloadUrl :type: str .. py:attribute:: extension :type: str .. py:attribute:: label :type: str .. py:attribute:: previewUrl :type: str .. py:attribute:: size :type: int