NullableForeignKeyIdField
ForeignKeyField (null=True, lazy_load=False) whose instance value is the
related row's id, typed str | None.
With lazy_load=False peewee never loads the related row: instance access
returns the raw foreign-key id (a str, or None when unset) instead of
the related model. Use this when you only ever need the id and want to avoid
the extra query:
source = NullableForeignKeyIdField(ResourceModel) # -> str | None
For a self-reference, pass "self" (no generic to specialize, the value is
always str | None):
parent = NullableForeignKeyIdField("self") # -> str | None
Functions
__init__
Initialize self. See help(type(self)) for accurate signature.
model :
Any adapt
value :
Any alias
alias :
Any asc
collation :
Any nulls :
Any between
lo :
Any hi :
Any bin_and
rhs :
Any bin_or
rhs :
Any bind
model :
Any name :
Any set_attribute :
bool - True bind_to
dest :
Any cast
as_type :
Any clone
coerce
_coerce :
bool - True collate
collation :
Any concat
rhs :
Any contains
rhs :
Any converter
db_value
value :
Any ddl
ctx :
Any ddl_datatype
ctx :
Any desc
collation :
Any nulls :
Any distinct
endswith
rhs :
Any foreign_key_constraint
explicit_name :
bool - False get_constraint_name
get_modifiers
get_sort_key
ctx :
Any ilike
rhs :
Any in_
rhs :
Any iregexp
rhs :
Any is_alias
is_null
is_null :
bool - True like
rhs :
Any not_in
rhs :
Any python_value
value :
Any regexp
rhs :
Any startswith
rhs :
Any to_value
value :
Any unalias
unwrap
copy @staticmethod
method :
Any