ForeignKey
class¶
saffier.ForeignKey
¶
ForeignKey(to, null=False, on_delete=RESTRICT, on_update=CASCADE, related_name=None, **kwargs)
Bases: Field
ForeignKey field object
PARAMETER | DESCRIPTION |
---|---|
to |
TYPE:
|
null |
TYPE:
|
on_delete |
TYPE:
|
on_update |
TYPE:
|
related_name |
TYPE:
|
**kwargs |
TYPE:
|
Source code in saffier/core/db/fields/base.py
273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 |
|
ForeignKeyValidator
¶
ForeignKeyValidator(*, title='', description='', help_text='', default=NO_DEFAULT, null=False, read_only=False, **kwargs)
Bases: SaffierField
PARAMETER | DESCRIPTION |
---|---|
title |
TYPE:
|
description |
TYPE:
|
help_text |
TYPE:
|
default |
TYPE:
|
null |
TYPE:
|
read_only |
TYPE:
|
**kwargs |
TYPE:
|
Source code in saffier/core/db/fields/_internal.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
|
__hash__
¶
__hash__()
Source code in saffier/core/datastructures.py
19 20 21 22 23 24 25 26 27 |
|
validate_or_error
¶
validate_or_error(value)
PARAMETER | DESCRIPTION |
---|---|
value |
TYPE:
|
Source code in saffier/core/db/fields/_internal.py
59 60 61 62 63 64 |
|
has_default
¶
has_default()
Source code in saffier/core/db/fields/_internal.py
66 67 |
|
validation_error
¶
validation_error(code, value=None)
PARAMETER | DESCRIPTION |
---|---|
code |
TYPE:
|
value |
TYPE:
|
Source code in saffier/core/db/fields/_internal.py
69 70 71 72 73 |
|
get_error_message
¶
get_error_message(code)
PARAMETER | DESCRIPTION |
---|---|
code |
TYPE:
|
Source code in saffier/core/db/fields/_internal.py
75 76 |
|
get_default_value
¶
get_default_value()
Source code in saffier/core/db/fields/_internal.py
78 79 80 81 82 |
|
check
¶
check(value)
PARAMETER | DESCRIPTION |
---|---|
value |
TYPE:
|
Source code in saffier/core/db/fields/base.py
270 271 |
|
get_column_type
¶
get_column_type()
Source code in saffier/core/db/fields/base.py
91 92 |
|
get_constraints
¶
get_constraints()
Source code in saffier/core/db/fields/base.py
94 95 |
|
raise_for_non_default
¶
raise_for_non_default(default, server_default)
PARAMETER | DESCRIPTION |
---|---|
default |
TYPE:
|
server_default |
TYPE:
|
Source code in saffier/core/db/fields/base.py
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
|
get_validator
¶
get_validator(**kwargs)
PARAMETER | DESCRIPTION |
---|---|
**kwargs |
TYPE:
|
Source code in saffier/core/db/fields/base.py
305 306 |
|
get_column
¶
get_column(name)
PARAMETER | DESCRIPTION |
---|---|
name |
TYPE:
|
Source code in saffier/core/db/fields/base.py
308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 |
|
expand_relationship
¶
expand_relationship(value)
PARAMETER | DESCRIPTION |
---|---|
value |
TYPE:
|
Source code in saffier/core/db/fields/base.py
324 325 326 327 328 |
|