%PDF- %PDF-
| Direktori : /lib/python3/dist-packages/samba/netcmd/domain/models/__pycache__/ |
| Current File : //lib/python3/dist-packages/samba/netcmd/domain/models/__pycache__/fields.cpython-312.pyc |
�
�I�d�; � �h � d dl mZ d dlZd dlmZmZ d dlmZ d dlmZ d dl m
Z
mZmZm
Z
d dlmZ d dlmZmZ G d � d
e�� Z G d� d
e� Z G d� de� Z G d� de� Z G d� de� Z G d� de� Z G d� de� Z G d� de� Z G d� de� Z G d� de� Z G d� de� Zy) � )�IntEnumN)�ABCMeta�abstractmethod)�datetime)�ElementTree)�Dn�MessageElement�string_to_time�
timestring)�GUID)�ndr_pack�
ndr_unpackc �8 � e Zd ZdZdd�Zed� � Zed� � Zy)�FieldaM Base class for all fields.
Each field will need to implement from_db_value and to_db_value.
A field must correctly support converting both single valued fields,
and list type fields.
The only thing many=True does is say the field "prefers" to be a list,
but really any field can be a list or single value.
Nc �h � || _ || _ || _ | j r
|�g | _ y|| _ y)aD Creates a new field, should be subclassed.
:param name: Ldb field name.
:param many: If true always convert field to a list when loaded.
:param default: Default value or callback method (obj is first argument)
:param hidden: If this is True, exclude the field when calling as_dict()
N)�name�many�hidden�default)�selfr r r r s �C/usr/lib/python3/dist-packages/samba/netcmd/domain/models/fields.py�__init__zField.__init__/ s4 � � �� ��� ���� �9�9����D�L�"�D�L� c � � y)z�Converts value read from the database to Python value.
:param ldb: Ldb connection
:param value: MessageElement value from the database
:returns: Parsed value as Python type
N� )r �ldb�values r �
from_db_valuezField.from_db_valueB s � �
r c � � y)a, Converts value to database value.
This should return a MessageElement or None, where None means
the field will be unset on the next save.
:param value: Input value from Python field
:param flags: MessageElement flags
:returns: MessageElement or None
Nr )r r �flagss r �to_db_valuezField.to_db_valueL s � �
r )FNF)�__name__�
__module__�__qualname__�__doc__r r r r! r r r r r # s4 � � �#�&