
Returns a dict with constraints defined in the Pydantic/JSONSchema format. It is set automatically if not specified to a multiline list Note: Valid int value of enum_type is acceptable. The description of the field is set automatically if not specified to a multiline list of IntEnumField ( enum_type, description = None, ** kwargs ) ¶Ī field representing an integer enumeration. FloatField ( source_field = None, generated = False, pk = False, null = False, default = None, unique = False, index = False, description = None, model = None, validators = None, ** kwargs ) ¶Īlias of float. field_type ¶Īlias of decimal.Decimal class. How many of those signifigant digits is after the decimal point. Max digits of significance of the decimal field. You must provide the following: max_digits (int): DecimalField ( max_digits, decimal_places, ** kwargs ) ¶ field_type ¶Īlias of datetime.datetime class. To do so, specify a inner class in the form of class _db_ SQL_DIALECT : like so: Or the to_db_value or to_python_value methods. One can specify per-DB overrides of any of the class attributes, The SQL that instructs the DB to auto-generate this field. The SQL type as a string that the DB will use. Is this field able to be DB-generated? function_cast Optional = None ¶Ī casting term that we need to apply in case the DB needs emulation help. This is for optimization purposes only, where we don’t need to force type conversion
#Char ref base driver#
If the DB driver natively supports this Python type, should we skip it? has_db_field bool = True ¶ĭoes this field have a direct corresponding DB column? Or is the field virtualized? skip_to_python_if_native bool = False ¶ Is the field indexable? Set to False if this field can’t be indexed reliably. If adding a type as a mixin, _FieldMeta will automatically set this to that. These attributes needs to be defined when defining an actual field type. Validators ( Optional]]) – Validators for this field. Index ( bool) – Should this field be indexed by itself?ĭescription ( Optional) – Field description. The default value will not be part of the schema. This can also be a callable for dynamic defaults in which case we will call it. Pk ( bool) – Is this field a Primary Key? Can only have a single such field on the Model,Īnd if none is specified it will autogenerate a default primary key called id.ĭefault ( Optional) – A default value for the field if not specified on Model creation. Generated ( bool) – Is this field DB-generated? Something specific instead of enerated off the field name.

Source_field ( Optional) – Provide a source_field name if the DB column name needs to be

Field ( source_field = None, generated = False, pk = False, null = False, default = None, unique = False, index = False, description = None, model = None, validators = None, ** kwargs ) ¶
