PyDev console: starting.
Python 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:54:40) [MSC v.1900 64 bit (AMD64)] on win32
Django 2.0.2
from django.db import models
help(models)
Help on package django.db.models in django.db:
NAME
django.db.models
PACKAGE CONTENTS
aggregates
base
constants
deletion
expressions
fields (package)
functions (package)
indexes
lookups
manager
options
query
query_utils
signals
sql (package)
utils
CLASSES
builtins.Exception(builtins.BaseException)
django.core.exceptions.FieldDoesNotExist
django.core.exceptions.ObjectDoesNotExist
builtins.object
django.db.models.base.Model
django.db.models.fields.Empty
django.db.models.fields.NOT_PROVIDED
django.db.models.indexes.Index
django.db.models.lookups.Lookup
django.db.models.query.Prefetch
django.db.models.query.QuerySet
django.db.models.query_utils.FilteredRelation
django.db.models.expressions.BaseExpression(builtins.object)
django.db.models.expressions.Expression(django.db.models.expressions.BaseExpression, django.db.models.expressions.Combinable)
django.db.models.expressions.Case
django.db.models.expressions.ExpressionWrapper
django.db.models.expressions.Func(django.db.models.expressions.SQLiteNumericMixin, django.db.models.expressions.Expression)
django.db.models.aggregates.Aggregate
django.db.models.aggregates.Avg
django.db.models.aggregates.Count
django.db.models.aggregates.Max
django.db.models.aggregates.Min
django.db.models.aggregates.StdDev
django.db.models.aggregates.Sum
django.db.models.aggregates.Variance
django.db.models.expressions.ExpressionList
django.db.models.lookups.Transform(django.db.models.query_utils.RegisterLookupMixin, django.db.models.expressions.Func)
django.db.models.expressions.Subquery
django.db.models.expressions.Exists
django.db.models.expressions.Value
django.db.models.expressions.When
django.db.models.expressions.Window
django.db.models.expressions.WindowFrame
django.db.models.expressions.RowRange
django.db.models.expressions.ValueRange
django.db.models.expressions.Combinable(builtins.object)
django.db.models.expressions.Expression(django.db.models.expressions.BaseExpression, django.db.models.expressions.Combinable)
django.db.models.expressions.Case
django.db.models.expressions.ExpressionWrapper
django.db.models.expressions.Func(django.db.models.expressions.SQLiteNumericMixin, django.db.models.expressions.Expression)
django.db.models.aggregates.Aggregate
django.db.models.aggregates.Avg
django.db.models.aggregates.Count
django.db.models.aggregates.Max
django.db.models.aggregates.Min
django.db.models.aggregates.StdDev
django.db.models.aggregates.Sum
django.db.models.aggregates.Variance
django.db.models.expressions.ExpressionList
django.db.models.lookups.Transform(django.db.models.query_utils.RegisterLookupMixin, django.db.models.expressions.Func)
django.db.models.expressions.Subquery
django.db.models.expressions.Exists
django.db.models.expressions.Value
django.db.models.expressions.When
django.db.models.expressions.Window
django.db.models.expressions.WindowFrame
django.db.models.expressions.RowRange
django.db.models.expressions.ValueRange
django.db.models.expressions.F
django.db.models.expressions.OuterRef
django.db.models.expressions.SQLiteNumericMixin(builtins.object)
django.db.models.expressions.Func(django.db.models.expressions.SQLiteNumericMixin, django.db.models.expressions.Expression)
django.db.models.aggregates.Aggregate
django.db.models.aggregates.Avg
django.db.models.aggregates.Count
django.db.models.aggregates.Max
django.db.models.aggregates.Min
django.db.models.aggregates.StdDev
django.db.models.aggregates.Sum
django.db.models.aggregates.Variance
django.db.models.expressions.ExpressionList
django.db.models.lookups.Transform(django.db.models.query_utils.RegisterLookupMixin, django.db.models.expressions.Func)
django.db.models.fields.DateTimeCheckMixin(builtins.object)
django.db.models.fields.DateField(django.db.models.fields.DateTimeCheckMixin, django.db.models.fields.Field)
django.db.models.fields.DateTimeField
django.db.models.fields.TimeField(django.db.models.fields.DateTimeCheckMixin, django.db.models.fields.Field)
django.db.models.fields.PositiveIntegerRelDbTypeMixin(builtins.object)
django.db.models.fields.PositiveIntegerField(django.db.models.fields.PositiveIntegerRelDbTypeMixin, django.db.models.fields.IntegerField)
django.db.models.fields.PositiveSmallIntegerField(django.db.models.fields.PositiveIntegerRelDbTypeMixin, django.db.models.fields.IntegerField)
django.db.models.fields.related.RelatedField(django.db.models.fields.mixins.FieldCacheMixin, django.db.models.fields.Field)
django.db.models.fields.related.ForeignObject
django.db.models.fields.related.ForeignKey
django.db.models.fields.related.OneToOneField
django.db.models.fields.related.ManyToManyField
django.db.models.fields.reverse_related.ForeignObjectRel(django.db.models.fields.mixins.FieldCacheMixin)
django.db.models.fields.reverse_related.ManyToManyRel
django.db.models.fields.reverse_related.ManyToOneRel
django.db.models.fields.reverse_related.OneToOneRel
django.db.models.manager.BaseManagerFromQuerySet(django.db.models.manager.BaseManager)
django.db.models.manager.Manager
django.db.models.query_utils.RegisterLookupMixin(builtins.object)
django.db.models.fields.Field
django.db.models.fields.AutoField
django.db.models.fields.BigAutoField
django.db.models.fields.BinaryField
django.db.models.fields.BooleanField
django.db.models.fields.CharField
django.db.models.fields.CommaSeparatedIntegerField
django.db.models.fields.EmailField
django.db.models.fields.SlugField
django.db.models.fields.URLField
django.db.models.fields.DateField(django.db.models.fields.DateTimeCheckMixin, django.db.models.fields.Field)
django.db.models.fields.DateTimeField
django.db.models.fields.DecimalField
django.db.models.fields.DurationField
django.db.models.fields.FilePathField
django.db.models.fields.FloatField
django.db.models.fields.GenericIPAddressField
django.db.models.fields.IPAddressField
django.db.models.fields.IntegerField
django.db.models.fields.BigIntegerField
django.db.models.fields.PositiveIntegerField(django.db.models.fields.PositiveIntegerRelDbTypeMixin, django.db.models.fields.IntegerField)
django.db.models.fields.PositiveSmallIntegerField(django.db.models.fields.PositiveIntegerRelDbTypeMixin, django.db.models.fields.IntegerField)
django.db.models.fields.SmallIntegerField
django.db.models.fields.proxy.OrderWrt
django.db.models.fields.NullBooleanField
django.db.models.fields.TextField
django.db.models.fields.TimeField(django.db.models.fields.DateTimeCheckMixin, django.db.models.fields.Field)
django.db.models.fields.UUIDField
django.db.models.fields.files.FileField
django.db.models.fields.files.ImageField
django.db.models.lookups.Transform(django.db.models.query_utils.RegisterLookupMixin, django.db.models.expressions.Func)
django.db.utils.IntegrityError(django.db.utils.DatabaseError)
django.db.models.deletion.ProtectedError
django.utils.tree.Node(builtins.object)
django.db.models.query_utils.Q
class Aggregate(django.db.models.expressions.Func)
| An SQL function call.
|
| Method resolution order:
| Aggregate
| django.db.models.expressions.Func
| django.db.models.expressions.SQLiteNumericMixin
| django.db.models.expressions.Expression
| django.db.models.expressions.BaseExpression
| django.db.models.expressions.Combinable
| builtins.object
|
| Methods defined here:
|
| __init__(self, *args, filter=None, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| as_sql(self, compiler, connection, **extra_context)
| Responsible for returning a (sql, [params]) tuple to be included
| in the current query.
|
| Different backends can provide their own implementation, by
| providing an `as_{vendor}` method and patching the Expression:
|
| ```
| def override_as_sql(self, compiler, connection):
| # custom logic
| return super().as_sql(compiler, connection)
| setattr(Expression, 'as_' + connection.vendor, override_as_sql)
| ```
|
| Arguments:
| * compiler: the query compiler responsible for generating the query.
| Must have a compile method, returning a (sql, [params]) tuple.
| Calling compiler(value) will return a quoted `value`.
|
| * connection: the database connection used for the current query.
|
| Return: (sql, params)
| Where `sql` is a string containing ordered sql parameters to be
| replaced with the elements of the list `params`.
|
| get_group_by_cols(self)
|
| get_source_expressions(self)
|
| get_source_fields(self)
| Return the underlying field types used by this aggregate.
|
| resolve_expression(self, query=None, allow_joins=True, reuse=None, summarize=False, for_save=False)
| Provide the chance to do any preprocessing or validation before being
| added to the query.
|
| Arguments:
| * query: the backend query implementation
| * allow_joins: boolean allowing or denying use of joins
| in this query
| * reuse: a set of reusable joins for multijoins
| * summarize: a terminal aggregate clause
| * for_save: whether this expression about to be used in a save or update
|
| Return: an Expression to be added to the query.
|
| set_source_expressions(self, exprs)
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| default_alias
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| contains_aggregate = True
|
| filter_template = '%s FILTER (WHERE %%(filter)s)'
|
| name = None
|
| window_compatible = True
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.expressions.Func:
|
| __repr__(self)
| Return repr(self).
|
| copy(self)
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from django.db.models.expressions.Func:
|
| arg_joiner = ', '
|
| arity = None
|
| function = None
|
| template = '%(function)s(%(expressions)s)'
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.expressions.SQLiteNumericMixin:
|
| as_sqlite(self, compiler, connection, **extra_context)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from django.db.models.expressions.SQLiteNumericMixin:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.expressions.BaseExpression:
|
| __eq__(self, other)
| Return self==value.
|
| __getstate__(self)
|
| __hash__(self)
| Return hash(self).
|
| asc(self, **kwargs)
|
| contains_column_references = <django.utils.functional.cached_property object>
| contains_over_clause = <django.utils.functional.cached_property object>
| convert_value = <django.utils.functional.cached_property object>
| deconstruct(obj)
| Return a 3-tuple of class import path, positional arguments,
| and keyword arguments.
|
| desc(self, **kwargs)
|
| flatten(self)
| Recursively yield this expression and all subexpressions, in
| depth-first order.
|
| get_db_converters(self, connection)
|
| get_lookup(self, lookup)
|
| get_transform(self, name)
|
| output_field = <django.utils.functional.cached_property object>
| relabeled_clone(self, change_map)
|
| reverse_ordering(self)
|
| ----------------------------------------------------------------------
| Static methods inherited from django.db.models.expressions.BaseExpression:
|
| __new__(cls, *args, **kwargs)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from django.db.models.expressions.BaseExpression:
|
| field
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from django.db.models.expressions.BaseExpression:
|
| filterable = True
|
| is_summary = False
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.expressions.Combinable:
|
| __add__(self, other)
|
| __and__(self, other)
|
| __mod__(self, other)
|
| __mul__(self, other)
|
| __or__(self, other)
|
| __pow__(self, other)
|
| __radd__(self, other)
|
| __rand__(self, other)
|
| __rmod__(self, other)
|
| __rmul__(self, other)
|
| __ror__(self, other)
|
| __rpow__(self, other)
|
| __rsub__(self, other)
|
| __rtruediv__(self, other)
|
| __sub__(self, other)
|
| __truediv__(self, other)
|
| bitand(self, other)
|
| bitleftshift(self, other)
|
| bitor(self, other)
|
| bitrightshift(self, other)
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from django.db.models.expressions.Combinable:
|
| ADD = '+'
|
| BITAND = '&'
|
| BITLEFTSHIFT = '<<'
|
| BITOR = '|'
|
| BITRIGHTSHIFT = '>>'
|
| DIV = '/'
|
| MOD = '%%'
|
| MUL = '*'
|
| POW = '^'
|
| SUB = '-'
class AutoField(Field)
| Base class for all field types
|
| Method resolution order:
| AutoField
| Field
| django.db.models.query_utils.RegisterLookupMixin
| builtins.object
|
| Methods defined here:
|
| __init__(self, *args, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| check(self, **kwargs)
|
| contribute_to_class(self, cls, name, **kwargs)
| Register the field with the model class it belongs to.
|
| If private_only is True, create a separate instance of this field
| for every subclass of cls, even if cls is not an abstract model.
|
| deconstruct(self)
| Return enough information to recreate the field as a 4-tuple:
|
| * The name of the field on the model, if contribute_to_class() has
| been run.
| * The import path of the field, including the class:e.g.
| django.db.models.IntegerField This should be the most portable
| version, so less specific may be better.
| * A list of positional arguments.
| * A dict of keyword arguments.
|
| Note that the positional or keyword arguments must contain values of
| the following types (including inner values of collection types):
|
| * None, bool, str, int, float, complex, set, frozenset, list, tuple,
| dict
| * UUID
| * datetime.datetime (naive), datetime.date
| * top-level classes, top-level functions - will be referenced by their
| full import path
| * Storage instances - these have their own deconstruct() method
|
| This is because the values here must be serialized into a text format
| (possibly new Python code, possibly JSON) and these are the only types
| with encoding handlers defined.
|
| There's no need to return the exact way the field was instantiated this
| time, just ensure that the resulting field is the same - prefer keyword
| arguments over positional ones, and omit parameters with their default
| values.
|
| formfield(self, **kwargs)
| Return a django.forms.Field instance for this field.
|
| get_db_prep_value(self, value, connection, prepared=False)
| Return field's value prepared for interacting with the database backend.
|
| Used by the default implementations of get_db_prep_save().
|
| get_internal_type(self)
|
| get_prep_value(self, value)
| Perform preliminary non-db specific value checks and conversions.
|
| rel_db_type(self, connection)
| Return the data type that a related field pointing to this field should
| use. For example, this method is called by ForeignKey and OneToOneField
| to determine its data type.
|
| to_python(self, value)
| Convert the input value into the expected Python data type, raising
| django.core.exceptions.ValidationError if the data can't be converted.
| Return the converted value. Subclasses should override this.
|
| validate(self, value, model_instance)
| Validate value and raise ValidationError if necessary. Subclasses
| should override this to provide validation logic.
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| default_error_messages = {'invalid': "'%(value)s' value must be an int...
|
| description = 'Integer'
|
| empty_strings_allowed = False
|
| ----------------------------------------------------------------------
| Methods inherited from Field:
|
| __copy__(self)
|
| __deepcopy__(self, memodict)
|
| __eq__(self, other)
| Return self==value.
|
| __ge__(self, other, NotImplemented=NotImplemented)
| Return a >= b. Computed by @total_ordering from (not a < b).
|
| __gt__(self, other, NotImplemented=NotImplemented)
| Return a > b. Computed by @total_ordering from (not a < b) and (a != b).
|
| __hash__(self)
| Return hash(self).
|
| __le__(self, other, NotImplemented=NotImplemented)
| Return a <= b. Computed by @total_ordering from (a < b) or (a == b).
|
| __lt__(self, other)
| Return self<value.
|
| __reduce__(self)
| Pickling should return the model._meta.fields instance of the field,
| not a new copy of that field. So, use the app registry to load the
| model and then the field back.
|
| __repr__(self)
| Display the module, class, and name of the field.
|
| __str__(self)
| Return "app_label.model_label.field_name" for fields attached to
| models.
|
| cached_col = <django.utils.functional.cached_property object>
| cast_db_type(self, connection)
| Return the data type to use in the Cast() function.
|
| clean(self, value, model_instance)
| Convert the value's type and run validation. Validation errors
| from to_python() and validate() are propagated. Return the correct
| value if no error is raised.
|
| clone(self)
| Uses deconstruct() to clone a new copy of this Field.
| Will not preserve any class attachments/attribute names.
|
| db_check(self, connection)
| Return the database column check constraint for this field, for the
| provided connection. Works the same way as db_type() for the case that
| get_internal_type() does not map to a preexisting model field.
|
| db_parameters(self, connection)
| Extension of db_type(), providing a range of different return values
| (type, checks). This will look at db_type(), allowing custom model
| fields to override it.
|
| db_type(self, connection)
| Return the database column data type for this field, for the provided
| connection.
|
| db_type_parameters(self, connection)
|
| db_type_suffix(self, connection)
|
| get_attname(self)
|
| get_attname_column(self)
|
| get_choices(self, include_blank=True, blank_choice=[('', '---------')], limit_choices_to=None)
| Return choices with a default blank choices included, for use
| as <select> choices for this field.
|
| get_col(self, alias, output_field=None)
|
| get_db_converters(self, connection)
|
| get_db_prep_save(self, value, connection)
| Return field's value prepared for saving into a database.
|
| get_default(self)
| Return the default value for this field.
|
| get_filter_kwargs_for_object(self, obj)
| Return a dict that when passed as kwargs to self.model.filter(), would
| yield all instances having the same value for this field as obj has.
|
| get_pk_value_on_save(self, instance)
| Hook to generate new PK values on save. This method is called when
| saving instances with no primary key value set. If this method returns
| something else than None, then the returned value is used when saving
| the new instance.
|
| has_default(self)
| Return a boolean of whether this field has a default value.
|
| pre_save(self, model_instance, add)
| Return field's value just before saving.
|
| run_validators(self, value)
|
| save_form_data(self, instance, data)
|
| select_format(self, compiler, sql, params)
| Custom format for select clauses. For example, GIS columns need to be
| selected as AsText(table.col) on MySQL as the table.col data can't be
| used by Django.
|
| set_attributes_from_name(self, name)
|
| validators = <django.utils.functional.cached_property object>
| value_from_object(self, obj)
| Return the value of this field in the given model instance.
|
| value_to_string(self, obj)
| Return a string value of this field from the passed obj.
| This is used by the serialization framework.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from Field:
|
| db_tablespace
|
| flatchoices
| Flattened version of choices tuple.
|
| unique
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from Field:
|
| auto_creation_counter = -11
|
| class_lookups = {'contains': <class 'django.db.models.lookups.Contains...
|
| creation_counter = 58
|
| default_validators = []
|
| empty_values = [None, '', [], (), {}]
|
| hidden = False
|
| many_to_many = None
|
| many_to_one = None
|
| one_to_many = None
|
| one_to_one = None
|
| related_model = None
|
| system_check_deprecated_details = None
|
| system_check_removed_details = None
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| get_lookup(self, lookup_name)
|
| get_transform(self, lookup_name)
|
| ----------------------------------------------------------------------
| Class methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| get_lookups() from builtins.type
|
| register_lookup(lookup, lookup_name=None) from builtins.type
|
| ----------------------------------------------------------------------
| Static methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| merge_dicts(dicts)
| Merge dicts in reverse to preference the order of the original list. e.g.,
| merge_dicts([a, b]) will preference the keys in 'a' over those in 'b'.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
class Avg(Aggregate)
| An SQL function call.
|
| Method resolution order:
| Avg
| Aggregate
| django.db.models.expressions.Func
| django.db.models.expressions.SQLiteNumericMixin
| django.db.models.expressions.Expression
| django.db.models.expressions.BaseExpression
| django.db.models.expressions.Combinable
| builtins.object
|
| Methods defined here:
|
| as_oracle(self, compiler, connection)
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| function = 'AVG'
|
| name = 'Avg'
|
| ----------------------------------------------------------------------
| Methods inherited from Aggregate:
|
| __init__(self, *args, filter=None, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| as_sql(self, compiler, connection, **extra_context)
| Responsible for returning a (sql, [params]) tuple to be included
| in the current query.
|
| Different backends can provide their own implementation, by
| providing an `as_{vendor}` method and patching the Expression:
|
| ```
| def override_as_sql(self, compiler, connection):
| # custom logic
| return super().as_sql(compiler, connection)
| setattr(Expression, 'as_' + connection.vendor, override_as_sql)
| ```
|
| Arguments:
| * compiler: the query compiler responsible for generating the query.
| Must have a compile method, returning a (sql, [params]) tuple.
| Calling compiler(value) will return a quoted `value`.
|
| * connection: the database connection used for the current query.
|
| Return: (sql, params)
| Where `sql` is a string containing ordered sql parameters to be
| replaced with the elements of the list `params`.
|
| get_group_by_cols(self)
|
| get_source_expressions(self)
|
| get_source_fields(self)
| Return the underlying field types used by this aggregate.
|
| resolve_expression(self, query=None, allow_joins=True, reuse=None, summarize=False, for_save=False)
| Provide the chance to do any preprocessing or validation before being
| added to the query.
|
| Arguments:
| * query: the backend query implementation
| * allow_joins: boolean allowing or denying use of joins
| in this query
| * reuse: a set of reusable joins for multijoins
| * summarize: a terminal aggregate clause
| * for_save: whether this expression about to be used in a save or update
|
| Return: an Expression to be added to the query.
|
| set_source_expressions(self, exprs)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from Aggregate:
|
| default_alias
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from Aggregate:
|
| contains_aggregate = True
|
| filter_template = '%s FILTER (WHERE %%(filter)s)'
|
| window_compatible = True
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.expressions.Func:
|
| __repr__(self)
| Return repr(self).
|
| copy(self)
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from django.db.models.expressions.Func:
|
| arg_joiner = ', '
|
| arity = None
|
| template = '%(function)s(%(expressions)s)'
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.expressions.SQLiteNumericMixin:
|
| as_sqlite(self, compiler, connection, **extra_context)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from django.db.models.expressions.SQLiteNumericMixin:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.expressions.BaseExpression:
|
| __eq__(self, other)
| Return self==value.
|
| __getstate__(self)
|
| __hash__(self)
| Return hash(self).
|
| asc(self, **kwargs)
|
| contains_column_references = <django.utils.functional.cached_property object>
| contains_over_clause = <django.utils.functional.cached_property object>
| convert_value = <django.utils.functional.cached_property object>
| deconstruct(obj)
| Return a 3-tuple of class import path, positional arguments,
| and keyword arguments.
|
| desc(self, **kwargs)
|
| flatten(self)
| Recursively yield this expression and all subexpressions, in
| depth-first order.
|
| get_db_converters(self, connection)
|
| get_lookup(self, lookup)
|
| get_transform(self, name)
|
| output_field = <django.utils.functional.cached_property object>
| relabeled_clone(self, change_map)
|
| reverse_ordering(self)
|
| ----------------------------------------------------------------------
| Static methods inherited from django.db.models.expressions.BaseExpression:
|
| __new__(cls, *args, **kwargs)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from django.db.models.expressions.BaseExpression:
|
| field
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from django.db.models.expressions.BaseExpression:
|
| filterable = True
|
| is_summary = False
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.expressions.Combinable:
|
| __add__(self, other)
|
| __and__(self, other)
|
| __mod__(self, other)
|
| __mul__(self, other)
|
| __or__(self, other)
|
| __pow__(self, other)
|
| __radd__(self, other)
|
| __rand__(self, other)
|
| __rmod__(self, other)
|
| __rmul__(self, other)
|
| __ror__(self, other)
|
| __rpow__(self, other)
|
| __rsub__(self, other)
|
| __rtruediv__(self, other)
|
| __sub__(self, other)
|
| __truediv__(self, other)
|
| bitand(self, other)
|
| bitleftshift(self, other)
|
| bitor(self, other)
|
| bitrightshift(self, other)
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from django.db.models.expressions.Combinable:
|
| ADD = '+'
|
| BITAND = '&'
|
| BITLEFTSHIFT = '<<'
|
| BITOR = '|'
|
| BITRIGHTSHIFT = '>>'
|
| DIV = '/'
|
| MOD = '%%'
|
| MUL = '*'
|
| POW = '^'
|
| SUB = '-'
class BigAutoField(AutoField)
| Base class for all field types
|
| Method resolution order:
| BigAutoField
| AutoField
| Field
| django.db.models.query_utils.RegisterLookupMixin
| builtins.object
|
| Methods defined here:
|
| get_internal_type(self)
|
| rel_db_type(self, connection)
| Return the data type that a related field pointing to this field should
| use. For example, this method is called by ForeignKey and OneToOneField
| to determine its data type.
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| description = 'Big (8 byte) integer'
|
| ----------------------------------------------------------------------
| Methods inherited from AutoField:
|
| __init__(self, *args, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| check(self, **kwargs)
|
| contribute_to_class(self, cls, name, **kwargs)
| Register the field with the model class it belongs to.
|
| If private_only is True, create a separate instance of this field
| for every subclass of cls, even if cls is not an abstract model.
|
| deconstruct(self)
| Return enough information to recreate the field as a 4-tuple:
|
| * The name of the field on the model, if contribute_to_class() has
| been run.
| * The import path of the field, including the class:e.g.
| django.db.models.IntegerField This should be the most portable
| version, so less specific may be better.
| * A list of positional arguments.
| * A dict of keyword arguments.
|
| Note that the positional or keyword arguments must contain values of
| the following types (including inner values of collection types):
|
| * None, bool, str, int, float, complex, set, frozenset, list, tuple,
| dict
| * UUID
| * datetime.datetime (naive), datetime.date
| * top-level classes, top-level functions - will be referenced by their
| full import path
| * Storage instances - these have their own deconstruct() method
|
| This is because the values here must be serialized into a text format
| (possibly new Python code, possibly JSON) and these are the only types
| with encoding handlers defined.
|
| There's no need to return the exact way the field was instantiated this
| time, just ensure that the resulting field is the same - prefer keyword
| arguments over positional ones, and omit parameters with their default
| values.
|
| formfield(self, **kwargs)
| Return a django.forms.Field instance for this field.
|
| get_db_prep_value(self, value, connection, prepared=False)
| Return field's value prepared for interacting with the database backend.
|
| Used by the default implementations of get_db_prep_save().
|
| get_prep_value(self, value)
| Perform preliminary non-db specific value checks and conversions.
|
| to_python(self, value)
| Convert the input value into the expected Python data type, raising
| django.core.exceptions.ValidationError if the data can't be converted.
| Return the converted value. Subclasses should override this.
|
| validate(self, value, model_instance)
| Validate value and raise ValidationError if necessary. Subclasses
| should override this to provide validation logic.
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from AutoField:
|
| default_error_messages = {'invalid': "'%(value)s' value must be an int...
|
| empty_strings_allowed = False
|
| ----------------------------------------------------------------------
| Methods inherited from Field:
|
| __copy__(self)
|
| __deepcopy__(self, memodict)
|
| __eq__(self, other)
| Return self==value.
|
| __ge__(self, other, NotImplemented=NotImplemented)
| Return a >= b. Computed by @total_ordering from (not a < b).
|
| __gt__(self, other, NotImplemented=NotImplemented)
| Return a > b. Computed by @total_ordering from (not a < b) and (a != b).
|
| __hash__(self)
| Return hash(self).
|
| __le__(self, other, NotImplemented=NotImplemented)
| Return a <= b. Computed by @total_ordering from (a < b) or (a == b).
|
| __lt__(self, other)
| Return self<value.
|
| __reduce__(self)
| Pickling should return the model._meta.fields instance of the field,
| not a new copy of that field. So, use the app registry to load the
| model and then the field back.
|
| __repr__(self)
| Display the module, class, and name of the field.
|
| __str__(self)
| Return "app_label.model_label.field_name" for fields attached to
| models.
|
| cached_col = <django.utils.functional.cached_property object>
| cast_db_type(self, connection)
| Return the data type to use in the Cast() function.
|
| clean(self, value, model_instance)
| Convert the value's type and run validation. Validation errors
| from to_python() and validate() are propagated. Return the correct
| value if no error is raised.
|
| clone(self)
| Uses deconstruct() to clone a new copy of this Field.
| Will not preserve any class attachments/attribute names.
|
| db_check(self, connection)
| Return the database column check constraint for this field, for the
| provided connection. Works the same way as db_type() for the case that
| get_internal_type() does not map to a preexisting model field.
|
| db_parameters(self, connection)
| Extension of db_type(), providing a range of different return values
| (type, checks). This will look at db_type(), allowing custom model
| fields to override it.
|
| db_type(self, connection)
| Return the database column data type for this field, for the provided
| connection.
|
| db_type_parameters(self, connection)
|
| db_type_suffix(self, connection)
|
| get_attname(self)
|
| get_attname_column(self)
|
| get_choices(self, include_blank=True, blank_choice=[('', '---------')], limit_choices_to=None)
| Return choices with a default blank choices included, for use
| as <select> choices for this field.
|
| get_col(self, alias, output_field=None)
|
| get_db_converters(self, connection)
|
| get_db_prep_save(self, value, connection)
| Return field's value prepared for saving into a database.
|
| get_default(self)
| Return the default value for this field.
|
| get_filter_kwargs_for_object(self, obj)
| Return a dict that when passed as kwargs to self.model.filter(), would
| yield all instances having the same value for this field as obj has.
|
| get_pk_value_on_save(self, instance)
| Hook to generate new PK values on save. This method is called when
| saving instances with no primary key value set. If this method returns
| something else than None, then the returned value is used when saving
| the new instance.
|
| has_default(self)
| Return a boolean of whether this field has a default value.
|
| pre_save(self, model_instance, add)
| Return field's value just before saving.
|
| run_validators(self, value)
|
| save_form_data(self, instance, data)
|
| select_format(self, compiler, sql, params)
| Custom format for select clauses. For example, GIS columns need to be
| selected as AsText(table.col) on MySQL as the table.col data can't be
| used by Django.
|
| set_attributes_from_name(self, name)
|
| validators = <django.utils.functional.cached_property object>
| value_from_object(self, obj)
| Return the value of this field in the given model instance.
|
| value_to_string(self, obj)
| Return a string value of this field from the passed obj.
| This is used by the serialization framework.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from Field:
|
| db_tablespace
|
| flatchoices
| Flattened version of choices tuple.
|
| unique
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from Field:
|
| auto_creation_counter = -11
|
| class_lookups = {'contains': <class 'django.db.models.lookups.Contains...
|
| creation_counter = 58
|
| default_validators = []
|
| empty_values = [None, '', [], (), {}]
|
| hidden = False
|
| many_to_many = None
|
| many_to_one = None
|
| one_to_many = None
|
| one_to_one = None
|
| related_model = None
|
| system_check_deprecated_details = None
|
| system_check_removed_details = None
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| get_lookup(self, lookup_name)
|
| get_transform(self, lookup_name)
|
| ----------------------------------------------------------------------
| Class methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| get_lookups() from builtins.type
|
| register_lookup(lookup, lookup_name=None) from builtins.type
|
| ----------------------------------------------------------------------
| Static methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| merge_dicts(dicts)
| Merge dicts in reverse to preference the order of the original list. e.g.,
| merge_dicts([a, b]) will preference the keys in 'a' over those in 'b'.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
class BigIntegerField(IntegerField)
| Base class for all field types
|
| Method resolution order:
| BigIntegerField
| IntegerField
| Field
| django.db.models.query_utils.RegisterLookupMixin
| builtins.object
|
| Methods defined here:
|
| formfield(self, **kwargs)
| Return a django.forms.Field instance for this field.
|
| get_internal_type(self)
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| MAX_BIGINT = 9223372036854775807
|
| description = 'Big (8 byte) integer'
|
| empty_strings_allowed = False
|
| ----------------------------------------------------------------------
| Methods inherited from IntegerField:
|
| check(self, **kwargs)
|
| get_prep_value(self, value)
| Perform preliminary non-db specific value checks and conversions.
|
| to_python(self, value)
| Convert the input value into the expected Python data type, raising
| django.core.exceptions.ValidationError if the data can't be converted.
| Return the converted value. Subclasses should override this.
|
| validators = <django.utils.functional.cached_property object>
| ----------------------------------------------------------------------
| Data and other attributes inherited from IntegerField:
|
| class_lookups = {'gte': <class 'django.db.models.lookups.IntegerGreate...
|
| default_error_messages = {'invalid': "'%(value)s' value must be an int...
|
| ----------------------------------------------------------------------
| Methods inherited from Field:
|
| __copy__(self)
|
| __deepcopy__(self, memodict)
|
| __eq__(self, other)
| Return self==value.
|
| __ge__(self, other, NotImplemented=NotImplemented)
| Return a >= b. Computed by @total_ordering from (not a < b).
|
| __gt__(self, other, NotImplemented=NotImplemented)
| Return a > b. Computed by @total_ordering from (not a < b) and (a != b).
|
| __hash__(self)
| Return hash(self).
|
| __init__(self, verbose_name=None, name=None, primary_key=False, max_length=None, unique=False, blank=False, null=False, db_index=False, rel=None, default=<class 'django.db.models.fields.NOT_PROVIDED'>, editable=True, serialize=True, unique_for_date=None, unique_for_month=None, unique_for_year=None, choices=None, help_text='', db_column=None, db_tablespace=None, auto_created=False, validators=(), error_messages=None)
| Initialize self. See help(type(self)) for accurate signature.
|
| __le__(self, other, NotImplemented=NotImplemented)
| Return a <= b. Computed by @total_ordering from (a < b) or (a == b).
|
| __lt__(self, other)
| Return self<value.
|
| __reduce__(self)
| Pickling should return the model._meta.fields instance of the field,
| not a new copy of that field. So, use the app registry to load the
| model and then the field back.
|
| __repr__(self)
| Display the module, class, and name of the field.
|
| __str__(self)
| Return "app_label.model_label.field_name" for fields attached to
| models.
|
| cached_col = <django.utils.functional.cached_property object>
| cast_db_type(self, connection)
| Return the data type to use in the Cast() function.
|
| clean(self, value, model_instance)
| Convert the value's type and run validation. Validation errors
| from to_python() and validate() are propagated. Return the correct
| value if no error is raised.
|
| clone(self)
| Uses deconstruct() to clone a new copy of this Field.
| Will not preserve any class attachments/attribute names.
|
| contribute_to_class(self, cls, name, private_only=False)
| Register the field with the model class it belongs to.
|
| If private_only is True, create a separate instance of this field
| for every subclass of cls, even if cls is not an abstract model.
|
| db_check(self, connection)
| Return the database column check constraint for this field, for the
| provided connection. Works the same way as db_type() for the case that
| get_internal_type() does not map to a preexisting model field.
|
| db_parameters(self, connection)
| Extension of db_type(), providing a range of different return values
| (type, checks). This will look at db_type(), allowing custom model
| fields to override it.
|
| db_type(self, connection)
| Return the database column data type for this field, for the provided
| connection.
|
| db_type_parameters(self, connection)
|
| db_type_suffix(self, connection)
|
| deconstruct(self)
| Return enough information to recreate the field as a 4-tuple:
|
| * The name of the field on the model, if contribute_to_class() has
| been run.
| * The import path of the field, including the class:e.g.
| django.db.models.IntegerField This should be the most portable
| version, so less specific may be better.
| * A list of positional arguments.
| * A dict of keyword arguments.
|
| Note that the positional or keyword arguments must contain values of
| the following types (including inner values of collection types):
|
| * None, bool, str, int, float, complex, set, frozenset, list, tuple,
| dict
| * UUID
| * datetime.datetime (naive), datetime.date
| * top-level classes, top-level functions - will be referenced by their
| full import path
| * Storage instances - these have their own deconstruct() method
|
| This is because the values here must be serialized into a text format
| (possibly new Python code, possibly JSON) and these are the only types
| with encoding handlers defined.
|
| There's no need to return the exact way the field was instantiated this
| time, just ensure that the resulting field is the same - prefer keyword
| arguments over positional ones, and omit parameters with their default
| values.
|
| get_attname(self)
|
| get_attname_column(self)
|
| get_choices(self, include_blank=True, blank_choice=[('', '---------')], limit_choices_to=None)
| Return choices with a default blank choices included, for use
| as <select> choices for this field.
|
| get_col(self, alias, output_field=None)
|
| get_db_converters(self, connection)
|
| get_db_prep_save(self, value, connection)
| Return field's value prepared for saving into a database.
|
| get_db_prep_value(self, value, connection, prepared=False)
| Return field's value prepared for interacting with the database backend.
|
| Used by the default implementations of get_db_prep_save().
|
| get_default(self)
| Return the default value for this field.
|
| get_filter_kwargs_for_object(self, obj)
| Return a dict that when passed as kwargs to self.model.filter(), would
| yield all instances having the same value for this field as obj has.
|
| get_pk_value_on_save(self, instance)
| Hook to generate new PK values on save. This method is called when
| saving instances with no primary key value set. If this method returns
| something else than None, then the returned value is used when saving
| the new instance.
|
| has_default(self)
| Return a boolean of whether this field has a default value.
|
| pre_save(self, model_instance, add)
| Return field's value just before saving.
|
| rel_db_type(self, connection)
| Return the data type that a related field pointing to this field should
| use. For example, this method is called by ForeignKey and OneToOneField
| to determine its data type.
|
| run_validators(self, value)
|
| save_form_data(self, instance, data)
|
| select_format(self, compiler, sql, params)
| Custom format for select clauses. For example, GIS columns need to be
| selected as AsText(table.col) on MySQL as the table.col data can't be
| used by Django.
|
| set_attributes_from_name(self, name)
|
| validate(self, value, model_instance)
| Validate value and raise ValidationError if necessary. Subclasses
| should override this to provide validation logic.
|
| value_from_object(self, obj)
| Return the value of this field in the given model instance.
|
| value_to_string(self, obj)
| Return a string value of this field from the passed obj.
| This is used by the serialization framework.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from Field:
|
| db_tablespace
|
| flatchoices
| Flattened version of choices tuple.
|
| unique
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from Field:
|
| auto_creation_counter = -11
|
| creation_counter = 58
|
| default_validators = []
|
| empty_values = [None, '', [], (), {}]
|
| hidden = False
|
| many_to_many = None
|
| many_to_one = None
|
| one_to_many = None
|
| one_to_one = None
|
| related_model = None
|
| system_check_deprecated_details = None
|
| system_check_removed_details = None
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| get_lookup(self, lookup_name)
|
| get_transform(self, lookup_name)
|
| ----------------------------------------------------------------------
| Class methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| get_lookups() from builtins.type
|
| register_lookup(lookup, lookup_name=None) from builtins.type
|
| ----------------------------------------------------------------------
| Static methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| merge_dicts(dicts)
| Merge dicts in reverse to preference the order of the original list. e.g.,
| merge_dicts([a, b]) will preference the keys in 'a' over those in 'b'.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
class BinaryField(Field)
| Base class for all field types
|
| Method resolution order:
| BinaryField
| Field
| django.db.models.query_utils.RegisterLookupMixin
| builtins.object
|
| Methods defined here:
|
| __init__(self, *args, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| deconstruct(self)
| Return enough information to recreate the field as a 4-tuple:
|
| * The name of the field on the model, if contribute_to_class() has
| been run.
| * The import path of the field, including the class:e.g.
| django.db.models.IntegerField This should be the most portable
| version, so less specific may be better.
| * A list of positional arguments.
| * A dict of keyword arguments.
|
| Note that the positional or keyword arguments must contain values of
| the following types (including inner values of collection types):
|
| * None, bool, str, int, float, complex, set, frozenset, list, tuple,
| dict
| * UUID
| * datetime.datetime (naive), datetime.date
| * top-level classes, top-level functions - will be referenced by their
| full import path
| * Storage instances - these have their own deconstruct() method
|
| This is because the values here must be serialized into a text format
| (possibly new Python code, possibly JSON) and these are the only types
| with encoding handlers defined.
|
| There's no need to return the exact way the field was instantiated this
| time, just ensure that the resulting field is the same - prefer keyword
| arguments over positional ones, and omit parameters with their default
| values.
|
| get_db_prep_value(self, value, connection, prepared=False)
| Return field's value prepared for interacting with the database backend.
|
| Used by the default implementations of get_db_prep_save().
|
| get_default(self)
| Return the default value for this field.
|
| get_internal_type(self)
|
| get_placeholder(self, value, compiler, connection)
|
| to_python(self, value)
| Convert the input value into the expected Python data type, raising
| django.core.exceptions.ValidationError if the data can't be converted.
| Return the converted value. Subclasses should override this.
|
| value_to_string(self, obj)
| Binary data is serialized as base64
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| description = 'Raw binary data'
|
| empty_values = [None, b'']
|
| ----------------------------------------------------------------------
| Methods inherited from Field:
|
| __copy__(self)
|
| __deepcopy__(self, memodict)
|
| __eq__(self, other)
| Return self==value.
|
| __ge__(self, other, NotImplemented=NotImplemented)
| Return a >= b. Computed by @total_ordering from (not a < b).
|
| __gt__(self, other, NotImplemented=NotImplemented)
| Return a > b. Computed by @total_ordering from (not a < b) and (a != b).
|
| __hash__(self)
| Return hash(self).
|
| __le__(self, other, NotImplemented=NotImplemented)
| Return a <= b. Computed by @total_ordering from (a < b) or (a == b).
|
| __lt__(self, other)
| Return self<value.
|
| __reduce__(self)
| Pickling should return the model._meta.fields instance of the field,
| not a new copy of that field. So, use the app registry to load the
| model and then the field back.
|
| __repr__(self)
| Display the module, class, and name of the field.
|
| __str__(self)
| Return "app_label.model_label.field_name" for fields attached to
| models.
|
| cached_col = <django.utils.functional.cached_property object>
| cast_db_type(self, connection)
| Return the data type to use in the Cast() function.
|
| check(self, **kwargs)
|
| clean(self, value, model_instance)
| Convert the value's type and run validation. Validation errors
| from to_python() and validate() are propagated. Return the correct
| value if no error is raised.
|
| clone(self)
| Uses deconstruct() to clone a new copy of this Field.
| Will not preserve any class attachments/attribute names.
|
| contribute_to_class(self, cls, name, private_only=False)
| Register the field with the model class it belongs to.
|
| If private_only is True, create a separate instance of this field
| for every subclass of cls, even if cls is not an abstract model.
|
| db_check(self, connection)
| Return the database column check constraint for this field, for the
| provided connection. Works the same way as db_type() for the case that
| get_internal_type() does not map to a preexisting model field.
|
| db_parameters(self, connection)
| Extension of db_type(), providing a range of different return values
| (type, checks). This will look at db_type(), allowing custom model
| fields to override it.
|
| db_type(self, connection)
| Return the database column data type for this field, for the provided
| connection.
|
| db_type_parameters(self, connection)
|
| db_type_suffix(self, connection)
|
| formfield(self, form_class=None, choices_form_class=None, **kwargs)
| Return a django.forms.Field instance for this field.
|
| get_attname(self)
|
| get_attname_column(self)
|
| get_choices(self, include_blank=True, blank_choice=[('', '---------')], limit_choices_to=None)
| Return choices with a default blank choices included, for use
| as <select> choices for this field.
|
| get_col(self, alias, output_field=None)
|
| get_db_converters(self, connection)
|
| get_db_prep_save(self, value, connection)
| Return field's value prepared for saving into a database.
|
| get_filter_kwargs_for_object(self, obj)
| Return a dict that when passed as kwargs to self.model.filter(), would
| yield all instances having the same value for this field as obj has.
|
| get_pk_value_on_save(self, instance)
| Hook to generate new PK values on save. This method is called when
| saving instances with no primary key value set. If this method returns
| something else than None, then the returned value is used when saving
| the new instance.
|
| get_prep_value(self, value)
| Perform preliminary non-db specific value checks and conversions.
|
| has_default(self)
| Return a boolean of whether this field has a default value.
|
| pre_save(self, model_instance, add)
| Return field's value just before saving.
|
| rel_db_type(self, connection)
| Return the data type that a related field pointing to this field should
| use. For example, this method is called by ForeignKey and OneToOneField
| to determine its data type.
|
| run_validators(self, value)
|
| save_form_data(self, instance, data)
|
| select_format(self, compiler, sql, params)
| Custom format for select clauses. For example, GIS columns need to be
| selected as AsText(table.col) on MySQL as the table.col data can't be
| used by Django.
|
| set_attributes_from_name(self, name)
|
| validate(self, value, model_instance)
| Validate value and raise ValidationError if necessary. Subclasses
| should override this to provide validation logic.
|
| validators = <django.utils.functional.cached_property object>
| value_from_object(self, obj)
| Return the value of this field in the given model instance.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from Field:
|
| db_tablespace
|
| flatchoices
| Flattened version of choices tuple.
|
| unique
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from Field:
|
| auto_creation_counter = -11
|
| class_lookups = {'contains': <class 'django.db.models.lookups.Contains...
|
| creation_counter = 58
|
| default_error_messages = {'blank': 'This field cannot be blank.', 'inv...
|
| default_validators = []
|
| empty_strings_allowed = True
|
| hidden = False
|
| many_to_many = None
|
| many_to_one = None
|
| one_to_many = None
|
| one_to_one = None
|
| related_model = None
|
| system_check_deprecated_details = None
|
| system_check_removed_details = None
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| get_lookup(self, lookup_name)
|
| get_transform(self, lookup_name)
|
| ----------------------------------------------------------------------
| Class methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| get_lookups() from builtins.type
|
| register_lookup(lookup, lookup_name=None) from builtins.type
|
| ----------------------------------------------------------------------
| Static methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| merge_dicts(dicts)
| Merge dicts in reverse to preference the order of the original list. e.g.,
| merge_dicts([a, b]) will preference the keys in 'a' over those in 'b'.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
class BooleanField(Field)
| Base class for all field types
|
| Method resolution order:
| BooleanField
| Field
| django.db.models.query_utils.RegisterLookupMixin
| builtins.object
|
| Methods defined here:
|
| __init__(self, *args, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| check(self, **kwargs)
|
| deconstruct(self)
| Return enough information to recreate the field as a 4-tuple:
|
| * The name of the field on the model, if contribute_to_class() has
| been run.
| * The import path of the field, including the class:e.g.
| django.db.models.IntegerField This should be the most portable
| version, so less specific may be better.
| * A list of positional arguments.
| * A dict of keyword arguments.
|
| Note that the positional or keyword arguments must contain values of
| the following types (including inner values of collection types):
|
| * None, bool, str, int, float, complex, set, frozenset, list, tuple,
| dict
| * UUID
| * datetime.datetime (naive), datetime.date
| * top-level classes, top-level functions - will be referenced by their
| full import path
| * Storage instances - these have their own deconstruct() method
|
| This is because the values here must be serialized into a text format
| (possibly new Python code, possibly JSON) and these are the only types
| with encoding handlers defined.
|
| There's no need to return the exact way the field was instantiated this
| time, just ensure that the resulting field is the same - prefer keyword
| arguments over positional ones, and omit parameters with their default
| values.
|
| formfield(self, **kwargs)
| Return a django.forms.Field instance for this field.
|
| get_internal_type(self)
|
| get_prep_value(self, value)
| Perform preliminary non-db specific value checks and conversions.
|
| to_python(self, value)
| Convert the input value into the expected Python data type, raising
| django.core.exceptions.ValidationError if the data can't be converted.
| Return the converted value. Subclasses should override this.
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| default_error_messages = {'invalid': "'%(value)s' value must be either...
|
| description = 'Boolean (Either True or False)'
|
| empty_strings_allowed = False
|
| ----------------------------------------------------------------------
| Methods inherited from Field:
|
| __copy__(self)
|
| __deepcopy__(self, memodict)
|
| __eq__(self, other)
| Return self==value.
|
| __ge__(self, other, NotImplemented=NotImplemented)
| Return a >= b. Computed by @total_ordering from (not a < b).
|
| __gt__(self, other, NotImplemented=NotImplemented)
| Return a > b. Computed by @total_ordering from (not a < b) and (a != b).
|
| __hash__(self)
| Return hash(self).
|
| __le__(self, other, NotImplemented=NotImplemented)
| Return a <= b. Computed by @total_ordering from (a < b) or (a == b).
|
| __lt__(self, other)
| Return self<value.
|
| __reduce__(self)
| Pickling should return the model._meta.fields instance of the field,
| not a new copy of that field. So, use the app registry to load the
| model and then the field back.
|
| __repr__(self)
| Display the module, class, and name of the field.
|
| __str__(self)
| Return "app_label.model_label.field_name" for fields attached to
| models.
|
| cached_col = <django.utils.functional.cached_property object>
| cast_db_type(self, connection)
| Return the data type to use in the Cast() function.
|
| clean(self, value, model_instance)
| Convert the value's type and run validation. Validation errors
| from to_python() and validate() are propagated. Return the correct
| value if no error is raised.
|
| clone(self)
| Uses deconstruct() to clone a new copy of this Field.
| Will not preserve any class attachments/attribute names.
|
| contribute_to_class(self, cls, name, private_only=False)
| Register the field with the model class it belongs to.
|
| If private_only is True, create a separate instance of this field
| for every subclass of cls, even if cls is not an abstract model.
|
| db_check(self, connection)
| Return the database column check constraint for this field, for the
| provided connection. Works the same way as db_type() for the case that
| get_internal_type() does not map to a preexisting model field.
|
| db_parameters(self, connection)
| Extension of db_type(), providing a range of different return values
| (type, checks). This will look at db_type(), allowing custom model
| fields to override it.
|
| db_type(self, connection)
| Return the database column data type for this field, for the provided
| connection.
|
| db_type_parameters(self, connection)
|
| db_type_suffix(self, connection)
|
| get_attname(self)
|
| get_attname_column(self)
|
| get_choices(self, include_blank=True, blank_choice=[('', '---------')], limit_choices_to=None)
| Return choices with a default blank choices included, for use
| as <select> choices for this field.
|
| get_col(self, alias, output_field=None)
|
| get_db_converters(self, connection)
|
| get_db_prep_save(self, value, connection)
| Return field's value prepared for saving into a database.
|
| get_db_prep_value(self, value, connection, prepared=False)
| Return field's value prepared for interacting with the database backend.
|
| Used by the default implementations of get_db_prep_save().
|
| get_default(self)
| Return the default value for this field.
|
| get_filter_kwargs_for_object(self, obj)
| Return a dict that when passed as kwargs to self.model.filter(), would
| yield all instances having the same value for this field as obj has.
|
| get_pk_value_on_save(self, instance)
| Hook to generate new PK values on save. This method is called when
| saving instances with no primary key value set. If this method returns
| something else than None, then the returned value is used when saving
| the new instance.
|
| has_default(self)
| Return a boolean of whether this field has a default value.
|
| pre_save(self, model_instance, add)
| Return field's value just before saving.
|
| rel_db_type(self, connection)
| Return the data type that a related field pointing to this field should
| use. For example, this method is called by ForeignKey and OneToOneField
| to determine its data type.
|
| run_validators(self, value)
|
| save_form_data(self, instance, data)
|
| select_format(self, compiler, sql, params)
| Custom format for select clauses. For example, GIS columns need to be
| selected as AsText(table.col) on MySQL as the table.col data can't be
| used by Django.
|
| set_attributes_from_name(self, name)
|
| validate(self, value, model_instance)
| Validate value and raise ValidationError if necessary. Subclasses
| should override this to provide validation logic.
|
| validators = <django.utils.functional.cached_property object>
| value_from_object(self, obj)
| Return the value of this field in the given model instance.
|
| value_to_string(self, obj)
| Return a string value of this field from the passed obj.
| This is used by the serialization framework.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from Field:
|
| db_tablespace
|
| flatchoices
| Flattened version of choices tuple.
|
| unique
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from Field:
|
| auto_creation_counter = -11
|
| class_lookups = {'contains': <class 'django.db.models.lookups.Contains...
|
| creation_counter = 58
|
| default_validators = []
|
| empty_values = [None, '', [], (), {}]
|
| hidden = False
|
| many_to_many = None
|
| many_to_one = None
|
| one_to_many = None
|
| one_to_one = None
|
| related_model = None
|
| system_check_deprecated_details = None
|
| system_check_removed_details = None
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| get_lookup(self, lookup_name)
|
| get_transform(self, lookup_name)
|
| ----------------------------------------------------------------------
| Class methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| get_lookups() from builtins.type
|
| register_lookup(lookup, lookup_name=None) from builtins.type
|
| ----------------------------------------------------------------------
| Static methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| merge_dicts(dicts)
| Merge dicts in reverse to preference the order of the original list. e.g.,
| merge_dicts([a, b]) will preference the keys in 'a' over those in 'b'.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
class Case(Expression)
| An SQL searched CASE expression:
|
| CASE
| WHEN n > 0
| THEN 'positive'
| WHEN n < 0
| THEN 'negative'
| ELSE 'zero'
| END
|
| Method resolution order:
| Case
| Expression
| BaseExpression
| Combinable
| builtins.object
|
| Methods defined here:
|
| __init__(self, *cases, default=None, output_field=None, **extra)
| Initialize self. See help(type(self)) for accurate signature.
|
| __repr__(self)
| Return repr(self).
|
| __str__(self)
| Return str(self).
|
| as_sql(self, compiler, connection, template=None, case_joiner=None, **extra_context)
| Responsible for returning a (sql, [params]) tuple to be included
| in the current query.
|
| Different backends can provide their own implementation, by
| providing an `as_{vendor}` method and patching the Expression:
|
| ```
| def override_as_sql(self, compiler, connection):
| # custom logic
| return super().as_sql(compiler, connection)
| setattr(Expression, 'as_' + connection.vendor, override_as_sql)
| ```
|
| Arguments:
| * compiler: the query compiler responsible for generating the query.
| Must have a compile method, returning a (sql, [params]) tuple.
| Calling compiler(value) will return a quoted `value`.
|
| * connection: the database connection used for the current query.
|
| Return: (sql, params)
| Where `sql` is a string containing ordered sql parameters to be
| replaced with the elements of the list `params`.
|
| copy(self)
|
| get_source_expressions(self)
|
| resolve_expression(self, query=None, allow_joins=True, reuse=None, summarize=False, for_save=False)
| Provide the chance to do any preprocessing or validation before being
| added to the query.
|
| Arguments:
| * query: the backend query implementation
| * allow_joins: boolean allowing or denying use of joins
| in this query
| * reuse: a set of reusable joins for multijoins
| * summarize: a terminal aggregate clause
| * for_save: whether this expression about to be used in a save or update
|
| Return: an Expression to be added to the query.
|
| set_source_expressions(self, exprs)
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| case_joiner = ' '
|
| template = 'CASE %(cases)s ELSE %(default)s END'
|
| ----------------------------------------------------------------------
| Methods inherited from BaseExpression:
|
| __eq__(self, other)
| Return self==value.
|
| __getstate__(self)
|
| __hash__(self)
| Return hash(self).
|
| asc(self, **kwargs)
|
| contains_aggregate = <django.utils.functional.cached_property object>
| contains_column_references = <django.utils.functional.cached_property object>
| contains_over_clause = <django.utils.functional.cached_property object>
| convert_value = <django.utils.functional.cached_property object>
| deconstruct(obj)
| Return a 3-tuple of class import path, positional arguments,
| and keyword arguments.
|
| desc(self, **kwargs)
|
| flatten(self)
| Recursively yield this expression and all subexpressions, in
| depth-first order.
|
| get_db_converters(self, connection)
|
| get_group_by_cols(self)
|
| get_lookup(self, lookup)
|
| get_source_fields(self)
| Return the underlying field types used by this aggregate.
|
| get_transform(self, name)
|
| output_field = <django.utils.functional.cached_property object>
| relabeled_clone(self, change_map)
|
| reverse_ordering(self)
|
| ----------------------------------------------------------------------
| Static methods inherited from BaseExpression:
|
| __new__(cls, *args, **kwargs)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from BaseExpression:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
|
| field
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from BaseExpression:
|
| filterable = True
|
| is_summary = False
|
| window_compatible = False
|
| ----------------------------------------------------------------------
| Methods inherited from Combinable:
|
| __add__(self, other)
|
| __and__(self, other)
|
| __mod__(self, other)
|
| __mul__(self, other)
|
| __or__(self, other)
|
| __pow__(self, other)
|
| __radd__(self, other)
|
| __rand__(self, other)
|
| __rmod__(self, other)
|
| __rmul__(self, other)
|
| __ror__(self, other)
|
| __rpow__(self, other)
|
| __rsub__(self, other)
|
| __rtruediv__(self, other)
|
| __sub__(self, other)
|
| __truediv__(self, other)
|
| bitand(self, other)
|
| bitleftshift(self, other)
|
| bitor(self, other)
|
| bitrightshift(self, other)
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from Combinable:
|
| ADD = '+'
|
| BITAND = '&'
|
| BITLEFTSHIFT = '<<'
|
| BITOR = '|'
|
| BITRIGHTSHIFT = '>>'
|
| DIV = '/'
|
| MOD = '%%'
|
| MUL = '*'
|
| POW = '^'
|
| SUB = '-'
class CharField(Field)
| Base class for all field types
|
| Method resolution order:
| CharField
| Field
| django.db.models.query_utils.RegisterLookupMixin
| builtins.object
|
| Methods defined here:
|
| __init__(self, *args, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| cast_db_type(self, connection)
| Return the data type to use in the Cast() function.
|
| check(self, **kwargs)
|
| formfield(self, **kwargs)
| Return a django.forms.Field instance for this field.
|
| get_internal_type(self)
|
| get_prep_value(self, value)
| Perform preliminary non-db specific value checks and conversions.
|
| to_python(self, value)
| Convert the input value into the expected Python data type, raising
| django.core.exceptions.ValidationError if the data can't be converted.
| Return the converted value. Subclasses should override this.
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| description = 'String (up to %(max_length)s)'
|
| ----------------------------------------------------------------------
| Methods inherited from Field:
|
| __copy__(self)
|
| __deepcopy__(self, memodict)
|
| __eq__(self, other)
| Return self==value.
|
| __ge__(self, other, NotImplemented=NotImplemented)
| Return a >= b. Computed by @total_ordering from (not a < b).
|
| __gt__(self, other, NotImplemented=NotImplemented)
| Return a > b. Computed by @total_ordering from (not a < b) and (a != b).
|
| __hash__(self)
| Return hash(self).
|
| __le__(self, other, NotImplemented=NotImplemented)
| Return a <= b. Computed by @total_ordering from (a < b) or (a == b).
|
| __lt__(self, other)
| Return self<value.
|
| __reduce__(self)
| Pickling should return the model._meta.fields instance of the field,
| not a new copy of that field. So, use the app registry to load the
| model and then the field back.
|
| __repr__(self)
| Display the module, class, and name of the field.
|
| __str__(self)
| Return "app_label.model_label.field_name" for fields attached to
| models.
|
| cached_col = <django.utils.functional.cached_property object>
| clean(self, value, model_instance)
| Convert the value's type and run validation. Validation errors
| from to_python() and validate() are propagated. Return the correct
| value if no error is raised.
|
| clone(self)
| Uses deconstruct() to clone a new copy of this Field.
| Will not preserve any class attachments/attribute names.
|
| contribute_to_class(self, cls, name, private_only=False)
| Register the field with the model class it belongs to.
|
| If private_only is True, create a separate instance of this field
| for every subclass of cls, even if cls is not an abstract model.
|
| db_check(self, connection)
| Return the database column check constraint for this field, for the
| provided connection. Works the same way as db_type() for the case that
| get_internal_type() does not map to a preexisting model field.
|
| db_parameters(self, connection)
| Extension of db_type(), providing a range of different return values
| (type, checks). This will look at db_type(), allowing custom model
| fields to override it.
|
| db_type(self, connection)
| Return the database column data type for this field, for the provided
| connection.
|
| db_type_parameters(self, connection)
|
| db_type_suffix(self, connection)
|
| deconstruct(self)
| Return enough information to recreate the field as a 4-tuple:
|
| * The name of the field on the model, if contribute_to_class() has
| been run.
| * The import path of the field, including the class:e.g.
| django.db.models.IntegerField This should be the most portable
| version, so less specific may be better.
| * A list of positional arguments.
| * A dict of keyword arguments.
|
| Note that the positional or keyword arguments must contain values of
| the following types (including inner values of collection types):
|
| * None, bool, str, int, float, complex, set, frozenset, list, tuple,
| dict
| * UUID
| * datetime.datetime (naive), datetime.date
| * top-level classes, top-level functions - will be referenced by their
| full import path
| * Storage instances - these have their own deconstruct() method
|
| This is because the values here must be serialized into a text format
| (possibly new Python code, possibly JSON) and these are the only types
| with encoding handlers defined.
|
| There's no need to return the exact way the field was instantiated this
| time, just ensure that the resulting field is the same - prefer keyword
| arguments over positional ones, and omit parameters with their default
| values.
|
| get_attname(self)
|
| get_attname_column(self)
|
| get_choices(self, include_blank=True, blank_choice=[('', '---------')], limit_choices_to=None)
| Return choices with a default blank choices included, for use
| as <select> choices for this field.
|
| get_col(self, alias, output_field=None)
|
| get_db_converters(self, connection)
|
| get_db_prep_save(self, value, connection)
| Return field's value prepared for saving into a database.
|
| get_db_prep_value(self, value, connection, prepared=False)
| Return field's value prepared for interacting with the database backend.
|
| Used by the default implementations of get_db_prep_save().
|
| get_default(self)
| Return the default value for this field.
|
| get_filter_kwargs_for_object(self, obj)
| Return a dict that when passed as kwargs to self.model.filter(), would
| yield all instances having the same value for this field as obj has.
|
| get_pk_value_on_save(self, instance)
| Hook to generate new PK values on save. This method is called when
| saving instances with no primary key value set. If this method returns
| something else than None, then the returned value is used when saving
| the new instance.
|
| has_default(self)
| Return a boolean of whether this field has a default value.
|
| pre_save(self, model_instance, add)
| Return field's value just before saving.
|
| rel_db_type(self, connection)
| Return the data type that a related field pointing to this field should
| use. For example, this method is called by ForeignKey and OneToOneField
| to determine its data type.
|
| run_validators(self, value)
|
| save_form_data(self, instance, data)
|
| select_format(self, compiler, sql, params)
| Custom format for select clauses. For example, GIS columns need to be
| selected as AsText(table.col) on MySQL as the table.col data can't be
| used by Django.
|
| set_attributes_from_name(self, name)
|
| validate(self, value, model_instance)
| Validate value and raise ValidationError if necessary. Subclasses
| should override this to provide validation logic.
|
| validators = <django.utils.functional.cached_property object>
| value_from_object(self, obj)
| Return the value of this field in the given model instance.
|
| value_to_string(self, obj)
| Return a string value of this field from the passed obj.
| This is used by the serialization framework.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from Field:
|
| db_tablespace
|
| flatchoices
| Flattened version of choices tuple.
|
| unique
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from Field:
|
| auto_creation_counter = -11
|
| class_lookups = {'contains': <class 'django.db.models.lookups.Contains...
|
| creation_counter = 58
|
| default_error_messages = {'blank': 'This field cannot be blank.', 'inv...
|
| default_validators = []
|
| empty_strings_allowed = True
|
| empty_values = [None, '', [], (), {}]
|
| hidden = False
|
| many_to_many = None
|
| many_to_one = None
|
| one_to_many = None
|
| one_to_one = None
|
| related_model = None
|
| system_check_deprecated_details = None
|
| system_check_removed_details = None
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| get_lookup(self, lookup_name)
|
| get_transform(self, lookup_name)
|
| ----------------------------------------------------------------------
| Class methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| get_lookups() from builtins.type
|
| register_lookup(lookup, lookup_name=None) from builtins.type
|
| ----------------------------------------------------------------------
| Static methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| merge_dicts(dicts)
| Merge dicts in reverse to preference the order of the original list. e.g.,
| merge_dicts([a, b]) will preference the keys in 'a' over those in 'b'.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
class CommaSeparatedIntegerField(CharField)
| Base class for all field types
|
| Method resolution order:
| CommaSeparatedIntegerField
| CharField
| Field
| django.db.models.query_utils.RegisterLookupMixin
| builtins.object
|
| Data and other attributes defined here:
|
| default_validators = [<django.core.validators.RegexValidator object>]
|
| description = 'Comma-separated integers'
|
| system_check_removed_details = {'hint': 'Use CharField(validators=[val...
|
| ----------------------------------------------------------------------
| Methods inherited from CharField:
|
| __init__(self, *args, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| cast_db_type(self, connection)
| Return the data type to use in the Cast() function.
|
| check(self, **kwargs)
|
| formfield(self, **kwargs)
| Return a django.forms.Field instance for this field.
|
| get_internal_type(self)
|
| get_prep_value(self, value)
| Perform preliminary non-db specific value checks and conversions.
|
| to_python(self, value)
| Convert the input value into the expected Python data type, raising
| django.core.exceptions.ValidationError if the data can't be converted.
| Return the converted value. Subclasses should override this.
|
| ----------------------------------------------------------------------
| Methods inherited from Field:
|
| __copy__(self)
|
| __deepcopy__(self, memodict)
|
| __eq__(self, other)
| Return self==value.
|
| __ge__(self, other, NotImplemented=NotImplemented)
| Return a >= b. Computed by @total_ordering from (not a < b).
|
| __gt__(self, other, NotImplemented=NotImplemented)
| Return a > b. Computed by @total_ordering from (not a < b) and (a != b).
|
| __hash__(self)
| Return hash(self).
|
| __le__(self, other, NotImplemented=NotImplemented)
| Return a <= b. Computed by @total_ordering from (a < b) or (a == b).
|
| __lt__(self, other)
| Return self<value.
|
| __reduce__(self)
| Pickling should return the model._meta.fields instance of the field,
| not a new copy of that field. So, use the app registry to load the
| model and then the field back.
|
| __repr__(self)
| Display the module, class, and name of the field.
|
| __str__(self)
| Return "app_label.model_label.field_name" for fields attached to
| models.
|
| cached_col = <django.utils.functional.cached_property object>
| clean(self, value, model_instance)
| Convert the value's type and run validation. Validation errors
| from to_python() and validate() are propagated. Return the correct
| value if no error is raised.
|
| clone(self)
| Uses deconstruct() to clone a new copy of this Field.
| Will not preserve any class attachments/attribute names.
|
| contribute_to_class(self, cls, name, private_only=False)
| Register the field with the model class it belongs to.
|
| If private_only is True, create a separate instance of this field
| for every subclass of cls, even if cls is not an abstract model.
|
| db_check(self, connection)
| Return the database column check constraint for this field, for the
| provided connection. Works the same way as db_type() for the case that
| get_internal_type() does not map to a preexisting model field.
|
| db_parameters(self, connection)
| Extension of db_type(), providing a range of different return values
| (type, checks). This will look at db_type(), allowing custom model
| fields to override it.
|
| db_type(self, connection)
| Return the database column data type for this field, for the provided
| connection.
|
| db_type_parameters(self, connection)
|
| db_type_suffix(self, connection)
|
| deconstruct(self)
| Return enough information to recreate the field as a 4-tuple:
|
| * The name of the field on the model, if contribute_to_class() has
| been run.
| * The import path of the field, including the class:e.g.
| django.db.models.IntegerField This should be the most portable
| version, so less specific may be better.
| * A list of positional arguments.
| * A dict of keyword arguments.
|
| Note that the positional or keyword arguments must contain values of
| the following types (including inner values of collection types):
|
| * None, bool, str, int, float, complex, set, frozenset, list, tuple,
| dict
| * UUID
| * datetime.datetime (naive), datetime.date
| * top-level classes, top-level functions - will be referenced by their
| full import path
| * Storage instances - these have their own deconstruct() method
|
| This is because the values here must be serialized into a text format
| (possibly new Python code, possibly JSON) and these are the only types
| with encoding handlers defined.
|
| There's no need to return the exact way the field was instantiated this
| time, just ensure that the resulting field is the same - prefer keyword
| arguments over positional ones, and omit parameters with their default
| values.
|
| get_attname(self)
|
| get_attname_column(self)
|
| get_choices(self, include_blank=True, blank_choice=[('', '---------')], limit_choices_to=None)
| Return choices with a default blank choices included, for use
| as <select> choices for this field.
|
| get_col(self, alias, output_field=None)
|
| get_db_converters(self, connection)
|
| get_db_prep_save(self, value, connection)
| Return field's value prepared for saving into a database.
|
| get_db_prep_value(self, value, connection, prepared=False)
| Return field's value prepared for interacting with the database backend.
|
| Used by the default implementations of get_db_prep_save().
|
| get_default(self)
| Return the default value for this field.
|
| get_filter_kwargs_for_object(self, obj)
| Return a dict that when passed as kwargs to self.model.filter(), would
| yield all instances having the same value for this field as obj has.
|
| get_pk_value_on_save(self, instance)
| Hook to generate new PK values on save. This method is called when
| saving instances with no primary key value set. If this method returns
| something else than None, then the returned value is used when saving
| the new instance.
|
| has_default(self)
| Return a boolean of whether this field has a default value.
|
| pre_save(self, model_instance, add)
| Return field's value just before saving.
|
| rel_db_type(self, connection)
| Return the data type that a related field pointing to this field should
| use. For example, this method is called by ForeignKey and OneToOneField
| to determine its data type.
|
| run_validators(self, value)
|
| save_form_data(self, instance, data)
|
| select_format(self, compiler, sql, params)
| Custom format for select clauses. For example, GIS columns need to be
| selected as AsText(table.col) on MySQL as the table.col data can't be
| used by Django.
|
| set_attributes_from_name(self, name)
|
| validate(self, value, model_instance)
| Validate value and raise ValidationError if necessary. Subclasses
| should override this to provide validation logic.
|
| validators = <django.utils.functional.cached_property object>
| value_from_object(self, obj)
| Return the value of this field in the given model instance.
|
| value_to_string(self, obj)
| Return a string value of this field from the passed obj.
| This is used by the serialization framework.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from Field:
|
| db_tablespace
|
| flatchoices
| Flattened version of choices tuple.
|
| unique
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from Field:
|
| auto_creation_counter = -11
|
| class_lookups = {'contains': <class 'django.db.models.lookups.Contains...
|
| creation_counter = 58
|
| default_error_messages = {'blank': 'This field cannot be blank.', 'inv...
|
| empty_strings_allowed = True
|
| empty_values = [None, '', [], (), {}]
|
| hidden = False
|
| many_to_many = None
|
| many_to_one = None
|
| one_to_many = None
|
| one_to_one = None
|
| related_model = None
|
| system_check_deprecated_details = None
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| get_lookup(self, lookup_name)
|
| get_transform(self, lookup_name)
|
| ----------------------------------------------------------------------
| Class methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| get_lookups() from builtins.type
|
| register_lookup(lookup, lookup_name=None) from builtins.type
|
| ----------------------------------------------------------------------
| Static methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| merge_dicts(dicts)
| Merge dicts in reverse to preference the order of the original list. e.g.,
| merge_dicts([a, b]) will preference the keys in 'a' over those in 'b'.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
class Count(Aggregate)
| An SQL function call.
|
| Method resolution order:
| Count
| Aggregate
| django.db.models.expressions.Func
| django.db.models.expressions.SQLiteNumericMixin
| django.db.models.expressions.Expression
| django.db.models.expressions.BaseExpression
| django.db.models.expressions.Combinable
| builtins.object
|
| Methods defined here:
|
| __init__(self, expression, distinct=False, filter=None, **extra)
| Initialize self. See help(type(self)) for accurate signature.
|
| convert_value(self, value, expression, connection)
| Expressions provide their own converters because users have the option
| of manually specifying the output_field which may be a different type
| from the one the database returns.
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| function = 'COUNT'
|
| name = 'Count'
|
| output_field = <django.db.models.fields.IntegerField>
|
| template = '%(function)s(%(distinct)s%(expressions)s)'
|
| ----------------------------------------------------------------------
| Methods inherited from Aggregate:
|
| as_sql(self, compiler, connection, **extra_context)
| Responsible for returning a (sql, [params]) tuple to be included
| in the current query.
|
| Different backends can provide their own implementation, by
| providing an `as_{vendor}` method and patching the Expression:
|
| ```
| def override_as_sql(self, compiler, connection):
| # custom logic
| return super().as_sql(compiler, connection)
| setattr(Expression, 'as_' + connection.vendor, override_as_sql)
| ```
|
| Arguments:
| * compiler: the query compiler responsible for generating the query.
| Must have a compile method, returning a (sql, [params]) tuple.
| Calling compiler(value) will return a quoted `value`.
|
| * connection: the database connection used for the current query.
|
| Return: (sql, params)
| Where `sql` is a string containing ordered sql parameters to be
| replaced with the elements of the list `params`.
|
| get_group_by_cols(self)
|
| get_source_expressions(self)
|
| get_source_fields(self)
| Return the underlying field types used by this aggregate.
|
| resolve_expression(self, query=None, allow_joins=True, reuse=None, summarize=False, for_save=False)
| Provide the chance to do any preprocessing or validation before being
| added to the query.
|
| Arguments:
| * query: the backend query implementation
| * allow_joins: boolean allowing or denying use of joins
| in this query
| * reuse: a set of reusable joins for multijoins
| * summarize: a terminal aggregate clause
| * for_save: whether this expression about to be used in a save or update
|
| Return: an Expression to be added to the query.
|
| set_source_expressions(self, exprs)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from Aggregate:
|
| default_alias
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from Aggregate:
|
| contains_aggregate = True
|
| filter_template = '%s FILTER (WHERE %%(filter)s)'
|
| window_compatible = True
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.expressions.Func:
|
| __repr__(self)
| Return repr(self).
|
| copy(self)
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from django.db.models.expressions.Func:
|
| arg_joiner = ', '
|
| arity = None
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.expressions.SQLiteNumericMixin:
|
| as_sqlite(self, compiler, connection, **extra_context)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from django.db.models.expressions.SQLiteNumericMixin:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.expressions.BaseExpression:
|
| __eq__(self, other)
| Return self==value.
|
| __getstate__(self)
|
| __hash__(self)
| Return hash(self).
|
| asc(self, **kwargs)
|
| contains_column_references = <django.utils.functional.cached_property object>
| contains_over_clause = <django.utils.functional.cached_property object>
| deconstruct(obj)
| Return a 3-tuple of class import path, positional arguments,
| and keyword arguments.
|
| desc(self, **kwargs)
|
| flatten(self)
| Recursively yield this expression and all subexpressions, in
| depth-first order.
|
| get_db_converters(self, connection)
|
| get_lookup(self, lookup)
|
| get_transform(self, name)
|
| relabeled_clone(self, change_map)
|
| reverse_ordering(self)
|
| ----------------------------------------------------------------------
| Static methods inherited from django.db.models.expressions.BaseExpression:
|
| __new__(cls, *args, **kwargs)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from django.db.models.expressions.BaseExpression:
|
| field
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from django.db.models.expressions.BaseExpression:
|
| filterable = True
|
| is_summary = False
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.expressions.Combinable:
|
| __add__(self, other)
|
| __and__(self, other)
|
| __mod__(self, other)
|
| __mul__(self, other)
|
| __or__(self, other)
|
| __pow__(self, other)
|
| __radd__(self, other)
|
| __rand__(self, other)
|
| __rmod__(self, other)
|
| __rmul__(self, other)
|
| __ror__(self, other)
|
| __rpow__(self, other)
|
| __rsub__(self, other)
|
| __rtruediv__(self, other)
|
| __sub__(self, other)
|
| __truediv__(self, other)
|
| bitand(self, other)
|
| bitleftshift(self, other)
|
| bitor(self, other)
|
| bitrightshift(self, other)
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from django.db.models.expressions.Combinable:
|
| ADD = '+'
|
| BITAND = '&'
|
| BITLEFTSHIFT = '<<'
|
| BITOR = '|'
|
| BITRIGHTSHIFT = '>>'
|
| DIV = '/'
|
| MOD = '%%'
|
| MUL = '*'
|
| POW = '^'
|
| SUB = '-'
class DateField(DateTimeCheckMixin, Field)
| Base class for all field types
|
| Method resolution order:
| DateField
| DateTimeCheckMixin
| Field
| django.db.models.query_utils.RegisterLookupMixin
| builtins.object
|
| Methods defined here:
|
| __init__(self, verbose_name=None, name=None, auto_now=False, auto_now_add=False, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| contribute_to_class(self, cls, name, **kwargs)
| Register the field with the model class it belongs to.
|
| If private_only is True, create a separate instance of this field
| for every subclass of cls, even if cls is not an abstract model.
|
| deconstruct(self)
| Return enough information to recreate the field as a 4-tuple:
|
| * The name of the field on the model, if contribute_to_class() has
| been run.
| * The import path of the field, including the class:e.g.
| django.db.models.IntegerField This should be the most portable
| version, so less specific may be better.
| * A list of positional arguments.
| * A dict of keyword arguments.
|
| Note that the positional or keyword arguments must contain values of
| the following types (including inner values of collection types):
|
| * None, bool, str, int, float, complex, set, frozenset, list, tuple,
| dict
| * UUID
| * datetime.datetime (naive), datetime.date
| * top-level classes, top-level functions - will be referenced by their
| full import path
| * Storage instances - these have their own deconstruct() method
|
| This is because the values here must be serialized into a text format
| (possibly new Python code, possibly JSON) and these are the only types
| with encoding handlers defined.
|
| There's no need to return the exact way the field was instantiated this
| time, just ensure that the resulting field is the same - prefer keyword
| arguments over positional ones, and omit parameters with their default
| values.
|
| formfield(self, **kwargs)
| Return a django.forms.Field instance for this field.
|
| get_db_prep_value(self, value, connection, prepared=False)
| Return field's value prepared for interacting with the database backend.
|
| Used by the default implementations of get_db_prep_save().
|
| get_internal_type(self)
|
| get_prep_value(self, value)
| Perform preliminary non-db specific value checks and conversions.
|
| pre_save(self, model_instance, add)
| Return field's value just before saving.
|
| to_python(self, value)
| Convert the input value into the expected Python data type, raising
| django.core.exceptions.ValidationError if the data can't be converted.
| Return the converted value. Subclasses should override this.
|
| value_to_string(self, obj)
| Return a string value of this field from the passed obj.
| This is used by the serialization framework.
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| class_lookups = {'day': <class 'django.db.models.functions.datetime.Ex...
|
| default_error_messages = {'invalid': "'%(value)s' value has an invalid...
|
| description = 'Date (without time)'
|
| empty_strings_allowed = False
|
| ----------------------------------------------------------------------
| Methods inherited from DateTimeCheckMixin:
|
| check(self, **kwargs)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from DateTimeCheckMixin:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
|
| ----------------------------------------------------------------------
| Methods inherited from Field:
|
| __copy__(self)
|
| __deepcopy__(self, memodict)
|
| __eq__(self, other)
| Return self==value.
|
| __ge__(self, other, NotImplemented=NotImplemented)
| Return a >= b. Computed by @total_ordering from (not a < b).
|
| __gt__(self, other, NotImplemented=NotImplemented)
| Return a > b. Computed by @total_ordering from (not a < b) and (a != b).
|
| __hash__(self)
| Return hash(self).
|
| __le__(self, other, NotImplemented=NotImplemented)
| Return a <= b. Computed by @total_ordering from (a < b) or (a == b).
|
| __lt__(self, other)
| Return self<value.
|
| __reduce__(self)
| Pickling should return the model._meta.fields instance of the field,
| not a new copy of that field. So, use the app registry to load the
| model and then the field back.
|
| __repr__(self)
| Display the module, class, and name of the field.
|
| __str__(self)
| Return "app_label.model_label.field_name" for fields attached to
| models.
|
| cached_col = <django.utils.functional.cached_property object>
| cast_db_type(self, connection)
| Return the data type to use in the Cast() function.
|
| clean(self, value, model_instance)
| Convert the value's type and run validation. Validation errors
| from to_python() and validate() are propagated. Return the correct
| value if no error is raised.
|
| clone(self)
| Uses deconstruct() to clone a new copy of this Field.
| Will not preserve any class attachments/attribute names.
|
| db_check(self, connection)
| Return the database column check constraint for this field, for the
| provided connection. Works the same way as db_type() for the case that
| get_internal_type() does not map to a preexisting model field.
|
| db_parameters(self, connection)
| Extension of db_type(), providing a range of different return values
| (type, checks). This will look at db_type(), allowing custom model
| fields to override it.
|
| db_type(self, connection)
| Return the database column data type for this field, for the provided
| connection.
|
| db_type_parameters(self, connection)
|
| db_type_suffix(self, connection)
|
| get_attname(self)
|
| get_attname_column(self)
|
| get_choices(self, include_blank=True, blank_choice=[('', '---------')], limit_choices_to=None)
| Return choices with a default blank choices included, for use
| as <select> choices for this field.
|
| get_col(self, alias, output_field=None)
|
| get_db_converters(self, connection)
|
| get_db_prep_save(self, value, connection)
| Return field's value prepared for saving into a database.
|
| get_default(self)
| Return the default value for this field.
|
| get_filter_kwargs_for_object(self, obj)
| Return a dict that when passed as kwargs to self.model.filter(), would
| yield all instances having the same value for this field as obj has.
|
| get_pk_value_on_save(self, instance)
| Hook to generate new PK values on save. This method is called when
| saving instances with no primary key value set. If this method returns
| something else than None, then the returned value is used when saving
| the new instance.
|
| has_default(self)
| Return a boolean of whether this field has a default value.
|
| rel_db_type(self, connection)
| Return the data type that a related field pointing to this field should
| use. For example, this method is called by ForeignKey and OneToOneField
| to determine its data type.
|
| run_validators(self, value)
|
| save_form_data(self, instance, data)
|
| select_format(self, compiler, sql, params)
| Custom format for select clauses. For example, GIS columns need to be
| selected as AsText(table.col) on MySQL as the table.col data can't be
| used by Django.
|
| set_attributes_from_name(self, name)
|
| validate(self, value, model_instance)
| Validate value and raise ValidationError if necessary. Subclasses
| should override this to provide validation logic.
|
| validators = <django.utils.functional.cached_property object>
| value_from_object(self, obj)
| Return the value of this field in the given model instance.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from Field:
|
| db_tablespace
|
| flatchoices
| Flattened version of choices tuple.
|
| unique
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from Field:
|
| auto_creation_counter = -11
|
| creation_counter = 58
|
| default_validators = []
|
| empty_values = [None, '', [], (), {}]
|
| hidden = False
|
| many_to_many = None
|
| many_to_one = None
|
| one_to_many = None
|
| one_to_one = None
|
| related_model = None
|
| system_check_deprecated_details = None
|
| system_check_removed_details = None
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| get_lookup(self, lookup_name)
|
| get_transform(self, lookup_name)
|
| ----------------------------------------------------------------------
| Class methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| get_lookups() from builtins.type
|
| register_lookup(lookup, lookup_name=None) from builtins.type
|
| ----------------------------------------------------------------------
| Static methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| merge_dicts(dicts)
| Merge dicts in reverse to preference the order of the original list. e.g.,
| merge_dicts([a, b]) will preference the keys in 'a' over those in 'b'.
class DateTimeField(DateField)
| Base class for all field types
|
| Method resolution order:
| DateTimeField
| DateField
| DateTimeCheckMixin
| Field
| django.db.models.query_utils.RegisterLookupMixin
| builtins.object
|
| Methods defined here:
|
| formfield(self, **kwargs)
| Return a django.forms.Field instance for this field.
|
| get_db_prep_value(self, value, connection, prepared=False)
| Return field's value prepared for interacting with the database backend.
|
| Used by the default implementations of get_db_prep_save().
|
| get_internal_type(self)
|
| get_prep_value(self, value)
| Perform preliminary non-db specific value checks and conversions.
|
| pre_save(self, model_instance, add)
| Return field's value just before saving.
|
| to_python(self, value)
| Convert the input value into the expected Python data type, raising
| django.core.exceptions.ValidationError if the data can't be converted.
| Return the converted value. Subclasses should override this.
|
| value_to_string(self, obj)
| Return a string value of this field from the passed obj.
| This is used by the serialization framework.
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| class_lookups = {'date': <class 'django.db.models.functions.datetime.T...
|
| default_error_messages = {'invalid': "'%(value)s' value has an invalid...
|
| description = 'Date (with time)'
|
| empty_strings_allowed = False
|
| ----------------------------------------------------------------------
| Methods inherited from DateField:
|
| __init__(self, verbose_name=None, name=None, auto_now=False, auto_now_add=False, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| contribute_to_class(self, cls, name, **kwargs)
| Register the field with the model class it belongs to.
|
| If private_only is True, create a separate instance of this field
| for every subclass of cls, even if cls is not an abstract model.
|
| deconstruct(self)
| Return enough information to recreate the field as a 4-tuple:
|
| * The name of the field on the model, if contribute_to_class() has
| been run.
| * The import path of the field, including the class:e.g.
| django.db.models.IntegerField This should be the most portable
| version, so less specific may be better.
| * A list of positional arguments.
| * A dict of keyword arguments.
|
| Note that the positional or keyword arguments must contain values of
| the following types (including inner values of collection types):
|
| * None, bool, str, int, float, complex, set, frozenset, list, tuple,
| dict
| * UUID
| * datetime.datetime (naive), datetime.date
| * top-level classes, top-level functions - will be referenced by their
| full import path
| * Storage instances - these have their own deconstruct() method
|
| This is because the values here must be serialized into a text format
| (possibly new Python code, possibly JSON) and these are the only types
| with encoding handlers defined.
|
| There's no need to return the exact way the field was instantiated this
| time, just ensure that the resulting field is the same - prefer keyword
| arguments over positional ones, and omit parameters with their default
| values.
|
| ----------------------------------------------------------------------
| Methods inherited from DateTimeCheckMixin:
|
| check(self, **kwargs)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from DateTimeCheckMixin:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
|
| ----------------------------------------------------------------------
| Methods inherited from Field:
|
| __copy__(self)
|
| __deepcopy__(self, memodict)
|
| __eq__(self, other)
| Return self==value.
|
| __ge__(self, other, NotImplemented=NotImplemented)
| Return a >= b. Computed by @total_ordering from (not a < b).
|
| __gt__(self, other, NotImplemented=NotImplemented)
| Return a > b. Computed by @total_ordering from (not a < b) and (a != b).
|
| __hash__(self)
| Return hash(self).
|
| __le__(self, other, NotImplemented=NotImplemented)
| Return a <= b. Computed by @total_ordering from (a < b) or (a == b).
|
| __lt__(self, other)
| Return self<value.
|
| __reduce__(self)
| Pickling should return the model._meta.fields instance of the field,
| not a new copy of that field. So, use the app registry to load the
| model and then the field back.
|
| __repr__(self)
| Display the module, class, and name of the field.
|
| __str__(self)
| Return "app_label.model_label.field_name" for fields attached to
| models.
|
| cached_col = <django.utils.functional.cached_property object>
| cast_db_type(self, connection)
| Return the data type to use in the Cast() function.
|
| clean(self, value, model_instance)
| Convert the value's type and run validation. Validation errors
| from to_python() and validate() are propagated. Return the correct
| value if no error is raised.
|
| clone(self)
| Uses deconstruct() to clone a new copy of this Field.
| Will not preserve any class attachments/attribute names.
|
| db_check(self, connection)
| Return the database column check constraint for this field, for the
| provided connection. Works the same way as db_type() for the case that
| get_internal_type() does not map to a preexisting model field.
|
| db_parameters(self, connection)
| Extension of db_type(), providing a range of different return values
| (type, checks). This will look at db_type(), allowing custom model
| fields to override it.
|
| db_type(self, connection)
| Return the database column data type for this field, for the provided
| connection.
|
| db_type_parameters(self, connection)
|
| db_type_suffix(self, connection)
|
| get_attname(self)
|
| get_attname_column(self)
|
| get_choices(self, include_blank=True, blank_choice=[('', '---------')], limit_choices_to=None)
| Return choices with a default blank choices included, for use
| as <select> choices for this field.
|
| get_col(self, alias, output_field=None)
|
| get_db_converters(self, connection)
|
| get_db_prep_save(self, value, connection)
| Return field's value prepared for saving into a database.
|
| get_default(self)
| Return the default value for this field.
|
| get_filter_kwargs_for_object(self, obj)
| Return a dict that when passed as kwargs to self.model.filter(), would
| yield all instances having the same value for this field as obj has.
|
| get_pk_value_on_save(self, instance)
| Hook to generate new PK values on save. This method is called when
| saving instances with no primary key value set. If this method returns
| something else than None, then the returned value is used when saving
| the new instance.
|
| has_default(self)
| Return a boolean of whether this field has a default value.
|
| rel_db_type(self, connection)
| Return the data type that a related field pointing to this field should
| use. For example, this method is called by ForeignKey and OneToOneField
| to determine its data type.
|
| run_validators(self, value)
|
| save_form_data(self, instance, data)
|
| select_format(self, compiler, sql, params)
| Custom format for select clauses. For example, GIS columns need to be
| selected as AsText(table.col) on MySQL as the table.col data can't be
| used by Django.
|
| set_attributes_from_name(self, name)
|
| validate(self, value, model_instance)
| Validate value and raise ValidationError if necessary. Subclasses
| should override this to provide validation logic.
|
| validators = <django.utils.functional.cached_property object>
| value_from_object(self, obj)
| Return the value of this field in the given model instance.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from Field:
|
| db_tablespace
|
| flatchoices
| Flattened version of choices tuple.
|
| unique
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from Field:
|
| auto_creation_counter = -11
|
| creation_counter = 58
|
| default_validators = []
|
| empty_values = [None, '', [], (), {}]
|
| hidden = False
|
| many_to_many = None
|
| many_to_one = None
|
| one_to_many = None
|
| one_to_one = None
|
| related_model = None
|
| system_check_deprecated_details = None
|
| system_check_removed_details = None
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| get_lookup(self, lookup_name)
|
| get_transform(self, lookup_name)
|
| ----------------------------------------------------------------------
| Class methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| get_lookups() from builtins.type
|
| register_lookup(lookup, lookup_name=None) from builtins.type
|
| ----------------------------------------------------------------------
| Static methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| merge_dicts(dicts)
| Merge dicts in reverse to preference the order of the original list. e.g.,
| merge_dicts([a, b]) will preference the keys in 'a' over those in 'b'.
class DecimalField(Field)
| Base class for all field types
|
| Method resolution order:
| DecimalField
| Field
| django.db.models.query_utils.RegisterLookupMixin
| builtins.object
|
| Methods defined here:
|
| __init__(self, verbose_name=None, name=None, max_digits=None, decimal_places=None, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| check(self, **kwargs)
|
| context = <django.utils.functional.cached_property object>
| deconstruct(self)
| Return enough information to recreate the field as a 4-tuple:
|
| * The name of the field on the model, if contribute_to_class() has
| been run.
| * The import path of the field, including the class:e.g.
| django.db.models.IntegerField This should be the most portable
| version, so less specific may be better.
| * A list of positional arguments.
| * A dict of keyword arguments.
|
| Note that the positional or keyword arguments must contain values of
| the following types (including inner values of collection types):
|
| * None, bool, str, int, float, complex, set, frozenset, list, tuple,
| dict
| * UUID
| * datetime.datetime (naive), datetime.date
| * top-level classes, top-level functions - will be referenced by their
| full import path
| * Storage instances - these have their own deconstruct() method
|
| This is because the values here must be serialized into a text format
| (possibly new Python code, possibly JSON) and these are the only types
| with encoding handlers defined.
|
| There's no need to return the exact way the field was instantiated this
| time, just ensure that the resulting field is the same - prefer keyword
| arguments over positional ones, and omit parameters with their default
| values.
|
| format_number(self, value)
| Format a number into a string with the requisite number of digits and
| decimal places.
|
| formfield(self, **kwargs)
| Return a django.forms.Field instance for this field.
|
| get_db_prep_save(self, value, connection)
| Return field's value prepared for saving into a database.
|
| get_internal_type(self)
|
| get_prep_value(self, value)
| Perform preliminary non-db specific value checks and conversions.
|
| to_python(self, value)
| Convert the input value into the expected Python data type, raising
| django.core.exceptions.ValidationError if the data can't be converted.
| Return the converted value. Subclasses should override this.
|
| validators = <django.utils.functional.cached_property object>
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| default_error_messages = {'invalid': "'%(value)s' value must be a deci...
|
| description = 'Decimal number'
|
| empty_strings_allowed = False
|
| ----------------------------------------------------------------------
| Methods inherited from Field:
|
| __copy__(self)
|
| __deepcopy__(self, memodict)
|
| __eq__(self, other)
| Return self==value.
|
| __ge__(self, other, NotImplemented=NotImplemented)
| Return a >= b. Computed by @total_ordering from (not a < b).
|
| __gt__(self, other, NotImplemented=NotImplemented)
| Return a > b. Computed by @total_ordering from (not a < b) and (a != b).
|
| __hash__(self)
| Return hash(self).
|
| __le__(self, other, NotImplemented=NotImplemented)
| Return a <= b. Computed by @total_ordering from (a < b) or (a == b).
|
| __lt__(self, other)
| Return self<value.
|
| __reduce__(self)
| Pickling should return the model._meta.fields instance of the field,
| not a new copy of that field. So, use the app registry to load the
| model and then the field back.
|
| __repr__(self)
| Display the module, class, and name of the field.
|
| __str__(self)
| Return "app_label.model_label.field_name" for fields attached to
| models.
|
| cached_col = <django.utils.functional.cached_property object>
| cast_db_type(self, connection)
| Return the data type to use in the Cast() function.
|
| clean(self, value, model_instance)
| Convert the value's type and run validation. Validation errors
| from to_python() and validate() are propagated. Return the correct
| value if no error is raised.
|
| clone(self)
| Uses deconstruct() to clone a new copy of this Field.
| Will not preserve any class attachments/attribute names.
|
| contribute_to_class(self, cls, name, private_only=False)
| Register the field with the model class it belongs to.
|
| If private_only is True, create a separate instance of this field
| for every subclass of cls, even if cls is not an abstract model.
|
| db_check(self, connection)
| Return the database column check constraint for this field, for the
| provided connection. Works the same way as db_type() for the case that
| get_internal_type() does not map to a preexisting model field.
|
| db_parameters(self, connection)
| Extension of db_type(), providing a range of different return values
| (type, checks). This will look at db_type(), allowing custom model
| fields to override it.
|
| db_type(self, connection)
| Return the database column data type for this field, for the provided
| connection.
|
| db_type_parameters(self, connection)
|
| db_type_suffix(self, connection)
|
| get_attname(self)
|
| get_attname_column(self)
|
| get_choices(self, include_blank=True, blank_choice=[('', '---------')], limit_choices_to=None)
| Return choices with a default blank choices included, for use
| as <select> choices for this field.
|
| get_col(self, alias, output_field=None)
|
| get_db_converters(self, connection)
|
| get_db_prep_value(self, value, connection, prepared=False)
| Return field's value prepared for interacting with the database backend.
|
| Used by the default implementations of get_db_prep_save().
|
| get_default(self)
| Return the default value for this field.
|
| get_filter_kwargs_for_object(self, obj)
| Return a dict that when passed as kwargs to self.model.filter(), would
| yield all instances having the same value for this field as obj has.
|
| get_pk_value_on_save(self, instance)
| Hook to generate new PK values on save. This method is called when
| saving instances with no primary key value set. If this method returns
| something else than None, then the returned value is used when saving
| the new instance.
|
| has_default(self)
| Return a boolean of whether this field has a default value.
|
| pre_save(self, model_instance, add)
| Return field's value just before saving.
|
| rel_db_type(self, connection)
| Return the data type that a related field pointing to this field should
| use. For example, this method is called by ForeignKey and OneToOneField
| to determine its data type.
|
| run_validators(self, value)
|
| save_form_data(self, instance, data)
|
| select_format(self, compiler, sql, params)
| Custom format for select clauses. For example, GIS columns need to be
| selected as AsText(table.col) on MySQL as the table.col data can't be
| used by Django.
|
| set_attributes_from_name(self, name)
|
| validate(self, value, model_instance)
| Validate value and raise ValidationError if necessary. Subclasses
| should override this to provide validation logic.
|
| value_from_object(self, obj)
| Return the value of this field in the given model instance.
|
| value_to_string(self, obj)
| Return a string value of this field from the passed obj.
| This is used by the serialization framework.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from Field:
|
| db_tablespace
|
| flatchoices
| Flattened version of choices tuple.
|
| unique
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from Field:
|
| auto_creation_counter = -11
|
| class_lookups = {'contains': <class 'django.db.models.lookups.Contains...
|
| creation_counter = 58
|
| default_validators = []
|
| empty_values = [None, '', [], (), {}]
|
| hidden = False
|
| many_to_many = None
|
| many_to_one = None
|
| one_to_many = None
|
| one_to_one = None
|
| related_model = None
|
| system_check_deprecated_details = None
|
| system_check_removed_details = None
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| get_lookup(self, lookup_name)
|
| get_transform(self, lookup_name)
|
| ----------------------------------------------------------------------
| Class methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| get_lookups() from builtins.type
|
| register_lookup(lookup, lookup_name=None) from builtins.type
|
| ----------------------------------------------------------------------
| Static methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| merge_dicts(dicts)
| Merge dicts in reverse to preference the order of the original list. e.g.,
| merge_dicts([a, b]) will preference the keys in 'a' over those in 'b'.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
class DurationField(Field)
| Store timedelta objects.
|
| Use interval on PostgreSQL, INTERVAL DAY TO SECOND on Oracle, and bigint
| of microseconds on other databases.
|
| Method resolution order:
| DurationField
| Field
| django.db.models.query_utils.RegisterLookupMixin
| builtins.object
|
| Methods defined here:
|
| formfield(self, **kwargs)
| Return a django.forms.Field instance for this field.
|
| get_db_converters(self, connection)
|
| get_db_prep_value(self, value, connection, prepared=False)
| Return field's value prepared for interacting with the database backend.
|
| Used by the default implementations of get_db_prep_save().
|
| get_internal_type(self)
|
| to_python(self, value)
| Convert the input value into the expected Python data type, raising
| django.core.exceptions.ValidationError if the data can't be converted.
| Return the converted value. Subclasses should override this.
|
| value_to_string(self, obj)
| Return a string value of this field from the passed obj.
| This is used by the serialization framework.
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| default_error_messages = {'invalid': "'%(value)s' value has an invalid...
|
| description = 'Duration'
|
| empty_strings_allowed = False
|
| ----------------------------------------------------------------------
| Methods inherited from Field:
|
| __copy__(self)
|
| __deepcopy__(self, memodict)
|
| __eq__(self, other)
| Return self==value.
|
| __ge__(self, other, NotImplemented=NotImplemented)
| Return a >= b. Computed by @total_ordering from (not a < b).
|
| __gt__(self, other, NotImplemented=NotImplemented)
| Return a > b. Computed by @total_ordering from (not a < b) and (a != b).
|
| __hash__(self)
| Return hash(self).
|
| __init__(self, verbose_name=None, name=None, primary_key=False, max_length=None, unique=False, blank=False, null=False, db_index=False, rel=None, default=<class 'django.db.models.fields.NOT_PROVIDED'>, editable=True, serialize=True, unique_for_date=None, unique_for_month=None, unique_for_year=None, choices=None, help_text='', db_column=None, db_tablespace=None, auto_created=False, validators=(), error_messages=None)
| Initialize self. See help(type(self)) for accurate signature.
|
| __le__(self, other, NotImplemented=NotImplemented)
| Return a <= b. Computed by @total_ordering from (a < b) or (a == b).
|
| __lt__(self, other)
| Return self<value.
|
| __reduce__(self)
| Pickling should return the model._meta.fields instance of the field,
| not a new copy of that field. So, use the app registry to load the
| model and then the field back.
|
| __repr__(self)
| Display the module, class, and name of the field.
|
| __str__(self)
| Return "app_label.model_label.field_name" for fields attached to
| models.
|
| cached_col = <django.utils.functional.cached_property object>
| cast_db_type(self, connection)
| Return the data type to use in the Cast() function.
|
| check(self, **kwargs)
|
| clean(self, value, model_instance)
| Convert the value's type and run validation. Validation errors
| from to_python() and validate() are propagated. Return the correct
| value if no error is raised.
|
| clone(self)
| Uses deconstruct() to clone a new copy of this Field.
| Will not preserve any class attachments/attribute names.
|
| contribute_to_class(self, cls, name, private_only=False)
| Register the field with the model class it belongs to.
|
| If private_only is True, create a separate instance of this field
| for every subclass of cls, even if cls is not an abstract model.
|
| db_check(self, connection)
| Return the database column check constraint for this field, for the
| provided connection. Works the same way as db_type() for the case that
| get_internal_type() does not map to a preexisting model field.
|
| db_parameters(self, connection)
| Extension of db_type(), providing a range of different return values
| (type, checks). This will look at db_type(), allowing custom model
| fields to override it.
|
| db_type(self, connection)
| Return the database column data type for this field, for the provided
| connection.
|
| db_type_parameters(self, connection)
|
| db_type_suffix(self, connection)
|
| deconstruct(self)
| Return enough information to recreate the field as a 4-tuple:
|
| * The name of the field on the model, if contribute_to_class() has
| been run.
| * The import path of the field, including the class:e.g.
| django.db.models.IntegerField This should be the most portable
| version, so less specific may be better.
| * A list of positional arguments.
| * A dict of keyword arguments.
|
| Note that the positional or keyword arguments must contain values of
| the following types (including inner values of collection types):
|
| * None, bool, str, int, float, complex, set, frozenset, list, tuple,
| dict
| * UUID
| * datetime.datetime (naive), datetime.date
| * top-level classes, top-level functions - will be referenced by their
| full import path
| * Storage instances - these have their own deconstruct() method
|
| This is because the values here must be serialized into a text format
| (possibly new Python code, possibly JSON) and these are the only types
| with encoding handlers defined.
|
| There's no need to return the exact way the field was instantiated this
| time, just ensure that the resulting field is the same - prefer keyword
| arguments over positional ones, and omit parameters with their default
| values.
|
| get_attname(self)
|
| get_attname_column(self)
|
| get_choices(self, include_blank=True, blank_choice=[('', '---------')], limit_choices_to=None)
| Return choices with a default blank choices included, for use
| as <select> choices for this field.
|
| get_col(self, alias, output_field=None)
|
| get_db_prep_save(self, value, connection)
| Return field's value prepared for saving into a database.
|
| get_default(self)
| Return the default value for this field.
|
| get_filter_kwargs_for_object(self, obj)
| Return a dict that when passed as kwargs to self.model.filter(), would
| yield all instances having the same value for this field as obj has.
|
| get_pk_value_on_save(self, instance)
| Hook to generate new PK values on save. This method is called when
| saving instances with no primary key value set. If this method returns
| something else than None, then the returned value is used when saving
| the new instance.
|
| get_prep_value(self, value)
| Perform preliminary non-db specific value checks and conversions.
|
| has_default(self)
| Return a boolean of whether this field has a default value.
|
| pre_save(self, model_instance, add)
| Return field's value just before saving.
|
| rel_db_type(self, connection)
| Return the data type that a related field pointing to this field should
| use. For example, this method is called by ForeignKey and OneToOneField
| to determine its data type.
|
| run_validators(self, value)
|
| save_form_data(self, instance, data)
|
| select_format(self, compiler, sql, params)
| Custom format for select clauses. For example, GIS columns need to be
| selected as AsText(table.col) on MySQL as the table.col data can't be
| used by Django.
|
| set_attributes_from_name(self, name)
|
| validate(self, value, model_instance)
| Validate value and raise ValidationError if necessary. Subclasses
| should override this to provide validation logic.
|
| validators = <django.utils.functional.cached_property object>
| value_from_object(self, obj)
| Return the value of this field in the given model instance.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from Field:
|
| db_tablespace
|
| flatchoices
| Flattened version of choices tuple.
|
| unique
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from Field:
|
| auto_creation_counter = -11
|
| class_lookups = {'contains': <class 'django.db.models.lookups.Contains...
|
| creation_counter = 58
|
| default_validators = []
|
| empty_values = [None, '', [], (), {}]
|
| hidden = False
|
| many_to_many = None
|
| many_to_one = None
|
| one_to_many = None
|
| one_to_one = None
|
| related_model = None
|
| system_check_deprecated_details = None
|
| system_check_removed_details = None
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| get_lookup(self, lookup_name)
|
| get_transform(self, lookup_name)
|
| ----------------------------------------------------------------------
| Class methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| get_lookups() from builtins.type
|
| register_lookup(lookup, lookup_name=None) from builtins.type
|
| ----------------------------------------------------------------------
| Static methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| merge_dicts(dicts)
| Merge dicts in reverse to preference the order of the original list. e.g.,
| merge_dicts([a, b]) will preference the keys in 'a' over those in 'b'.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
class EmailField(CharField)
| Base class for all field types
|
| Method resolution order:
| EmailField
| CharField
| Field
| django.db.models.query_utils.RegisterLookupMixin
| builtins.object
|
| Methods defined here:
|
| __init__(self, *args, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| deconstruct(self)
| Return enough information to recreate the field as a 4-tuple:
|
| * The name of the field on the model, if contribute_to_class() has
| been run.
| * The import path of the field, including the class:e.g.
| django.db.models.IntegerField This should be the most portable
| version, so less specific may be better.
| * A list of positional arguments.
| * A dict of keyword arguments.
|
| Note that the positional or keyword arguments must contain values of
| the following types (including inner values of collection types):
|
| * None, bool, str, int, float, complex, set, frozenset, list, tuple,
| dict
| * UUID
| * datetime.datetime (naive), datetime.date
| * top-level classes, top-level functions - will be referenced by their
| full import path
| * Storage instances - these have their own deconstruct() method
|
| This is because the values here must be serialized into a text format
| (possibly new Python code, possibly JSON) and these are the only types
| with encoding handlers defined.
|
| There's no need to return the exact way the field was instantiated this
| time, just ensure that the resulting field is the same - prefer keyword
| arguments over positional ones, and omit parameters with their default
| values.
|
| formfield(self, **kwargs)
| Return a django.forms.Field instance for this field.
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| default_validators = [<django.core.validators.EmailValidator object>]
|
| description = 'Email address'
|
| ----------------------------------------------------------------------
| Methods inherited from CharField:
|
| cast_db_type(self, connection)
| Return the data type to use in the Cast() function.
|
| check(self, **kwargs)
|
| get_internal_type(self)
|
| get_prep_value(self, value)
| Perform preliminary non-db specific value checks and conversions.
|
| to_python(self, value)
| Convert the input value into the expected Python data type, raising
| django.core.exceptions.ValidationError if the data can't be converted.
| Return the converted value. Subclasses should override this.
|
| ----------------------------------------------------------------------
| Methods inherited from Field:
|
| __copy__(self)
|
| __deepcopy__(self, memodict)
|
| __eq__(self, other)
| Return self==value.
|
| __ge__(self, other, NotImplemented=NotImplemented)
| Return a >= b. Computed by @total_ordering from (not a < b).
|
| __gt__(self, other, NotImplemented=NotImplemented)
| Return a > b. Computed by @total_ordering from (not a < b) and (a != b).
|
| __hash__(self)
| Return hash(self).
|
| __le__(self, other, NotImplemented=NotImplemented)
| Return a <= b. Computed by @total_ordering from (a < b) or (a == b).
|
| __lt__(self, other)
| Return self<value.
|
| __reduce__(self)
| Pickling should return the model._meta.fields instance of the field,
| not a new copy of that field. So, use the app registry to load the
| model and then the field back.
|
| __repr__(self)
| Display the module, class, and name of the field.
|
| __str__(self)
| Return "app_label.model_label.field_name" for fields attached to
| models.
|
| cached_col = <django.utils.functional.cached_property object>
| clean(self, value, model_instance)
| Convert the value's type and run validation. Validation errors
| from to_python() and validate() are propagated. Return the correct
| value if no error is raised.
|
| clone(self)
| Uses deconstruct() to clone a new copy of this Field.
| Will not preserve any class attachments/attribute names.
|
| contribute_to_class(self, cls, name, private_only=False)
| Register the field with the model class it belongs to.
|
| If private_only is True, create a separate instance of this field
| for every subclass of cls, even if cls is not an abstract model.
|
| db_check(self, connection)
| Return the database column check constraint for this field, for the
| provided connection. Works the same way as db_type() for the case that
| get_internal_type() does not map to a preexisting model field.
|
| db_parameters(self, connection)
| Extension of db_type(), providing a range of different return values
| (type, checks). This will look at db_type(), allowing custom model
| fields to override it.
|
| db_type(self, connection)
| Return the database column data type for this field, for the provided
| connection.
|
| db_type_parameters(self, connection)
|
| db_type_suffix(self, connection)
|
| get_attname(self)
|
| get_attname_column(self)
|
| get_choices(self, include_blank=True, blank_choice=[('', '---------')], limit_choices_to=None)
| Return choices with a default blank choices included, for use
| as <select> choices for this field.
|
| get_col(self, alias, output_field=None)
|
| get_db_converters(self, connection)
|
| get_db_prep_save(self, value, connection)
| Return field's value prepared for saving into a database.
|
| get_db_prep_value(self, value, connection, prepared=False)
| Return field's value prepared for interacting with the database backend.
|
| Used by the default implementations of get_db_prep_save().
|
| get_default(self)
| Return the default value for this field.
|
| get_filter_kwargs_for_object(self, obj)
| Return a dict that when passed as kwargs to self.model.filter(), would
| yield all instances having the same value for this field as obj has.
|
| get_pk_value_on_save(self, instance)
| Hook to generate new PK values on save. This method is called when
| saving instances with no primary key value set. If this method returns
| something else than None, then the returned value is used when saving
| the new instance.
|
| has_default(self)
| Return a boolean of whether this field has a default value.
|
| pre_save(self, model_instance, add)
| Return field's value just before saving.
|
| rel_db_type(self, connection)
| Return the data type that a related field pointing to this field should
| use. For example, this method is called by ForeignKey and OneToOneField
| to determine its data type.
|
| run_validators(self, value)
|
| save_form_data(self, instance, data)
|
| select_format(self, compiler, sql, params)
| Custom format for select clauses. For example, GIS columns need to be
| selected as AsText(table.col) on MySQL as the table.col data can't be
| used by Django.
|
| set_attributes_from_name(self, name)
|
| validate(self, value, model_instance)
| Validate value and raise ValidationError if necessary. Subclasses
| should override this to provide validation logic.
|
| validators = <django.utils.functional.cached_property object>
| value_from_object(self, obj)
| Return the value of this field in the given model instance.
|
| value_to_string(self, obj)
| Return a string value of this field from the passed obj.
| This is used by the serialization framework.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from Field:
|
| db_tablespace
|
| flatchoices
| Flattened version of choices tuple.
|
| unique
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from Field:
|
| auto_creation_counter = -11
|
| class_lookups = {'contains': <class 'django.db.models.lookups.Contains...
|
| creation_counter = 58
|
| default_error_messages = {'blank': 'This field cannot be blank.', 'inv...
|
| empty_strings_allowed = True
|
| empty_values = [None, '', [], (), {}]
|
| hidden = False
|
| many_to_many = None
|
| many_to_one = None
|
| one_to_many = None
|
| one_to_one = None
|
| related_model = None
|
| system_check_deprecated_details = None
|
| system_check_removed_details = None
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| get_lookup(self, lookup_name)
|
| get_transform(self, lookup_name)
|
| ----------------------------------------------------------------------
| Class methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| get_lookups() from builtins.type
|
| register_lookup(lookup, lookup_name=None) from builtins.type
|
| ----------------------------------------------------------------------
| Static methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| merge_dicts(dicts)
| Merge dicts in reverse to preference the order of the original list. e.g.,
| merge_dicts([a, b]) will preference the keys in 'a' over those in 'b'.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
class Empty(builtins.object)
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
class Exists(Subquery)
| An explicit subquery. It may contain OuterRef() references to the outer
| query which will be resolved when it is applied to that query.
|
| Method resolution order:
| Exists
| Subquery
| Expression
| BaseExpression
| Combinable
| builtins.object
|
| Methods defined here:
|
| __init__(self, *args, negated=False, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| __invert__(self)
|
| as_oracle(self, compiler, connection, template=None, **extra_context)
|
| as_sql(self, compiler, connection, template=None, **extra_context)
| Responsible for returning a (sql, [params]) tuple to be included
| in the current query.
|
| Different backends can provide their own implementation, by
| providing an `as_{vendor}` method and patching the Expression:
|
| ```
| def override_as_sql(self, compiler, connection):
| # custom logic
| return super().as_sql(compiler, connection)
| setattr(Expression, 'as_' + connection.vendor, override_as_sql)
| ```
|
| Arguments:
| * compiler: the query compiler responsible for generating the query.
| Must have a compile method, returning a (sql, [params]) tuple.
| Calling compiler(value) will return a quoted `value`.
|
| * connection: the database connection used for the current query.
|
| Return: (sql, params)
| Where `sql` is a string containing ordered sql parameters to be
| replaced with the elements of the list `params`.
|
| resolve_expression(self, query=None, **kwargs)
| Provide the chance to do any preprocessing or validation before being
| added to the query.
|
| Arguments:
| * query: the backend query implementation
| * allow_joins: boolean allowing or denying use of joins
| in this query
| * reuse: a set of reusable joins for multijoins
| * summarize: a terminal aggregate clause
| * for_save: whether this expression about to be used in a save or update
|
| Return: an Expression to be added to the query.
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| output_field = <django.db.models.fields.BooleanField>
|
| template = 'EXISTS(%(subquery)s)'
|
| ----------------------------------------------------------------------
| Methods inherited from Subquery:
|
| copy(self)
|
| get_source_expressions(self)
|
| relabeled_clone(self, change_map)
|
| ----------------------------------------------------------------------
| Methods inherited from BaseExpression:
|
| __eq__(self, other)
| Return self==value.
|
| __getstate__(self)
|
| __hash__(self)
| Return hash(self).
|
| asc(self, **kwargs)
|
| contains_aggregate = <django.utils.functional.cached_property object>
| contains_column_references = <django.utils.functional.cached_property object>
| contains_over_clause = <django.utils.functional.cached_property object>
| convert_value = <django.utils.functional.cached_property object>
| deconstruct(obj)
| Return a 3-tuple of class import path, positional arguments,
| and keyword arguments.
|
| desc(self, **kwargs)
|
| flatten(self)
| Recursively yield this expression and all subexpressions, in
| depth-first order.
|
| get_db_converters(self, connection)
|
| get_group_by_cols(self)
|
| get_lookup(self, lookup)
|
| get_source_fields(self)
| Return the underlying field types used by this aggregate.
|
| get_transform(self, name)
|
| reverse_ordering(self)
|
| set_source_expressions(self, exprs)
|
| ----------------------------------------------------------------------
| Static methods inherited from BaseExpression:
|
| __new__(cls, *args, **kwargs)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from BaseExpression:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
|
| field
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from BaseExpression:
|
| filterable = True
|
| is_summary = False
|
| window_compatible = False
|
| ----------------------------------------------------------------------
| Methods inherited from Combinable:
|
| __add__(self, other)
|
| __and__(self, other)
|
| __mod__(self, other)
|
| __mul__(self, other)
|
| __or__(self, other)
|
| __pow__(self, other)
|
| __radd__(self, other)
|
| __rand__(self, other)
|
| __rmod__(self, other)
|
| __rmul__(self, other)
|
| __ror__(self, other)
|
| __rpow__(self, other)
|
| __rsub__(self, other)
|
| __rtruediv__(self, other)
|
| __sub__(self, other)
|
| __truediv__(self, other)
|
| bitand(self, other)
|
| bitleftshift(self, other)
|
| bitor(self, other)
|
| bitrightshift(self, other)
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from Combinable:
|
| ADD = '+'
|
| BITAND = '&'
|
| BITLEFTSHIFT = '<<'
|
| BITOR = '|'
|
| BITRIGHTSHIFT = '>>'
|
| DIV = '/'
|
| MOD = '%%'
|
| MUL = '*'
|
| POW = '^'
|
| SUB = '-'
class Expression(BaseExpression, Combinable)
| An expression that can be combined with other expressions.
|
| Method resolution order:
| Expression
| BaseExpression
| Combinable
| builtins.object
|
| Methods inherited from BaseExpression:
|
| __eq__(self, other)
| Return self==value.
|
| __getstate__(self)
|
| __hash__(self)
| Return hash(self).
|
| __init__(self, output_field=None)
| Initialize self. See help(type(self)) for accurate signature.
|
| as_sql(self, compiler, connection)
| Responsible for returning a (sql, [params]) tuple to be included
| in the current query.
|
| Different backends can provide their own implementation, by
| providing an `as_{vendor}` method and patching the Expression:
|
| ```
| def override_as_sql(self, compiler, connection):
| # custom logic
| return super().as_sql(compiler, connection)
| setattr(Expression, 'as_' + connection.vendor, override_as_sql)
| ```
|
| Arguments:
| * compiler: the query compiler responsible for generating the query.
| Must have a compile method, returning a (sql, [params]) tuple.
| Calling compiler(value) will return a quoted `value`.
|
| * connection: the database connection used for the current query.
|
| Return: (sql, params)
| Where `sql` is a string containing ordered sql parameters to be
| replaced with the elements of the list `params`.
|
| asc(self, **kwargs)
|
| contains_aggregate = <django.utils.functional.cached_property object>
| contains_column_references = <django.utils.functional.cached_property object>
| contains_over_clause = <django.utils.functional.cached_property object>
| convert_value = <django.utils.functional.cached_property object>
| copy(self)
|
| deconstruct(obj)
| Return a 3-tuple of class import path, positional arguments,
| and keyword arguments.
|
| desc(self, **kwargs)
|
| flatten(self)
| Recursively yield this expression and all subexpressions, in
| depth-first order.
|
| get_db_converters(self, connection)
|
| get_group_by_cols(self)
|
| get_lookup(self, lookup)
|
| get_source_expressions(self)
|
| get_source_fields(self)
| Return the underlying field types used by this aggregate.
|
| get_transform(self, name)
|
| output_field = <django.utils.functional.cached_property object>
| relabeled_clone(self, change_map)
|
| resolve_expression(self, query=None, allow_joins=True, reuse=None, summarize=False, for_save=False)
| Provide the chance to do any preprocessing or validation before being
| added to the query.
|
| Arguments:
| * query: the backend query implementation
| * allow_joins: boolean allowing or denying use of joins
| in this query
| * reuse: a set of reusable joins for multijoins
| * summarize: a terminal aggregate clause
| * for_save: whether this expression about to be used in a save or update
|
| Return: an Expression to be added to the query.
|
| reverse_ordering(self)
|
| set_source_expressions(self, exprs)
|
| ----------------------------------------------------------------------
| Static methods inherited from BaseExpression:
|
| __new__(cls, *args, **kwargs)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from BaseExpression:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
|
| field
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from BaseExpression:
|
| filterable = True
|
| is_summary = False
|
| window_compatible = False
|
| ----------------------------------------------------------------------
| Methods inherited from Combinable:
|
| __add__(self, other)
|
| __and__(self, other)
|
| __mod__(self, other)
|
| __mul__(self, other)
|
| __or__(self, other)
|
| __pow__(self, other)
|
| __radd__(self, other)
|
| __rand__(self, other)
|
| __rmod__(self, other)
|
| __rmul__(self, other)
|
| __ror__(self, other)
|
| __rpow__(self, other)
|
| __rsub__(self, other)
|
| __rtruediv__(self, other)
|
| __sub__(self, other)
|
| __truediv__(self, other)
|
| bitand(self, other)
|
| bitleftshift(self, other)
|
| bitor(self, other)
|
| bitrightshift(self, other)
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from Combinable:
|
| ADD = '+'
|
| BITAND = '&'
|
| BITLEFTSHIFT = '<<'
|
| BITOR = '|'
|
| BITRIGHTSHIFT = '>>'
|
| DIV = '/'
|
| MOD = '%%'
|
| MUL = '*'
|
| POW = '^'
|
| SUB = '-'
class ExpressionList(Func)
| An expression containing multiple expressions. Can be used to provide a
| list of expressions as an argument to another expression, like an
| ordering clause.
|
| Method resolution order:
| ExpressionList
| Func
| SQLiteNumericMixin
| Expression
| BaseExpression
| Combinable
| builtins.object
|
| Methods defined here:
|
| __init__(self, *expressions, **extra)
| Initialize self. See help(type(self)) for accurate signature.
|
| __str__(self)
| Return str(self).
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| template = '%(expressions)s'
|
| ----------------------------------------------------------------------
| Methods inherited from Func:
|
| __repr__(self)
| Return repr(self).
|
| as_sql(self, compiler, connection, function=None, template=None, arg_joiner=None, **extra_context)
| Responsible for returning a (sql, [params]) tuple to be included
| in the current query.
|
| Different backends can provide their own implementation, by
| providing an `as_{vendor}` method and patching the Expression:
|
| ```
| def override_as_sql(self, compiler, connection):
| # custom logic
| return super().as_sql(compiler, connection)
| setattr(Expression, 'as_' + connection.vendor, override_as_sql)
| ```
|
| Arguments:
| * compiler: the query compiler responsible for generating the query.
| Must have a compile method, returning a (sql, [params]) tuple.
| Calling compiler(value) will return a quoted `value`.
|
| * connection: the database connection used for the current query.
|
| Return: (sql, params)
| Where `sql` is a string containing ordered sql parameters to be
| replaced with the elements of the list `params`.
|
| copy(self)
|
| get_source_expressions(self)
|
| resolve_expression(self, query=None, allow_joins=True, reuse=None, summarize=False, for_save=False)
| Provide the chance to do any preprocessing or validation before being
| added to the query.
|
| Arguments:
| * query: the backend query implementation
| * allow_joins: boolean allowing or denying use of joins
| in this query
| * reuse: a set of reusable joins for multijoins
| * summarize: a terminal aggregate clause
| * for_save: whether this expression about to be used in a save or update
|
| Return: an Expression to be added to the query.
|
| set_source_expressions(self, exprs)
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from Func:
|
| arg_joiner = ', '
|
| arity = None
|
| function = None
|
| ----------------------------------------------------------------------
| Methods inherited from SQLiteNumericMixin:
|
| as_sqlite(self, compiler, connection, **extra_context)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from SQLiteNumericMixin:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
|
| ----------------------------------------------------------------------
| Methods inherited from BaseExpression:
|
| __eq__(self, other)
| Return self==value.
|
| __getstate__(self)
|
| __hash__(self)
| Return hash(self).
|
| asc(self, **kwargs)
|
| contains_aggregate = <django.utils.functional.cached_property object>
| contains_column_references = <django.utils.functional.cached_property object>
| contains_over_clause = <django.utils.functional.cached_property object>
| convert_value = <django.utils.functional.cached_property object>
| deconstruct(obj)
| Return a 3-tuple of class import path, positional arguments,
| and keyword arguments.
|
| desc(self, **kwargs)
|
| flatten(self)
| Recursively yield this expression and all subexpressions, in
| depth-first order.
|
| get_db_converters(self, connection)
|
| get_group_by_cols(self)
|
| get_lookup(self, lookup)
|
| get_source_fields(self)
| Return the underlying field types used by this aggregate.
|
| get_transform(self, name)
|
| output_field = <django.utils.functional.cached_property object>
| relabeled_clone(self, change_map)
|
| reverse_ordering(self)
|
| ----------------------------------------------------------------------
| Static methods inherited from BaseExpression:
|
| __new__(cls, *args, **kwargs)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from BaseExpression:
|
| field
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from BaseExpression:
|
| filterable = True
|
| is_summary = False
|
| window_compatible = False
|
| ----------------------------------------------------------------------
| Methods inherited from Combinable:
|
| __add__(self, other)
|
| __and__(self, other)
|
| __mod__(self, other)
|
| __mul__(self, other)
|
| __or__(self, other)
|
| __pow__(self, other)
|
| __radd__(self, other)
|
| __rand__(self, other)
|
| __rmod__(self, other)
|
| __rmul__(self, other)
|
| __ror__(self, other)
|
| __rpow__(self, other)
|
| __rsub__(self, other)
|
| __rtruediv__(self, other)
|
| __sub__(self, other)
|
| __truediv__(self, other)
|
| bitand(self, other)
|
| bitleftshift(self, other)
|
| bitor(self, other)
|
| bitrightshift(self, other)
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from Combinable:
|
| ADD = '+'
|
| BITAND = '&'
|
| BITLEFTSHIFT = '<<'
|
| BITOR = '|'
|
| BITRIGHTSHIFT = '>>'
|
| DIV = '/'
|
| MOD = '%%'
|
| MUL = '*'
|
| POW = '^'
|
| SUB = '-'
class ExpressionWrapper(Expression)
| An expression that can wrap another expression so that it can provide
| extra context to the inner expression, such as the output_field.
|
| Method resolution order:
| ExpressionWrapper
| Expression
| BaseExpression
| Combinable
| builtins.object
|
| Methods defined here:
|
| __init__(self, expression, output_field)
| Initialize self. See help(type(self)) for accurate signature.
|
| __repr__(self)
| Return repr(self).
|
| as_sql(self, compiler, connection)
| Responsible for returning a (sql, [params]) tuple to be included
| in the current query.
|
| Different backends can provide their own implementation, by
| providing an `as_{vendor}` method and patching the Expression:
|
| ```
| def override_as_sql(self, compiler, connection):
| # custom logic
| return super().as_sql(compiler, connection)
| setattr(Expression, 'as_' + connection.vendor, override_as_sql)
| ```
|
| Arguments:
| * compiler: the query compiler responsible for generating the query.
| Must have a compile method, returning a (sql, [params]) tuple.
| Calling compiler(value) will return a quoted `value`.
|
| * connection: the database connection used for the current query.
|
| Return: (sql, params)
| Where `sql` is a string containing ordered sql parameters to be
| replaced with the elements of the list `params`.
|
| get_source_expressions(self)
|
| set_source_expressions(self, exprs)
|
| ----------------------------------------------------------------------
| Methods inherited from BaseExpression:
|
| __eq__(self, other)
| Return self==value.
|
| __getstate__(self)
|
| __hash__(self)
| Return hash(self).
|
| asc(self, **kwargs)
|
| contains_aggregate = <django.utils.functional.cached_property object>
| contains_column_references = <django.utils.functional.cached_property object>
| contains_over_clause = <django.utils.functional.cached_property object>
| convert_value = <django.utils.functional.cached_property object>
| copy(self)
|
| deconstruct(obj)
| Return a 3-tuple of class import path, positional arguments,
| and keyword arguments.
|
| desc(self, **kwargs)
|
| flatten(self)
| Recursively yield this expression and all subexpressions, in
| depth-first order.
|
| get_db_converters(self, connection)
|
| get_group_by_cols(self)
|
| get_lookup(self, lookup)
|
| get_source_fields(self)
| Return the underlying field types used by this aggregate.
|
| get_transform(self, name)
|
| output_field = <django.utils.functional.cached_property object>
| relabeled_clone(self, change_map)
|
| resolve_expression(self, query=None, allow_joins=True, reuse=None, summarize=False, for_save=False)
| Provide the chance to do any preprocessing or validation before being
| added to the query.
|
| Arguments:
| * query: the backend query implementation
| * allow_joins: boolean allowing or denying use of joins
| in this query
| * reuse: a set of reusable joins for multijoins
| * summarize: a terminal aggregate clause
| * for_save: whether this expression about to be used in a save or update
|
| Return: an Expression to be added to the query.
|
| reverse_ordering(self)
|
| ----------------------------------------------------------------------
| Static methods inherited from BaseExpression:
|
| __new__(cls, *args, **kwargs)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from BaseExpression:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
|
| field
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from BaseExpression:
|
| filterable = True
|
| is_summary = False
|
| window_compatible = False
|
| ----------------------------------------------------------------------
| Methods inherited from Combinable:
|
| __add__(self, other)
|
| __and__(self, other)
|
| __mod__(self, other)
|
| __mul__(self, other)
|
| __or__(self, other)
|
| __pow__(self, other)
|
| __radd__(self, other)
|
| __rand__(self, other)
|
| __rmod__(self, other)
|
| __rmul__(self, other)
|
| __ror__(self, other)
|
| __rpow__(self, other)
|
| __rsub__(self, other)
|
| __rtruediv__(self, other)
|
| __sub__(self, other)
|
| __truediv__(self, other)
|
| bitand(self, other)
|
| bitleftshift(self, other)
|
| bitor(self, other)
|
| bitrightshift(self, other)
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from Combinable:
|
| ADD = '+'
|
| BITAND = '&'
|
| BITLEFTSHIFT = '<<'
|
| BITOR = '|'
|
| BITRIGHTSHIFT = '>>'
|
| DIV = '/'
|
| MOD = '%%'
|
| MUL = '*'
|
| POW = '^'
|
| SUB = '-'
class F(Combinable)
| An object capable of resolving references to existing query objects.
|
| Method resolution order:
| F
| Combinable
| builtins.object
|
| Methods defined here:
|
| __eq__(self, other)
| Return self==value.
|
| __hash__(self)
| Return hash(self).
|
| __init__(self, name)
| Arguments:
| * name: the name of the field this expression references
|
| __repr__(self)
| Return repr(self).
|
| asc(self, **kwargs)
|
| deconstruct(obj)
| Return a 3-tuple of class import path, positional arguments,
| and keyword arguments.
|
| desc(self, **kwargs)
|
| resolve_expression(self, query=None, allow_joins=True, reuse=None, summarize=False, for_save=False)
|
| ----------------------------------------------------------------------
| Static methods defined here:
|
| __new__(cls, *args, **kwargs)
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| filterable = True
|
| ----------------------------------------------------------------------
| Methods inherited from Combinable:
|
| __add__(self, other)
|
| __and__(self, other)
|
| __mod__(self, other)
|
| __mul__(self, other)
|
| __or__(self, other)
|
| __pow__(self, other)
|
| __radd__(self, other)
|
| __rand__(self, other)
|
| __rmod__(self, other)
|
| __rmul__(self, other)
|
| __ror__(self, other)
|
| __rpow__(self, other)
|
| __rsub__(self, other)
|
| __rtruediv__(self, other)
|
| __sub__(self, other)
|
| __truediv__(self, other)
|
| bitand(self, other)
|
| bitleftshift(self, other)
|
| bitor(self, other)
|
| bitrightshift(self, other)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from Combinable:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from Combinable:
|
| ADD = '+'
|
| BITAND = '&'
|
| BITLEFTSHIFT = '<<'
|
| BITOR = '|'
|
| BITRIGHTSHIFT = '>>'
|
| DIV = '/'
|
| MOD = '%%'
|
| MUL = '*'
|
| POW = '^'
|
| SUB = '-'
class Field(django.db.models.query_utils.RegisterLookupMixin)
| Base class for all field types
|
| Method resolution order:
| Field
| django.db.models.query_utils.RegisterLookupMixin
| builtins.object
|
| Methods defined here:
|
| __copy__(self)
|
| __deepcopy__(self, memodict)
|
| __eq__(self, other)
| Return self==value.
|
| __ge__(self, other, NotImplemented=NotImplemented)
| Return a >= b. Computed by @total_ordering from (not a < b).
|
| __gt__(self, other, NotImplemented=NotImplemented)
| Return a > b. Computed by @total_ordering from (not a < b) and (a != b).
|
| __hash__(self)
| Return hash(self).
|
| __init__(self, verbose_name=None, name=None, primary_key=False, max_length=None, unique=False, blank=False, null=False, db_index=False, rel=None, default=<class 'django.db.models.fields.NOT_PROVIDED'>, editable=True, serialize=True, unique_for_date=None, unique_for_month=None, unique_for_year=None, choices=None, help_text='', db_column=None, db_tablespace=None, auto_created=False, validators=(), error_messages=None)
| Initialize self. See help(type(self)) for accurate signature.
|
| __le__(self, other, NotImplemented=NotImplemented)
| Return a <= b. Computed by @total_ordering from (a < b) or (a == b).
|
| __lt__(self, other)
| Return self<value.
|
| __reduce__(self)
| Pickling should return the model._meta.fields instance of the field,
| not a new copy of that field. So, use the app registry to load the
| model and then the field back.
|
| __repr__(self)
| Display the module, class, and name of the field.
|
| __str__(self)
| Return "app_label.model_label.field_name" for fields attached to
| models.
|
| cached_col = <django.utils.functional.cached_property object>
| cast_db_type(self, connection)
| Return the data type to use in the Cast() function.
|
| check(self, **kwargs)
|
| clean(self, value, model_instance)
| Convert the value's type and run validation. Validation errors
| from to_python() and validate() are propagated. Return the correct
| value if no error is raised.
|
| clone(self)
| Uses deconstruct() to clone a new copy of this Field.
| Will not preserve any class attachments/attribute names.
|
| contribute_to_class(self, cls, name, private_only=False)
| Register the field with the model class it belongs to.
|
| If private_only is True, create a separate instance of this field
| for every subclass of cls, even if cls is not an abstract model.
|
| db_check(self, connection)
| Return the database column check constraint for this field, for the
| provided connection. Works the same way as db_type() for the case that
| get_internal_type() does not map to a preexisting model field.
|
| db_parameters(self, connection)
| Extension of db_type(), providing a range of different return values
| (type, checks). This will look at db_type(), allowing custom model
| fields to override it.
|
| db_type(self, connection)
| Return the database column data type for this field, for the provided
| connection.
|
| db_type_parameters(self, connection)
|
| db_type_suffix(self, connection)
|
| deconstruct(self)
| Return enough information to recreate the field as a 4-tuple:
|
| * The name of the field on the model, if contribute_to_class() has
| been run.
| * The import path of the field, including the class:e.g.
| django.db.models.IntegerField This should be the most portable
| version, so less specific may be better.
| * A list of positional arguments.
| * A dict of keyword arguments.
|
| Note that the positional or keyword arguments must contain values of
| the following types (including inner values of collection types):
|
| * None, bool, str, int, float, complex, set, frozenset, list, tuple,
| dict
| * UUID
| * datetime.datetime (naive), datetime.date
| * top-level classes, top-level functions - will be referenced by their
| full import path
| * Storage instances - these have their own deconstruct() method
|
| This is because the values here must be serialized into a text format
| (possibly new Python code, possibly JSON) and these are the only types
| with encoding handlers defined.
|
| There's no need to return the exact way the field was instantiated this
| time, just ensure that the resulting field is the same - prefer keyword
| arguments over positional ones, and omit parameters with their default
| values.
|
| formfield(self, form_class=None, choices_form_class=None, **kwargs)
| Return a django.forms.Field instance for this field.
|
| get_attname(self)
|
| get_attname_column(self)
|
| get_choices(self, include_blank=True, blank_choice=[('', '---------')], limit_choices_to=None)
| Return choices with a default blank choices included, for use
| as <select> choices for this field.
|
| get_col(self, alias, output_field=None)
|
| get_db_converters(self, connection)
|
| get_db_prep_save(self, value, connection)
| Return field's value prepared for saving into a database.
|
| get_db_prep_value(self, value, connection, prepared=False)
| Return field's value prepared for interacting with the database backend.
|
| Used by the default implementations of get_db_prep_save().
|
| get_default(self)
| Return the default value for this field.
|
| get_filter_kwargs_for_object(self, obj)
| Return a dict that when passed as kwargs to self.model.filter(), would
| yield all instances having the same value for this field as obj has.
|
| get_internal_type(self)
|
| get_pk_value_on_save(self, instance)
| Hook to generate new PK values on save. This method is called when
| saving instances with no primary key value set. If this method returns
| something else than None, then the returned value is used when saving
| the new instance.
|
| get_prep_value(self, value)
| Perform preliminary non-db specific value checks and conversions.
|
| has_default(self)
| Return a boolean of whether this field has a default value.
|
| pre_save(self, model_instance, add)
| Return field's value just before saving.
|
| rel_db_type(self, connection)
| Return the data type that a related field pointing to this field should
| use. For example, this method is called by ForeignKey and OneToOneField
| to determine its data type.
|
| run_validators(self, value)
|
| save_form_data(self, instance, data)
|
| select_format(self, compiler, sql, params)
| Custom format for select clauses. For example, GIS columns need to be
| selected as AsText(table.col) on MySQL as the table.col data can't be
| used by Django.
|
| set_attributes_from_name(self, name)
|
| to_python(self, value)
| Convert the input value into the expected Python data type, raising
| django.core.exceptions.ValidationError if the data can't be converted.
| Return the converted value. Subclasses should override this.
|
| validate(self, value, model_instance)
| Validate value and raise ValidationError if necessary. Subclasses
| should override this to provide validation logic.
|
| validators = <django.utils.functional.cached_property object>
| value_from_object(self, obj)
| Return the value of this field in the given model instance.
|
| value_to_string(self, obj)
| Return a string value of this field from the passed obj.
| This is used by the serialization framework.
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| db_tablespace
|
| description
|
| flatchoices
| Flattened version of choices tuple.
|
| unique
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| auto_creation_counter = -11
|
| class_lookups = {'contains': <class 'django.db.models.lookups.Contains...
|
| creation_counter = 58
|
| default_error_messages = {'blank': 'This field cannot be blank.', 'inv...
|
| default_validators = []
|
| empty_strings_allowed = True
|
| empty_values = [None, '', [], (), {}]
|
| hidden = False
|
| many_to_many = None
|
| many_to_one = None
|
| one_to_many = None
|
| one_to_one = None
|
| related_model = None
|
| system_check_deprecated_details = None
|
| system_check_removed_details = None
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| get_lookup(self, lookup_name)
|
| get_transform(self, lookup_name)
|
| ----------------------------------------------------------------------
| Class methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| get_lookups() from builtins.type
|
| register_lookup(lookup, lookup_name=None) from builtins.type
|
| ----------------------------------------------------------------------
| Static methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| merge_dicts(dicts)
| Merge dicts in reverse to preference the order of the original list. e.g.,
| merge_dicts([a, b]) will preference the keys in 'a' over those in 'b'.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
class FieldDoesNotExist(builtins.Exception)
| The requested model field does not exist
|
| Method resolution order:
| FieldDoesNotExist
| builtins.Exception
| builtins.BaseException
| builtins.object
|
| Data descriptors defined here:
|
| __weakref__
| list of weak references to the object (if defined)
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.Exception:
|
| __init__(self, /, *args, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| __new__(*args, **kwargs) from builtins.type
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.BaseException:
|
| __delattr__(self, name, /)
| Implement delattr(self, name).
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __reduce__(...)
| helper for pickle
|
| __repr__(self, /)
| Return repr(self).
|
| __setattr__(self, name, value, /)
| Implement setattr(self, name, value).
|
| __setstate__(...)
|
| __str__(self, /)
| Return str(self).
|
| with_traceback(...)
| Exception.with_traceback(tb) --
| set self.__traceback__ to tb and return self.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from builtins.BaseException:
|
| __cause__
| exception cause
|
| __context__
| exception context
|
| __dict__
|
| __suppress_context__
|
| __traceback__
|
| args
class FileField(django.db.models.fields.Field)
| Base class for all field types
|
| Method resolution order:
| FileField
| django.db.models.fields.Field
| django.db.models.query_utils.RegisterLookupMixin
| builtins.object
|
| Methods defined here:
|
| __init__(self, verbose_name=None, name=None, upload_to='', storage=None, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| check(self, **kwargs)
|
| contribute_to_class(self, cls, name, **kwargs)
| Register the field with the model class it belongs to.
|
| If private_only is True, create a separate instance of this field
| for every subclass of cls, even if cls is not an abstract model.
|
| deconstruct(self)
| Return enough information to recreate the field as a 4-tuple:
|
| * The name of the field on the model, if contribute_to_class() has
| been run.
| * The import path of the field, including the class:e.g.
| django.db.models.IntegerField This should be the most portable
| version, so less specific may be better.
| * A list of positional arguments.
| * A dict of keyword arguments.
|
| Note that the positional or keyword arguments must contain values of
| the following types (including inner values of collection types):
|
| * None, bool, str, int, float, complex, set, frozenset, list, tuple,
| dict
| * UUID
| * datetime.datetime (naive), datetime.date
| * top-level classes, top-level functions - will be referenced by their
| full import path
| * Storage instances - these have their own deconstruct() method
|
| This is because the values here must be serialized into a text format
| (possibly new Python code, possibly JSON) and these are the only types
| with encoding handlers defined.
|
| There's no need to return the exact way the field was instantiated this
| time, just ensure that the resulting field is the same - prefer keyword
| arguments over positional ones, and omit parameters with their default
| values.
|
| formfield(self, **kwargs)
| Return a django.forms.Field instance for this field.
|
| generate_filename(self, instance, filename)
| Apply (if callable) or prepend (if a string) upload_to to the filename,
| then delegate further processing of the name to the storage backend.
| Until the storage layer, all file paths are expected to be Unix style
| (with forward slashes).
|
| get_internal_type(self)
|
| get_prep_value(self, value)
| Perform preliminary non-db specific value checks and conversions.
|
| pre_save(self, model_instance, add)
| Return field's value just before saving.
|
| save_form_data(self, instance, data)
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| attr_class = <class 'django.db.models.fields.files.FieldFile'>
| A mixin class used to forward file methods to an underlaying file
| object. The internal file object has to be called "file"::
|
| class FileProxy(FileProxyMixin):
| def __init__(self, file):
| self.file = file
|
| description = 'File'
|
| descriptor_class = <class 'django.db.models.fields.files.FileDescripto...
| The descriptor for the file attribute on the model instance. Return a
| FieldFile when accessed so you can write code like::
|
| >>> from myapp.models import MyModel
| >>> instance = MyModel.objects.get(pk=1)
| >>> instance.file.size
|
| Assign a file object on assignment so you can do::
|
| >>> with open('/path/to/hello.world', 'r') as f:
| ... instance.file = File(f)
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.fields.Field:
|
| __copy__(self)
|
| __deepcopy__(self, memodict)
|
| __eq__(self, other)
| Return self==value.
|
| __ge__(self, other, NotImplemented=NotImplemented)
| Return a >= b. Computed by @total_ordering from (not a < b).
|
| __gt__(self, other, NotImplemented=NotImplemented)
| Return a > b. Computed by @total_ordering from (not a < b) and (a != b).
|
| __hash__(self)
| Return hash(self).
|
| __le__(self, other, NotImplemented=NotImplemented)
| Return a <= b. Computed by @total_ordering from (a < b) or (a == b).
|
| __lt__(self, other)
| Return self<value.
|
| __reduce__(self)
| Pickling should return the model._meta.fields instance of the field,
| not a new copy of that field. So, use the app registry to load the
| model and then the field back.
|
| __repr__(self)
| Display the module, class, and name of the field.
|
| __str__(self)
| Return "app_label.model_label.field_name" for fields attached to
| models.
|
| cached_col = <django.utils.functional.cached_property object>
| cast_db_type(self, connection)
| Return the data type to use in the Cast() function.
|
| clean(self, value, model_instance)
| Convert the value's type and run validation. Validation errors
| from to_python() and validate() are propagated. Return the correct
| value if no error is raised.
|
| clone(self)
| Uses deconstruct() to clone a new copy of this Field.
| Will not preserve any class attachments/attribute names.
|
| db_check(self, connection)
| Return the database column check constraint for this field, for the
| provided connection. Works the same way as db_type() for the case that
| get_internal_type() does not map to a preexisting model field.
|
| db_parameters(self, connection)
| Extension of db_type(), providing a range of different return values
| (type, checks). This will look at db_type(), allowing custom model
| fields to override it.
|
| db_type(self, connection)
| Return the database column data type for this field, for the provided
| connection.
|
| db_type_parameters(self, connection)
|
| db_type_suffix(self, connection)
|
| get_attname(self)
|
| get_attname_column(self)
|
| get_choices(self, include_blank=True, blank_choice=[('', '---------')], limit_choices_to=None)
| Return choices with a default blank choices included, for use
| as <select> choices for this field.
|
| get_col(self, alias, output_field=None)
|
| get_db_converters(self, connection)
|
| get_db_prep_save(self, value, connection)
| Return field's value prepared for saving into a database.
|
| get_db_prep_value(self, value, connection, prepared=False)
| Return field's value prepared for interacting with the database backend.
|
| Used by the default implementations of get_db_prep_save().
|
| get_default(self)
| Return the default value for this field.
|
| get_filter_kwargs_for_object(self, obj)
| Return a dict that when passed as kwargs to self.model.filter(), would
| yield all instances having the same value for this field as obj has.
|
| get_pk_value_on_save(self, instance)
| Hook to generate new PK values on save. This method is called when
| saving instances with no primary key value set. If this method returns
| something else than None, then the returned value is used when saving
| the new instance.
|
| has_default(self)
| Return a boolean of whether this field has a default value.
|
| rel_db_type(self, connection)
| Return the data type that a related field pointing to this field should
| use. For example, this method is called by ForeignKey and OneToOneField
| to determine its data type.
|
| run_validators(self, value)
|
| select_format(self, compiler, sql, params)
| Custom format for select clauses. For example, GIS columns need to be
| selected as AsText(table.col) on MySQL as the table.col data can't be
| used by Django.
|
| set_attributes_from_name(self, name)
|
| to_python(self, value)
| Convert the input value into the expected Python data type, raising
| django.core.exceptions.ValidationError if the data can't be converted.
| Return the converted value. Subclasses should override this.
|
| validate(self, value, model_instance)
| Validate value and raise ValidationError if necessary. Subclasses
| should override this to provide validation logic.
|
| validators = <django.utils.functional.cached_property object>
| value_from_object(self, obj)
| Return the value of this field in the given model instance.
|
| value_to_string(self, obj)
| Return a string value of this field from the passed obj.
| This is used by the serialization framework.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from django.db.models.fields.Field:
|
| db_tablespace
|
| flatchoices
| Flattened version of choices tuple.
|
| unique
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from django.db.models.fields.Field:
|
| auto_creation_counter = -11
|
| class_lookups = {'contains': <class 'django.db.models.lookups.Contains...
|
| creation_counter = 58
|
| default_error_messages = {'blank': 'This field cannot be blank.', 'inv...
|
| default_validators = []
|
| empty_strings_allowed = True
|
| empty_values = [None, '', [], (), {}]
|
| hidden = False
|
| many_to_many = None
|
| many_to_one = None
|
| one_to_many = None
|
| one_to_one = None
|
| related_model = None
|
| system_check_deprecated_details = None
|
| system_check_removed_details = None
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| get_lookup(self, lookup_name)
|
| get_transform(self, lookup_name)
|
| ----------------------------------------------------------------------
| Class methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| get_lookups() from builtins.type
|
| register_lookup(lookup, lookup_name=None) from builtins.type
|
| ----------------------------------------------------------------------
| Static methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| merge_dicts(dicts)
| Merge dicts in reverse to preference the order of the original list. e.g.,
| merge_dicts([a, b]) will preference the keys in 'a' over those in 'b'.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
class FilePathField(Field)
| Base class for all field types
|
| Method resolution order:
| FilePathField
| Field
| django.db.models.query_utils.RegisterLookupMixin
| builtins.object
|
| Methods defined here:
|
| __init__(self, verbose_name=None, name=None, path='', match=None, recursive=False, allow_files=True, allow_folders=False, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| check(self, **kwargs)
|
| deconstruct(self)
| Return enough information to recreate the field as a 4-tuple:
|
| * The name of the field on the model, if contribute_to_class() has
| been run.
| * The import path of the field, including the class:e.g.
| django.db.models.IntegerField This should be the most portable
| version, so less specific may be better.
| * A list of positional arguments.
| * A dict of keyword arguments.
|
| Note that the positional or keyword arguments must contain values of
| the following types (including inner values of collection types):
|
| * None, bool, str, int, float, complex, set, frozenset, list, tuple,
| dict
| * UUID
| * datetime.datetime (naive), datetime.date
| * top-level classes, top-level functions - will be referenced by their
| full import path
| * Storage instances - these have their own deconstruct() method
|
| This is because the values here must be serialized into a text format
| (possibly new Python code, possibly JSON) and these are the only types
| with encoding handlers defined.
|
| There's no need to return the exact way the field was instantiated this
| time, just ensure that the resulting field is the same - prefer keyword
| arguments over positional ones, and omit parameters with their default
| values.
|
| formfield(self, **kwargs)
| Return a django.forms.Field instance for this field.
|
| get_internal_type(self)
|
| get_prep_value(self, value)
| Perform preliminary non-db specific value checks and conversions.
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| description = 'File path'
|
| ----------------------------------------------------------------------
| Methods inherited from Field:
|
| __copy__(self)
|
| __deepcopy__(self, memodict)
|
| __eq__(self, other)
| Return self==value.
|
| __ge__(self, other, NotImplemented=NotImplemented)
| Return a >= b. Computed by @total_ordering from (not a < b).
|
| __gt__(self, other, NotImplemented=NotImplemented)
| Return a > b. Computed by @total_ordering from (not a < b) and (a != b).
|
| __hash__(self)
| Return hash(self).
|
| __le__(self, other, NotImplemented=NotImplemented)
| Return a <= b. Computed by @total_ordering from (a < b) or (a == b).
|
| __lt__(self, other)
| Return self<value.
|
| __reduce__(self)
| Pickling should return the model._meta.fields instance of the field,
| not a new copy of that field. So, use the app registry to load the
| model and then the field back.
|
| __repr__(self)
| Display the module, class, and name of the field.
|
| __str__(self)
| Return "app_label.model_label.field_name" for fields attached to
| models.
|
| cached_col = <django.utils.functional.cached_property object>
| cast_db_type(self, connection)
| Return the data type to use in the Cast() function.
|
| clean(self, value, model_instance)
| Convert the value's type and run validation. Validation errors
| from to_python() and validate() are propagated. Return the correct
| value if no error is raised.
|
| clone(self)
| Uses deconstruct() to clone a new copy of this Field.
| Will not preserve any class attachments/attribute names.
|
| contribute_to_class(self, cls, name, private_only=False)
| Register the field with the model class it belongs to.
|
| If private_only is True, create a separate instance of this field
| for every subclass of cls, even if cls is not an abstract model.
|
| db_check(self, connection)
| Return the database column check constraint for this field, for the
| provided connection. Works the same way as db_type() for the case that
| get_internal_type() does not map to a preexisting model field.
|
| db_parameters(self, connection)
| Extension of db_type(), providing a range of different return values
| (type, checks). This will look at db_type(), allowing custom model
| fields to override it.
|
| db_type(self, connection)
| Return the database column data type for this field, for the provided
| connection.
|
| db_type_parameters(self, connection)
|
| db_type_suffix(self, connection)
|
| get_attname(self)
|
| get_attname_column(self)
|
| get_choices(self, include_blank=True, blank_choice=[('', '---------')], limit_choices_to=None)
| Return choices with a default blank choices included, for use
| as <select> choices for this field.
|
| get_col(self, alias, output_field=None)
|
| get_db_converters(self, connection)
|
| get_db_prep_save(self, value, connection)
| Return field's value prepared for saving into a database.
|
| get_db_prep_value(self, value, connection, prepared=False)
| Return field's value prepared for interacting with the database backend.
|
| Used by the default implementations of get_db_prep_save().
|
| get_default(self)
| Return the default value for this field.
|
| get_filter_kwargs_for_object(self, obj)
| Return a dict that when passed as kwargs to self.model.filter(), would
| yield all instances having the same value for this field as obj has.
|
| get_pk_value_on_save(self, instance)
| Hook to generate new PK values on save. This method is called when
| saving instances with no primary key value set. If this method returns
| something else than None, then the returned value is used when saving
| the new instance.
|
| has_default(self)
| Return a boolean of whether this field has a default value.
|
| pre_save(self, model_instance, add)
| Return field's value just before saving.
|
| rel_db_type(self, connection)
| Return the data type that a related field pointing to this field should
| use. For example, this method is called by ForeignKey and OneToOneField
| to determine its data type.
|
| run_validators(self, value)
|
| save_form_data(self, instance, data)
|
| select_format(self, compiler, sql, params)
| Custom format for select clauses. For example, GIS columns need to be
| selected as AsText(table.col) on MySQL as the table.col data can't be
| used by Django.
|
| set_attributes_from_name(self, name)
|
| to_python(self, value)
| Convert the input value into the expected Python data type, raising
| django.core.exceptions.ValidationError if the data can't be converted.
| Return the converted value. Subclasses should override this.
|
| validate(self, value, model_instance)
| Validate value and raise ValidationError if necessary. Subclasses
| should override this to provide validation logic.
|
| validators = <django.utils.functional.cached_property object>
| value_from_object(self, obj)
| Return the value of this field in the given model instance.
|
| value_to_string(self, obj)
| Return a string value of this field from the passed obj.
| This is used by the serialization framework.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from Field:
|
| db_tablespace
|
| flatchoices
| Flattened version of choices tuple.
|
| unique
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from Field:
|
| auto_creation_counter = -11
|
| class_lookups = {'contains': <class 'django.db.models.lookups.Contains...
|
| creation_counter = 58
|
| default_error_messages = {'blank': 'This field cannot be blank.', 'inv...
|
| default_validators = []
|
| empty_strings_allowed = True
|
| empty_values = [None, '', [], (), {}]
|
| hidden = False
|
| many_to_many = None
|
| many_to_one = None
|
| one_to_many = None
|
| one_to_one = None
|
| related_model = None
|
| system_check_deprecated_details = None
|
| system_check_removed_details = None
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| get_lookup(self, lookup_name)
|
| get_transform(self, lookup_name)
|
| ----------------------------------------------------------------------
| Class methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| get_lookups() from builtins.type
|
| register_lookup(lookup, lookup_name=None) from builtins.type
|
| ----------------------------------------------------------------------
| Static methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| merge_dicts(dicts)
| Merge dicts in reverse to preference the order of the original list. e.g.,
| merge_dicts([a, b]) will preference the keys in 'a' over those in 'b'.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
class FilteredRelation(builtins.object)
| Specify custom filtering in the ON clause of SQL joins.
|
| Methods defined here:
|
| __eq__(self, other)
| Return self==value.
|
| __init__(self, relation_name, *, condition=<Q: (AND: )>)
| Initialize self. See help(type(self)) for accurate signature.
|
| as_sql(self, compiler, connection)
|
| clone(self)
|
| resolve_expression(self, *args, **kwargs)
| QuerySet.annotate() only accepts expression-like arguments
| (with a resolve_expression() method).
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| __hash__ = None
class FloatField(Field)
| Base class for all field types
|
| Method resolution order:
| FloatField
| Field
| django.db.models.query_utils.RegisterLookupMixin
| builtins.object
|
| Methods defined here:
|
| formfield(self, **kwargs)
| Return a django.forms.Field instance for this field.
|
| get_internal_type(self)
|
| get_prep_value(self, value)
| Perform preliminary non-db specific value checks and conversions.
|
| to_python(self, value)
| Convert the input value into the expected Python data type, raising
| django.core.exceptions.ValidationError if the data can't be converted.
| Return the converted value. Subclasses should override this.
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| default_error_messages = {'invalid': "'%(value)s' value must be a floa...
|
| description = 'Floating point number'
|
| empty_strings_allowed = False
|
| ----------------------------------------------------------------------
| Methods inherited from Field:
|
| __copy__(self)
|
| __deepcopy__(self, memodict)
|
| __eq__(self, other)
| Return self==value.
|
| __ge__(self, other, NotImplemented=NotImplemented)
| Return a >= b. Computed by @total_ordering from (not a < b).
|
| __gt__(self, other, NotImplemented=NotImplemented)
| Return a > b. Computed by @total_ordering from (not a < b) and (a != b).
|
| __hash__(self)
| Return hash(self).
|
| __init__(self, verbose_name=None, name=None, primary_key=False, max_length=None, unique=False, blank=False, null=False, db_index=False, rel=None, default=<class 'django.db.models.fields.NOT_PROVIDED'>, editable=True, serialize=True, unique_for_date=None, unique_for_month=None, unique_for_year=None, choices=None, help_text='', db_column=None, db_tablespace=None, auto_created=False, validators=(), error_messages=None)
| Initialize self. See help(type(self)) for accurate signature.
|
| __le__(self, other, NotImplemented=NotImplemented)
| Return a <= b. Computed by @total_ordering from (a < b) or (a == b).
|
| __lt__(self, other)
| Return self<value.
|
| __reduce__(self)
| Pickling should return the model._meta.fields instance of the field,
| not a new copy of that field. So, use the app registry to load the
| model and then the field back.
|
| __repr__(self)
| Display the module, class, and name of the field.
|
| __str__(self)
| Return "app_label.model_label.field_name" for fields attached to
| models.
|
| cached_col = <django.utils.functional.cached_property object>
| cast_db_type(self, connection)
| Return the data type to use in the Cast() function.
|
| check(self, **kwargs)
|
| clean(self, value, model_instance)
| Convert the value's type and run validation. Validation errors
| from to_python() and validate() are propagated. Return the correct
| value if no error is raised.
|
| clone(self)
| Uses deconstruct() to clone a new copy of this Field.
| Will not preserve any class attachments/attribute names.
|
| contribute_to_class(self, cls, name, private_only=False)
| Register the field with the model class it belongs to.
|
| If private_only is True, create a separate instance of this field
| for every subclass of cls, even if cls is not an abstract model.
|
| db_check(self, connection)
| Return the database column check constraint for this field, for the
| provided connection. Works the same way as db_type() for the case that
| get_internal_type() does not map to a preexisting model field.
|
| db_parameters(self, connection)
| Extension of db_type(), providing a range of different return values
| (type, checks). This will look at db_type(), allowing custom model
| fields to override it.
|
| db_type(self, connection)
| Return the database column data type for this field, for the provided
| connection.
|
| db_type_parameters(self, connection)
|
| db_type_suffix(self, connection)
|
| deconstruct(self)
| Return enough information to recreate the field as a 4-tuple:
|
| * The name of the field on the model, if contribute_to_class() has
| been run.
| * The import path of the field, including the class:e.g.
| django.db.models.IntegerField This should be the most portable
| version, so less specific may be better.
| * A list of positional arguments.
| * A dict of keyword arguments.
|
| Note that the positional or keyword arguments must contain values of
| the following types (including inner values of collection types):
|
| * None, bool, str, int, float, complex, set, frozenset, list, tuple,
| dict
| * UUID
| * datetime.datetime (naive), datetime.date
| * top-level classes, top-level functions - will be referenced by their
| full import path
| * Storage instances - these have their own deconstruct() method
|
| This is because the values here must be serialized into a text format
| (possibly new Python code, possibly JSON) and these are the only types
| with encoding handlers defined.
|
| There's no need to return the exact way the field was instantiated this
| time, just ensure that the resulting field is the same - prefer keyword
| arguments over positional ones, and omit parameters with their default
| values.
|
| get_attname(self)
|
| get_attname_column(self)
|
| get_choices(self, include_blank=True, blank_choice=[('', '---------')], limit_choices_to=None)
| Return choices with a default blank choices included, for use
| as <select> choices for this field.
|
| get_col(self, alias, output_field=None)
|
| get_db_converters(self, connection)
|
| get_db_prep_save(self, value, connection)
| Return field's value prepared for saving into a database.
|
| get_db_prep_value(self, value, connection, prepared=False)
| Return field's value prepared for interacting with the database backend.
|
| Used by the default implementations of get_db_prep_save().
|
| get_default(self)
| Return the default value for this field.
|
| get_filter_kwargs_for_object(self, obj)
| Return a dict that when passed as kwargs to self.model.filter(), would
| yield all instances having the same value for this field as obj has.
|
| get_pk_value_on_save(self, instance)
| Hook to generate new PK values on save. This method is called when
| saving instances with no primary key value set. If this method returns
| something else than None, then the returned value is used when saving
| the new instance.
|
| has_default(self)
| Return a boolean of whether this field has a default value.
|
| pre_save(self, model_instance, add)
| Return field's value just before saving.
|
| rel_db_type(self, connection)
| Return the data type that a related field pointing to this field should
| use. For example, this method is called by ForeignKey and OneToOneField
| to determine its data type.
|
| run_validators(self, value)
|
| save_form_data(self, instance, data)
|
| select_format(self, compiler, sql, params)
| Custom format for select clauses. For example, GIS columns need to be
| selected as AsText(table.col) on MySQL as the table.col data can't be
| used by Django.
|
| set_attributes_from_name(self, name)
|
| validate(self, value, model_instance)
| Validate value and raise ValidationError if necessary. Subclasses
| should override this to provide validation logic.
|
| validators = <django.utils.functional.cached_property object>
| value_from_object(self, obj)
| Return the value of this field in the given model instance.
|
| value_to_string(self, obj)
| Return a string value of this field from the passed obj.
| This is used by the serialization framework.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from Field:
|
| db_tablespace
|
| flatchoices
| Flattened version of choices tuple.
|
| unique
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from Field:
|
| auto_creation_counter = -11
|
| class_lookups = {'contains': <class 'django.db.models.lookups.Contains...
|
| creation_counter = 58
|
| default_validators = []
|
| empty_values = [None, '', [], (), {}]
|
| hidden = False
|
| many_to_many = None
|
| many_to_one = None
|
| one_to_many = None
|
| one_to_one = None
|
| related_model = None
|
| system_check_deprecated_details = None
|
| system_check_removed_details = None
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| get_lookup(self, lookup_name)
|
| get_transform(self, lookup_name)
|
| ----------------------------------------------------------------------
| Class methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| get_lookups() from builtins.type
|
| register_lookup(lookup, lookup_name=None) from builtins.type
|
| ----------------------------------------------------------------------
| Static methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| merge_dicts(dicts)
| Merge dicts in reverse to preference the order of the original list. e.g.,
| merge_dicts([a, b]) will preference the keys in 'a' over those in 'b'.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
class ForeignKey(ForeignObject)
| Provide a many-to-one relation by adding a column to the local model
| to hold the remote value.
|
| By default ForeignKey will target the pk of the remote model but this
| behavior can be changed by using the ``to_field`` argument.
|
| Method resolution order:
| ForeignKey
| ForeignObject
| RelatedField
| django.db.models.fields.mixins.FieldCacheMixin
| django.db.models.fields.Field
| django.db.models.query_utils.RegisterLookupMixin
| builtins.object
|
| Methods defined here:
|
| __init__(self, to, on_delete, related_name=None, related_query_name=None, limit_choices_to=None, parent_link=False, to_field=None, db_constraint=True, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| check(self, **kwargs)
|
| contribute_to_related_class(self, cls, related)
|
| convert_empty_strings(self, value, expression, connection)
|
| db_check(self, connection)
| Return the database column check constraint for this field, for the
| provided connection. Works the same way as db_type() for the case that
| get_internal_type() does not map to a preexisting model field.
|
| db_parameters(self, connection)
| Extension of db_type(), providing a range of different return values
| (type, checks). This will look at db_type(), allowing custom model
| fields to override it.
|
| db_type(self, connection)
| Return the database column data type for this field, for the provided
| connection.
|
| deconstruct(self)
| Return enough information to recreate the field as a 4-tuple:
|
| * The name of the field on the model, if contribute_to_class() has
| been run.
| * The import path of the field, including the class:e.g.
| django.db.models.IntegerField This should be the most portable
| version, so less specific may be better.
| * A list of positional arguments.
| * A dict of keyword arguments.
|
| Note that the positional or keyword arguments must contain values of
| the following types (including inner values of collection types):
|
| * None, bool, str, int, float, complex, set, frozenset, list, tuple,
| dict
| * UUID
| * datetime.datetime (naive), datetime.date
| * top-level classes, top-level functions - will be referenced by their
| full import path
| * Storage instances - these have their own deconstruct() method
|
| This is because the values here must be serialized into a text format
| (possibly new Python code, possibly JSON) and these are the only types
| with encoding handlers defined.
|
| There's no need to return the exact way the field was instantiated this
| time, just ensure that the resulting field is the same - prefer keyword
| arguments over positional ones, and omit parameters with their default
| values.
|
| formfield(self, *, using=None, **kwargs)
| Pass ``limit_choices_to`` to the field being constructed.
|
| Only passes it if there is a type that supports related fields.
| This is a similar strategy used to pass the ``queryset`` to the field
| being constructed.
|
| get_attname(self)
|
| get_attname_column(self)
|
| get_col(self, alias, output_field=None)
|
| get_db_converters(self, connection)
|
| get_db_prep_save(self, value, connection)
| Return field's value prepared for saving into a database.
|
| get_db_prep_value(self, value, connection, prepared=False)
| Return field's value prepared for interacting with the database backend.
|
| Used by the default implementations of get_db_prep_save().
|
| get_default(self)
| Return the to_field if the default value is an object.
|
| get_reverse_path_info(self, filtered_relation=None)
| Get path from the related model to this field's model.
|
| validate(self, value, model_instance)
| Validate value and raise ValidationError if necessary. Subclasses
| should override this to provide validation logic.
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| target_field
| When filtering against this relation, return the field on the remote
| model against which the filtering should happen.
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| default_error_messages = {'invalid': '%(model)s instance with %(field)...
|
| description = 'Foreign Key (type determined by related field)'
|
| empty_strings_allowed = False
|
| many_to_many = False
|
| many_to_one = True
|
| one_to_many = False
|
| one_to_one = False
|
| rel_class = <class 'django.db.models.fields.reverse_related.ManyToOneR...
| Used by the ForeignKey field to store information about the relation.
|
| ``_meta.get_fields()`` returns this class to provide access to the field
| flags for the reverse relation.
|
| Note: Because we somewhat abuse the Rel objects by using them as reverse
| fields we get the funny situation where
| ``ManyToOneRel.many_to_one == False`` and
| ``ManyToOneRel.one_to_many == True``. This is unfortunate but the actual
| ManyToOneRel class is a private API and there is work underway to turn
| reverse relations into actual fields.
|
| ----------------------------------------------------------------------
| Methods inherited from ForeignObject:
|
| contribute_to_class(self, cls, name, private_only=False, **kwargs)
| Register the field with the model class it belongs to.
|
| If private_only is True, create a separate instance of this field
| for every subclass of cls, even if cls is not an abstract model.
|
| get_extra_descriptor_filter(self, instance)
| Return an extra filter condition for related object fetching when
| user does 'instance.fieldname', that is the extra filter is used in
| the descriptor of the field.
|
| The filter should be either a dict usable in .filter(**kwargs) call or
| a Q-object. The condition will be ANDed together with the relation's
| joining columns.
|
| A parallel method is get_extra_restriction() which is used in
| JOIN and subquery conditions.
|
| get_extra_restriction(self, where_class, alias, related_alias)
| Return a pair condition used for joining and subquery pushdown. The
| condition is something that responds to as_sql(compiler, connection)
| method.
|
| Note that currently referring both the 'alias' and 'related_alias'
| will not work in some conditions, like subquery pushdown.
|
| A parallel method is get_extra_descriptor_filter() which is used in
| instance.fieldname related object fetching.
|
| get_foreign_related_value(self, instance)
|
| get_joining_columns(self, reverse_join=False)
|
| get_local_related_value(self, instance)
|
| get_path_info(self, filtered_relation=None)
| Get path from this field to the related model.
|
| get_reverse_joining_columns(self)
|
| resolve_related_fields(self)
|
| ----------------------------------------------------------------------
| Class methods inherited from ForeignObject:
|
| get_lookups() from builtins.type
|
| ----------------------------------------------------------------------
| Static methods inherited from ForeignObject:
|
| get_instance_value_for_fields(instance, fields)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from ForeignObject:
|
| foreign_related_fields
|
| local_related_fields
|
| related_fields
|
| reverse_related_fields
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from ForeignObject:
|
| class_lookups = {'exact': <class 'django.db.models.fields.related_look...
|
| forward_related_accessor_class = <class 'django.db.models.fields.relat...
| Accessor to the related object on the forward side of a many-to-one or
| one-to-one (via ForwardOneToOneDescriptor subclass) relation.
|
| In the example::
|
| class Child(Model):
| parent = ForeignKey(Parent, related_name='children')
|
| ``Child.parent`` is a ``ForwardManyToOneDescriptor`` instance.
|
| related_accessor_class = <class 'django.db.models.fields.related_descr...
| Accessor to the related objects manager on the reverse side of a
| many-to-one relation.
|
| In the example::
|
| class Child(Model):
| parent = ForeignKey(Parent, related_name='children')
|
| ``Parent.children`` is a ``ReverseManyToOneDescriptor`` instance.
|
| Most of the implementation is delegated to a dynamically defined manager
| class built by ``create_forward_many_to_many_manager()`` defined below.
|
| requires_unique_target = True
|
| ----------------------------------------------------------------------
| Methods inherited from RelatedField:
|
| do_related_class(self, other, cls)
|
| get_cache_name(self)
|
| get_forward_related_filter(self, obj)
| Return the keyword arguments that when supplied to
| self.model.object.filter(), would select all instances related through
| this field to the remote obj. This is used to build the querysets
| returned by related descriptors. obj is an instance of
| self.related_field.model.
|
| get_limit_choices_to(self)
| Return ``limit_choices_to`` for this model field.
|
| If it is a callable, it will be invoked and the result will be
| returned.
|
| get_reverse_related_filter(self, obj)
| Complement to get_forward_related_filter(). Return the keyword
| arguments that when passed to self.related_field.model.object.filter()
| select all instances of self.related_field.model related through
| this field to obj. obj is an instance of self.model.
|
| related_model = <django.utils.functional.cached_property object>
| related_query_name(self)
| Define the name that can be used to identify this related object in a
| table-spanning query.
|
| set_attributes_from_rel(self)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from RelatedField:
|
| swappable_setting
| Get the setting that this is powered from for swapping, or None
| if it's not swapped in / marked with swappable=False.
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.fields.mixins.FieldCacheMixin:
|
| delete_cached_value(self, instance)
|
| get_cached_value(self, instance, default=<object object at 0x0000020722069580>)
|
| is_cached(self, instance)
|
| set_cached_value(self, instance, value)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from django.db.models.fields.mixins.FieldCacheMixin:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.fields.Field:
|
| __copy__(self)
|
| __deepcopy__(self, memodict)
|
| __eq__(self, other)
| Return self==value.
|
| __ge__(self, other, NotImplemented=NotImplemented)
| Return a >= b. Computed by @total_ordering from (not a < b).
|
| __gt__(self, other, NotImplemented=NotImplemented)
| Return a > b. Computed by @total_ordering from (not a < b) and (a != b).
|
| __hash__(self)
| Return hash(self).
|
| __le__(self, other, NotImplemented=NotImplemented)
| Return a <= b. Computed by @total_ordering from (a < b) or (a == b).
|
| __lt__(self, other)
| Return self<value.
|
| __reduce__(self)
| Pickling should return the model._meta.fields instance of the field,
| not a new copy of that field. So, use the app registry to load the
| model and then the field back.
|
| __repr__(self)
| Display the module, class, and name of the field.
|
| __str__(self)
| Return "app_label.model_label.field_name" for fields attached to
| models.
|
| cached_col = <django.utils.functional.cached_property object>
| cast_db_type(self, connection)
| Return the data type to use in the Cast() function.
|
| clean(self, value, model_instance)
| Convert the value's type and run validation. Validation errors
| from to_python() and validate() are propagated. Return the correct
| value if no error is raised.
|
| clone(self)
| Uses deconstruct() to clone a new copy of this Field.
| Will not preserve any class attachments/attribute names.
|
| db_type_parameters(self, connection)
|
| db_type_suffix(self, connection)
|
| get_choices(self, include_blank=True, blank_choice=[('', '---------')], limit_choices_to=None)
| Return choices with a default blank choices included, for use
| as <select> choices for this field.
|
| get_filter_kwargs_for_object(self, obj)
| Return a dict that when passed as kwargs to self.model.filter(), would
| yield all instances having the same value for this field as obj has.
|
| get_internal_type(self)
|
| get_pk_value_on_save(self, instance)
| Hook to generate new PK values on save. This method is called when
| saving instances with no primary key value set. If this method returns
| something else than None, then the returned value is used when saving
| the new instance.
|
| get_prep_value(self, value)
| Perform preliminary non-db specific value checks and conversions.
|
| has_default(self)
| Return a boolean of whether this field has a default value.
|
| pre_save(self, model_instance, add)
| Return field's value just before saving.
|
| rel_db_type(self, connection)
| Return the data type that a related field pointing to this field should
| use. For example, this method is called by ForeignKey and OneToOneField
| to determine its data type.
|
| run_validators(self, value)
|
| save_form_data(self, instance, data)
|
| select_format(self, compiler, sql, params)
| Custom format for select clauses. For example, GIS columns need to be
| selected as AsText(table.col) on MySQL as the table.col data can't be
| used by Django.
|
| set_attributes_from_name(self, name)
|
| to_python(self, value)
| Convert the input value into the expected Python data type, raising
| django.core.exceptions.ValidationError if the data can't be converted.
| Return the converted value. Subclasses should override this.
|
| validators = <django.utils.functional.cached_property object>
| value_from_object(self, obj)
| Return the value of this field in the given model instance.
|
| value_to_string(self, obj)
| Return a string value of this field from the passed obj.
| This is used by the serialization framework.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from django.db.models.fields.Field:
|
| db_tablespace
|
| flatchoices
| Flattened version of choices tuple.
|
| unique
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from django.db.models.fields.Field:
|
| auto_creation_counter = -11
|
| creation_counter = 58
|
| default_validators = []
|
| empty_values = [None, '', [], (), {}]
|
| hidden = False
|
| system_check_deprecated_details = None
|
| system_check_removed_details = None
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| get_lookup(self, lookup_name)
|
| get_transform(self, lookup_name)
|
| ----------------------------------------------------------------------
| Class methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| register_lookup(lookup, lookup_name=None) from builtins.type
|
| ----------------------------------------------------------------------
| Static methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| merge_dicts(dicts)
| Merge dicts in reverse to preference the order of the original list. e.g.,
| merge_dicts([a, b]) will preference the keys in 'a' over those in 'b'.
class ForeignObject(RelatedField)
| Abstraction of the ForeignKey relation to support multi-column relations.
|
| Method resolution order:
| ForeignObject
| RelatedField
| django.db.models.fields.mixins.FieldCacheMixin
| django.db.models.fields.Field
| django.db.models.query_utils.RegisterLookupMixin
| builtins.object
|
| Methods defined here:
|
| __init__(self, to, on_delete, from_fields, to_fields, rel=None, related_name=None, related_query_name=None, limit_choices_to=None, parent_link=False, swappable=True, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| check(self, **kwargs)
|
| contribute_to_class(self, cls, name, private_only=False, **kwargs)
| Register the field with the model class it belongs to.
|
| If private_only is True, create a separate instance of this field
| for every subclass of cls, even if cls is not an abstract model.
|
| contribute_to_related_class(self, cls, related)
|
| deconstruct(self)
| Return enough information to recreate the field as a 4-tuple:
|
| * The name of the field on the model, if contribute_to_class() has
| been run.
| * The import path of the field, including the class:e.g.
| django.db.models.IntegerField This should be the most portable
| version, so less specific may be better.
| * A list of positional arguments.
| * A dict of keyword arguments.
|
| Note that the positional or keyword arguments must contain values of
| the following types (including inner values of collection types):
|
| * None, bool, str, int, float, complex, set, frozenset, list, tuple,
| dict
| * UUID
| * datetime.datetime (naive), datetime.date
| * top-level classes, top-level functions - will be referenced by their
| full import path
| * Storage instances - these have their own deconstruct() method
|
| This is because the values here must be serialized into a text format
| (possibly new Python code, possibly JSON) and these are the only types
| with encoding handlers defined.
|
| There's no need to return the exact way the field was instantiated this
| time, just ensure that the resulting field is the same - prefer keyword
| arguments over positional ones, and omit parameters with their default
| values.
|
| get_attname_column(self)
|
| get_extra_descriptor_filter(self, instance)
| Return an extra filter condition for related object fetching when
| user does 'instance.fieldname', that is the extra filter is used in
| the descriptor of the field.
|
| The filter should be either a dict usable in .filter(**kwargs) call or
| a Q-object. The condition will be ANDed together with the relation's
| joining columns.
|
| A parallel method is get_extra_restriction() which is used in
| JOIN and subquery conditions.
|
| get_extra_restriction(self, where_class, alias, related_alias)
| Return a pair condition used for joining and subquery pushdown. The
| condition is something that responds to as_sql(compiler, connection)
| method.
|
| Note that currently referring both the 'alias' and 'related_alias'
| will not work in some conditions, like subquery pushdown.
|
| A parallel method is get_extra_descriptor_filter() which is used in
| instance.fieldname related object fetching.
|
| get_foreign_related_value(self, instance)
|
| get_joining_columns(self, reverse_join=False)
|
| get_local_related_value(self, instance)
|
| get_path_info(self, filtered_relation=None)
| Get path from this field to the related model.
|
| get_reverse_joining_columns(self)
|
| get_reverse_path_info(self, filtered_relation=None)
| Get path from the related model to this field's model.
|
| resolve_related_fields(self)
|
| ----------------------------------------------------------------------
| Class methods defined here:
|
| get_lookups() from builtins.type
|
| ----------------------------------------------------------------------
| Static methods defined here:
|
| get_instance_value_for_fields(instance, fields)
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| foreign_related_fields
|
| local_related_fields
|
| related_fields
|
| reverse_related_fields
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| class_lookups = {'exact': <class 'django.db.models.fields.related_look...
|
| forward_related_accessor_class = <class 'django.db.models.fields.relat...
| Accessor to the related object on the forward side of a many-to-one or
| one-to-one (via ForwardOneToOneDescriptor subclass) relation.
|
| In the example::
|
| class Child(Model):
| parent = ForeignKey(Parent, related_name='children')
|
| ``Child.parent`` is a ``ForwardManyToOneDescriptor`` instance.
|
| many_to_many = False
|
| many_to_one = True
|
| one_to_many = False
|
| one_to_one = False
|
| rel_class = <class 'django.db.models.fields.reverse_related.ForeignObj...
| Used by ForeignObject to store information about the relation.
|
| ``_meta.get_fields()`` returns this class to provide access to the field
| flags for the reverse relation.
|
| related_accessor_class = <class 'django.db.models.fields.related_descr...
| Accessor to the related objects manager on the reverse side of a
| many-to-one relation.
|
| In the example::
|
| class Child(Model):
| parent = ForeignKey(Parent, related_name='children')
|
| ``Parent.children`` is a ``ReverseManyToOneDescriptor`` instance.
|
| Most of the implementation is delegated to a dynamically defined manager
| class built by ``create_forward_many_to_many_manager()`` defined below.
|
| requires_unique_target = True
|
| ----------------------------------------------------------------------
| Methods inherited from RelatedField:
|
| db_type(self, connection)
| Return the database column data type for this field, for the provided
| connection.
|
| do_related_class(self, other, cls)
|
| formfield(self, **kwargs)
| Pass ``limit_choices_to`` to the field being constructed.
|
| Only passes it if there is a type that supports related fields.
| This is a similar strategy used to pass the ``queryset`` to the field
| being constructed.
|
| get_cache_name(self)
|
| get_forward_related_filter(self, obj)
| Return the keyword arguments that when supplied to
| self.model.object.filter(), would select all instances related through
| this field to the remote obj. This is used to build the querysets
| returned by related descriptors. obj is an instance of
| self.related_field.model.
|
| get_limit_choices_to(self)
| Return ``limit_choices_to`` for this model field.
|
| If it is a callable, it will be invoked and the result will be
| returned.
|
| get_reverse_related_filter(self, obj)
| Complement to get_forward_related_filter(). Return the keyword
| arguments that when passed to self.related_field.model.object.filter()
| select all instances of self.related_field.model related through
| this field to obj. obj is an instance of self.model.
|
| related_model = <django.utils.functional.cached_property object>
| related_query_name(self)
| Define the name that can be used to identify this related object in a
| table-spanning query.
|
| set_attributes_from_rel(self)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from RelatedField:
|
| swappable_setting
| Get the setting that this is powered from for swapping, or None
| if it's not swapped in / marked with swappable=False.
|
| target_field
| When filtering against this relation, return the field on the remote
| model against which the filtering should happen.
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.fields.mixins.FieldCacheMixin:
|
| delete_cached_value(self, instance)
|
| get_cached_value(self, instance, default=<object object at 0x0000020722069580>)
|
| is_cached(self, instance)
|
| set_cached_value(self, instance, value)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from django.db.models.fields.mixins.FieldCacheMixin:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.fields.Field:
|
| __copy__(self)
|
| __deepcopy__(self, memodict)
|
| __eq__(self, other)
| Return self==value.
|
| __ge__(self, other, NotImplemented=NotImplemented)
| Return a >= b. Computed by @total_ordering from (not a < b).
|
| __gt__(self, other, NotImplemented=NotImplemented)
| Return a > b. Computed by @total_ordering from (not a < b) and (a != b).
|
| __hash__(self)
| Return hash(self).
|
| __le__(self, other, NotImplemented=NotImplemented)
| Return a <= b. Computed by @total_ordering from (a < b) or (a == b).
|
| __lt__(self, other)
| Return self<value.
|
| __reduce__(self)
| Pickling should return the model._meta.fields instance of the field,
| not a new copy of that field. So, use the app registry to load the
| model and then the field back.
|
| __repr__(self)
| Display the module, class, and name of the field.
|
| __str__(self)
| Return "app_label.model_label.field_name" for fields attached to
| models.
|
| cached_col = <django.utils.functional.cached_property object>
| cast_db_type(self, connection)
| Return the data type to use in the Cast() function.
|
| clean(self, value, model_instance)
| Convert the value's type and run validation. Validation errors
| from to_python() and validate() are propagated. Return the correct
| value if no error is raised.
|
| clone(self)
| Uses deconstruct() to clone a new copy of this Field.
| Will not preserve any class attachments/attribute names.
|
| db_check(self, connection)
| Return the database column check constraint for this field, for the
| provided connection. Works the same way as db_type() for the case that
| get_internal_type() does not map to a preexisting model field.
|
| db_parameters(self, connection)
| Extension of db_type(), providing a range of different return values
| (type, checks). This will look at db_type(), allowing custom model
| fields to override it.
|
| db_type_parameters(self, connection)
|
| db_type_suffix(self, connection)
|
| get_attname(self)
|
| get_choices(self, include_blank=True, blank_choice=[('', '---------')], limit_choices_to=None)
| Return choices with a default blank choices included, for use
| as <select> choices for this field.
|
| get_col(self, alias, output_field=None)
|
| get_db_converters(self, connection)
|
| get_db_prep_save(self, value, connection)
| Return field's value prepared for saving into a database.
|
| get_db_prep_value(self, value, connection, prepared=False)
| Return field's value prepared for interacting with the database backend.
|
| Used by the default implementations of get_db_prep_save().
|
| get_default(self)
| Return the default value for this field.
|
| get_filter_kwargs_for_object(self, obj)
| Return a dict that when passed as kwargs to self.model.filter(), would
| yield all instances having the same value for this field as obj has.
|
| get_internal_type(self)
|
| get_pk_value_on_save(self, instance)
| Hook to generate new PK values on save. This method is called when
| saving instances with no primary key value set. If this method returns
| something else than None, then the returned value is used when saving
| the new instance.
|
| get_prep_value(self, value)
| Perform preliminary non-db specific value checks and conversions.
|
| has_default(self)
| Return a boolean of whether this field has a default value.
|
| pre_save(self, model_instance, add)
| Return field's value just before saving.
|
| rel_db_type(self, connection)
| Return the data type that a related field pointing to this field should
| use. For example, this method is called by ForeignKey and OneToOneField
| to determine its data type.
|
| run_validators(self, value)
|
| save_form_data(self, instance, data)
|
| select_format(self, compiler, sql, params)
| Custom format for select clauses. For example, GIS columns need to be
| selected as AsText(table.col) on MySQL as the table.col data can't be
| used by Django.
|
| set_attributes_from_name(self, name)
|
| to_python(self, value)
| Convert the input value into the expected Python data type, raising
| django.core.exceptions.ValidationError if the data can't be converted.
| Return the converted value. Subclasses should override this.
|
| validate(self, value, model_instance)
| Validate value and raise ValidationError if necessary. Subclasses
| should override this to provide validation logic.
|
| validators = <django.utils.functional.cached_property object>
| value_from_object(self, obj)
| Return the value of this field in the given model instance.
|
| value_to_string(self, obj)
| Return a string value of this field from the passed obj.
| This is used by the serialization framework.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from django.db.models.fields.Field:
|
| db_tablespace
|
| description
|
| flatchoices
| Flattened version of choices tuple.
|
| unique
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from django.db.models.fields.Field:
|
| auto_creation_counter = -11
|
| creation_counter = 58
|
| default_error_messages = {'blank': 'This field cannot be blank.', 'inv...
|
| default_validators = []
|
| empty_strings_allowed = True
|
| empty_values = [None, '', [], (), {}]
|
| hidden = False
|
| system_check_deprecated_details = None
|
| system_check_removed_details = None
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| get_lookup(self, lookup_name)
|
| get_transform(self, lookup_name)
|
| ----------------------------------------------------------------------
| Class methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| register_lookup(lookup, lookup_name=None) from builtins.type
|
| ----------------------------------------------------------------------
| Static methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| merge_dicts(dicts)
| Merge dicts in reverse to preference the order of the original list. e.g.,
| merge_dicts([a, b]) will preference the keys in 'a' over those in 'b'.
class Func(SQLiteNumericMixin, Expression)
| An SQL function call.
|
| Method resolution order:
| Func
| SQLiteNumericMixin
| Expression
| BaseExpression
| Combinable
| builtins.object
|
| Methods defined here:
|
| __init__(self, *expressions, output_field=None, **extra)
| Initialize self. See help(type(self)) for accurate signature.
|
| __repr__(self)
| Return repr(self).
|
| as_sql(self, compiler, connection, function=None, template=None, arg_joiner=None, **extra_context)
| Responsible for returning a (sql, [params]) tuple to be included
| in the current query.
|
| Different backends can provide their own implementation, by
| providing an `as_{vendor}` method and patching the Expression:
|
| ```
| def override_as_sql(self, compiler, connection):
| # custom logic
| return super().as_sql(compiler, connection)
| setattr(Expression, 'as_' + connection.vendor, override_as_sql)
| ```
|
| Arguments:
| * compiler: the query compiler responsible for generating the query.
| Must have a compile method, returning a (sql, [params]) tuple.
| Calling compiler(value) will return a quoted `value`.
|
| * connection: the database connection used for the current query.
|
| Return: (sql, params)
| Where `sql` is a string containing ordered sql parameters to be
| replaced with the elements of the list `params`.
|
| copy(self)
|
| get_source_expressions(self)
|
| resolve_expression(self, query=None, allow_joins=True, reuse=None, summarize=False, for_save=False)
| Provide the chance to do any preprocessing or validation before being
| added to the query.
|
| Arguments:
| * query: the backend query implementation
| * allow_joins: boolean allowing or denying use of joins
| in this query
| * reuse: a set of reusable joins for multijoins
| * summarize: a terminal aggregate clause
| * for_save: whether this expression about to be used in a save or update
|
| Return: an Expression to be added to the query.
|
| set_source_expressions(self, exprs)
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| arg_joiner = ', '
|
| arity = None
|
| function = None
|
| template = '%(function)s(%(expressions)s)'
|
| ----------------------------------------------------------------------
| Methods inherited from SQLiteNumericMixin:
|
| as_sqlite(self, compiler, connection, **extra_context)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from SQLiteNumericMixin:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
|
| ----------------------------------------------------------------------
| Methods inherited from BaseExpression:
|
| __eq__(self, other)
| Return self==value.
|
| __getstate__(self)
|
| __hash__(self)
| Return hash(self).
|
| asc(self, **kwargs)
|
| contains_aggregate = <django.utils.functional.cached_property object>
| contains_column_references = <django.utils.functional.cached_property object>
| contains_over_clause = <django.utils.functional.cached_property object>
| convert_value = <django.utils.functional.cached_property object>
| deconstruct(obj)
| Return a 3-tuple of class import path, positional arguments,
| and keyword arguments.
|
| desc(self, **kwargs)
|
| flatten(self)
| Recursively yield this expression and all subexpressions, in
| depth-first order.
|
| get_db_converters(self, connection)
|
| get_group_by_cols(self)
|
| get_lookup(self, lookup)
|
| get_source_fields(self)
| Return the underlying field types used by this aggregate.
|
| get_transform(self, name)
|
| output_field = <django.utils.functional.cached_property object>
| relabeled_clone(self, change_map)
|
| reverse_ordering(self)
|
| ----------------------------------------------------------------------
| Static methods inherited from BaseExpression:
|
| __new__(cls, *args, **kwargs)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from BaseExpression:
|
| field
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from BaseExpression:
|
| filterable = True
|
| is_summary = False
|
| window_compatible = False
|
| ----------------------------------------------------------------------
| Methods inherited from Combinable:
|
| __add__(self, other)
|
| __and__(self, other)
|
| __mod__(self, other)
|
| __mul__(self, other)
|
| __or__(self, other)
|
| __pow__(self, other)
|
| __radd__(self, other)
|
| __rand__(self, other)
|
| __rmod__(self, other)
|
| __rmul__(self, other)
|
| __ror__(self, other)
|
| __rpow__(self, other)
|
| __rsub__(self, other)
|
| __rtruediv__(self, other)
|
| __sub__(self, other)
|
| __truediv__(self, other)
|
| bitand(self, other)
|
| bitleftshift(self, other)
|
| bitor(self, other)
|
| bitrightshift(self, other)
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from Combinable:
|
| ADD = '+'
|
| BITAND = '&'
|
| BITLEFTSHIFT = '<<'
|
| BITOR = '|'
|
| BITRIGHTSHIFT = '>>'
|
| DIV = '/'
|
| MOD = '%%'
|
| MUL = '*'
|
| POW = '^'
|
| SUB = '-'
class GenericIPAddressField(Field)
| Base class for all field types
|
| Method resolution order:
| GenericIPAddressField
| Field
| django.db.models.query_utils.RegisterLookupMixin
| builtins.object
|
| Methods defined here:
|
| __init__(self, verbose_name=None, name=None, protocol='both', unpack_ipv4=False, *args, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| check(self, **kwargs)
|
| deconstruct(self)
| Return enough information to recreate the field as a 4-tuple:
|
| * The name of the field on the model, if contribute_to_class() has
| been run.
| * The import path of the field, including the class:e.g.
| django.db.models.IntegerField This should be the most portable
| version, so less specific may be better.
| * A list of positional arguments.
| * A dict of keyword arguments.
|
| Note that the positional or keyword arguments must contain values of
| the following types (including inner values of collection types):
|
| * None, bool, str, int, float, complex, set, frozenset, list, tuple,
| dict
| * UUID
| * datetime.datetime (naive), datetime.date
| * top-level classes, top-level functions - will be referenced by their
| full import path
| * Storage instances - these have their own deconstruct() method
|
| This is because the values here must be serialized into a text format
| (possibly new Python code, possibly JSON) and these are the only types
| with encoding handlers defined.
|
| There's no need to return the exact way the field was instantiated this
| time, just ensure that the resulting field is the same - prefer keyword
| arguments over positional ones, and omit parameters with their default
| values.
|
| formfield(self, **kwargs)
| Return a django.forms.Field instance for this field.
|
| get_db_prep_value(self, value, connection, prepared=False)
| Return field's value prepared for interacting with the database backend.
|
| Used by the default implementations of get_db_prep_save().
|
| get_internal_type(self)
|
| get_prep_value(self, value)
| Perform preliminary non-db specific value checks and conversions.
|
| to_python(self, value)
| Convert the input value into the expected Python data type, raising
| django.core.exceptions.ValidationError if the data can't be converted.
| Return the converted value. Subclasses should override this.
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| default_error_messages = {}
|
| description = 'IP address'
|
| empty_strings_allowed = False
|
| ----------------------------------------------------------------------
| Methods inherited from Field:
|
| __copy__(self)
|
| __deepcopy__(self, memodict)
|
| __eq__(self, other)
| Return self==value.
|
| __ge__(self, other, NotImplemented=NotImplemented)
| Return a >= b. Computed by @total_ordering from (not a < b).
|
| __gt__(self, other, NotImplemented=NotImplemented)
| Return a > b. Computed by @total_ordering from (not a < b) and (a != b).
|
| __hash__(self)
| Return hash(self).
|
| __le__(self, other, NotImplemented=NotImplemented)
| Return a <= b. Computed by @total_ordering from (a < b) or (a == b).
|
| __lt__(self, other)
| Return self<value.
|
| __reduce__(self)
| Pickling should return the model._meta.fields instance of the field,
| not a new copy of that field. So, use the app registry to load the
| model and then the field back.
|
| __repr__(self)
| Display the module, class, and name of the field.
|
| __str__(self)
| Return "app_label.model_label.field_name" for fields attached to
| models.
|
| cached_col = <django.utils.functional.cached_property object>
| cast_db_type(self, connection)
| Return the data type to use in the Cast() function.
|
| clean(self, value, model_instance)
| Convert the value's type and run validation. Validation errors
| from to_python() and validate() are propagated. Return the correct
| value if no error is raised.
|
| clone(self)
| Uses deconstruct() to clone a new copy of this Field.
| Will not preserve any class attachments/attribute names.
|
| contribute_to_class(self, cls, name, private_only=False)
| Register the field with the model class it belongs to.
|
| If private_only is True, create a separate instance of this field
| for every subclass of cls, even if cls is not an abstract model.
|
| db_check(self, connection)
| Return the database column check constraint for this field, for the
| provided connection. Works the same way as db_type() for the case that
| get_internal_type() does not map to a preexisting model field.
|
| db_parameters(self, connection)
| Extension of db_type(), providing a range of different return values
| (type, checks). This will look at db_type(), allowing custom model
| fields to override it.
|
| db_type(self, connection)
| Return the database column data type for this field, for the provided
| connection.
|
| db_type_parameters(self, connection)
|
| db_type_suffix(self, connection)
|
| get_attname(self)
|
| get_attname_column(self)
|
| get_choices(self, include_blank=True, blank_choice=[('', '---------')], limit_choices_to=None)
| Return choices with a default blank choices included, for use
| as <select> choices for this field.
|
| get_col(self, alias, output_field=None)
|
| get_db_converters(self, connection)
|
| get_db_prep_save(self, value, connection)
| Return field's value prepared for saving into a database.
|
| get_default(self)
| Return the default value for this field.
|
| get_filter_kwargs_for_object(self, obj)
| Return a dict that when passed as kwargs to self.model.filter(), would
| yield all instances having the same value for this field as obj has.
|
| get_pk_value_on_save(self, instance)
| Hook to generate new PK values on save. This method is called when
| saving instances with no primary key value set. If this method returns
| something else than None, then the returned value is used when saving
| the new instance.
|
| has_default(self)
| Return a boolean of whether this field has a default value.
|
| pre_save(self, model_instance, add)
| Return field's value just before saving.
|
| rel_db_type(self, connection)
| Return the data type that a related field pointing to this field should
| use. For example, this method is called by ForeignKey and OneToOneField
| to determine its data type.
|
| run_validators(self, value)
|
| save_form_data(self, instance, data)
|
| select_format(self, compiler, sql, params)
| Custom format for select clauses. For example, GIS columns need to be
| selected as AsText(table.col) on MySQL as the table.col data can't be
| used by Django.
|
| set_attributes_from_name(self, name)
|
| validate(self, value, model_instance)
| Validate value and raise ValidationError if necessary. Subclasses
| should override this to provide validation logic.
|
| validators = <django.utils.functional.cached_property object>
| value_from_object(self, obj)
| Return the value of this field in the given model instance.
|
| value_to_string(self, obj)
| Return a string value of this field from the passed obj.
| This is used by the serialization framework.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from Field:
|
| db_tablespace
|
| flatchoices
| Flattened version of choices tuple.
|
| unique
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from Field:
|
| auto_creation_counter = -11
|
| class_lookups = {'contains': <class 'django.db.models.lookups.Contains...
|
| creation_counter = 58
|
| default_validators = []
|
| empty_values = [None, '', [], (), {}]
|
| hidden = False
|
| many_to_many = None
|
| many_to_one = None
|
| one_to_many = None
|
| one_to_one = None
|
| related_model = None
|
| system_check_deprecated_details = None
|
| system_check_removed_details = None
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| get_lookup(self, lookup_name)
|
| get_transform(self, lookup_name)
|
| ----------------------------------------------------------------------
| Class methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| get_lookups() from builtins.type
|
| register_lookup(lookup, lookup_name=None) from builtins.type
|
| ----------------------------------------------------------------------
| Static methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| merge_dicts(dicts)
| Merge dicts in reverse to preference the order of the original list. e.g.,
| merge_dicts([a, b]) will preference the keys in 'a' over those in 'b'.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
class IPAddressField(Field)
| Base class for all field types
|
| Method resolution order:
| IPAddressField
| Field
| django.db.models.query_utils.RegisterLookupMixin
| builtins.object
|
| Methods defined here:
|
| __init__(self, *args, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| deconstruct(self)
| Return enough information to recreate the field as a 4-tuple:
|
| * The name of the field on the model, if contribute_to_class() has
| been run.
| * The import path of the field, including the class:e.g.
| django.db.models.IntegerField This should be the most portable
| version, so less specific may be better.
| * A list of positional arguments.
| * A dict of keyword arguments.
|
| Note that the positional or keyword arguments must contain values of
| the following types (including inner values of collection types):
|
| * None, bool, str, int, float, complex, set, frozenset, list, tuple,
| dict
| * UUID
| * datetime.datetime (naive), datetime.date
| * top-level classes, top-level functions - will be referenced by their
| full import path
| * Storage instances - these have their own deconstruct() method
|
| This is because the values here must be serialized into a text format
| (possibly new Python code, possibly JSON) and these are the only types
| with encoding handlers defined.
|
| There's no need to return the exact way the field was instantiated this
| time, just ensure that the resulting field is the same - prefer keyword
| arguments over positional ones, and omit parameters with their default
| values.
|
| get_internal_type(self)
|
| get_prep_value(self, value)
| Perform preliminary non-db specific value checks and conversions.
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| description = 'IPv4 address'
|
| empty_strings_allowed = False
|
| system_check_removed_details = {'hint': 'Use GenericIPAddressField ins...
|
| ----------------------------------------------------------------------
| Methods inherited from Field:
|
| __copy__(self)
|
| __deepcopy__(self, memodict)
|
| __eq__(self, other)
| Return self==value.
|
| __ge__(self, other, NotImplemented=NotImplemented)
| Return a >= b. Computed by @total_ordering from (not a < b).
|
| __gt__(self, other, NotImplemented=NotImplemented)
| Return a > b. Computed by @total_ordering from (not a < b) and (a != b).
|
| __hash__(self)
| Return hash(self).
|
| __le__(self, other, NotImplemented=NotImplemented)
| Return a <= b. Computed by @total_ordering from (a < b) or (a == b).
|
| __lt__(self, other)
| Return self<value.
|
| __reduce__(self)
| Pickling should return the model._meta.fields instance of the field,
| not a new copy of that field. So, use the app registry to load the
| model and then the field back.
|
| __repr__(self)
| Display the module, class, and name of the field.
|
| __str__(self)
| Return "app_label.model_label.field_name" for fields attached to
| models.
|
| cached_col = <django.utils.functional.cached_property object>
| cast_db_type(self, connection)
| Return the data type to use in the Cast() function.
|
| check(self, **kwargs)
|
| clean(self, value, model_instance)
| Convert the value's type and run validation. Validation errors
| from to_python() and validate() are propagated. Return the correct
| value if no error is raised.
|
| clone(self)
| Uses deconstruct() to clone a new copy of this Field.
| Will not preserve any class attachments/attribute names.
|
| contribute_to_class(self, cls, name, private_only=False)
| Register the field with the model class it belongs to.
|
| If private_only is True, create a separate instance of this field
| for every subclass of cls, even if cls is not an abstract model.
|
| db_check(self, connection)
| Return the database column check constraint for this field, for the
| provided connection. Works the same way as db_type() for the case that
| get_internal_type() does not map to a preexisting model field.
|
| db_parameters(self, connection)
| Extension of db_type(), providing a range of different return values
| (type, checks). This will look at db_type(), allowing custom model
| fields to override it.
|
| db_type(self, connection)
| Return the database column data type for this field, for the provided
| connection.
|
| db_type_parameters(self, connection)
|
| db_type_suffix(self, connection)
|
| formfield(self, form_class=None, choices_form_class=None, **kwargs)
| Return a django.forms.Field instance for this field.
|
| get_attname(self)
|
| get_attname_column(self)
|
| get_choices(self, include_blank=True, blank_choice=[('', '---------')], limit_choices_to=None)
| Return choices with a default blank choices included, for use
| as <select> choices for this field.
|
| get_col(self, alias, output_field=None)
|
| get_db_converters(self, connection)
|
| get_db_prep_save(self, value, connection)
| Return field's value prepared for saving into a database.
|
| get_db_prep_value(self, value, connection, prepared=False)
| Return field's value prepared for interacting with the database backend.
|
| Used by the default implementations of get_db_prep_save().
|
| get_default(self)
| Return the default value for this field.
|
| get_filter_kwargs_for_object(self, obj)
| Return a dict that when passed as kwargs to self.model.filter(), would
| yield all instances having the same value for this field as obj has.
|
| get_pk_value_on_save(self, instance)
| Hook to generate new PK values on save. This method is called when
| saving instances with no primary key value set. If this method returns
| something else than None, then the returned value is used when saving
| the new instance.
|
| has_default(self)
| Return a boolean of whether this field has a default value.
|
| pre_save(self, model_instance, add)
| Return field's value just before saving.
|
| rel_db_type(self, connection)
| Return the data type that a related field pointing to this field should
| use. For example, this method is called by ForeignKey and OneToOneField
| to determine its data type.
|
| run_validators(self, value)
|
| save_form_data(self, instance, data)
|
| select_format(self, compiler, sql, params)
| Custom format for select clauses. For example, GIS columns need to be
| selected as AsText(table.col) on MySQL as the table.col data can't be
| used by Django.
|
| set_attributes_from_name(self, name)
|
| to_python(self, value)
| Convert the input value into the expected Python data type, raising
| django.core.exceptions.ValidationError if the data can't be converted.
| Return the converted value. Subclasses should override this.
|
| validate(self, value, model_instance)
| Validate value and raise ValidationError if necessary. Subclasses
| should override this to provide validation logic.
|
| validators = <django.utils.functional.cached_property object>
| value_from_object(self, obj)
| Return the value of this field in the given model instance.
|
| value_to_string(self, obj)
| Return a string value of this field from the passed obj.
| This is used by the serialization framework.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from Field:
|
| db_tablespace
|
| flatchoices
| Flattened version of choices tuple.
|
| unique
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from Field:
|
| auto_creation_counter = -11
|
| class_lookups = {'contains': <class 'django.db.models.lookups.Contains...
|
| creation_counter = 58
|
| default_error_messages = {'blank': 'This field cannot be blank.', 'inv...
|
| default_validators = []
|
| empty_values = [None, '', [], (), {}]
|
| hidden = False
|
| many_to_many = None
|
| many_to_one = None
|
| one_to_many = None
|
| one_to_one = None
|
| related_model = None
|
| system_check_deprecated_details = None
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| get_lookup(self, lookup_name)
|
| get_transform(self, lookup_name)
|
| ----------------------------------------------------------------------
| Class methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| get_lookups() from builtins.type
|
| register_lookup(lookup, lookup_name=None) from builtins.type
|
| ----------------------------------------------------------------------
| Static methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| merge_dicts(dicts)
| Merge dicts in reverse to preference the order of the original list. e.g.,
| merge_dicts([a, b]) will preference the keys in 'a' over those in 'b'.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
class ImageField(FileField)
| Base class for all field types
|
| Method resolution order:
| ImageField
| FileField
| django.db.models.fields.Field
| django.db.models.query_utils.RegisterLookupMixin
| builtins.object
|
| Methods defined here:
|
| __init__(self, verbose_name=None, name=None, width_field=None, height_field=None, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| check(self, **kwargs)
|
| contribute_to_class(self, cls, name, **kwargs)
| Register the field with the model class it belongs to.
|
| If private_only is True, create a separate instance of this field
| for every subclass of cls, even if cls is not an abstract model.
|
| deconstruct(self)
| Return enough information to recreate the field as a 4-tuple:
|
| * The name of the field on the model, if contribute_to_class() has
| been run.
| * The import path of the field, including the class:e.g.
| django.db.models.IntegerField This should be the most portable
| version, so less specific may be better.
| * A list of positional arguments.
| * A dict of keyword arguments.
|
| Note that the positional or keyword arguments must contain values of
| the following types (including inner values of collection types):
|
| * None, bool, str, int, float, complex, set, frozenset, list, tuple,
| dict
| * UUID
| * datetime.datetime (naive), datetime.date
| * top-level classes, top-level functions - will be referenced by their
| full import path
| * Storage instances - these have their own deconstruct() method
|
| This is because the values here must be serialized into a text format
| (possibly new Python code, possibly JSON) and these are the only types
| with encoding handlers defined.
|
| There's no need to return the exact way the field was instantiated this
| time, just ensure that the resulting field is the same - prefer keyword
| arguments over positional ones, and omit parameters with their default
| values.
|
| formfield(self, **kwargs)
| Return a django.forms.Field instance for this field.
|
| update_dimension_fields(self, instance, force=False, *args, **kwargs)
| Update field's width and height fields, if defined.
|
| This method is hooked up to model's post_init signal to update
| dimensions after instantiating a model instance. However, dimensions
| won't be updated if the dimensions fields are already populated. This
| avoids unnecessary recalculation when loading an object from the
| database.
|
| Dimensions can be forced to update with force=True, which is how
| ImageFileDescriptor.__set__ calls this method.
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| attr_class = <class 'django.db.models.fields.files.ImageFieldFile'>
| A mixin for use alongside django.core.files.base.File, which provides
| additional features for dealing with images.
|
| description = 'Image'
|
| descriptor_class = <class 'django.db.models.fields.files.ImageFileDesc...
| Just like the FileDescriptor, but for ImageFields. The only difference is
| assigning the width/height to the width_field/height_field, if appropriate.
|
| ----------------------------------------------------------------------
| Methods inherited from FileField:
|
| generate_filename(self, instance, filename)
| Apply (if callable) or prepend (if a string) upload_to to the filename,
| then delegate further processing of the name to the storage backend.
| Until the storage layer, all file paths are expected to be Unix style
| (with forward slashes).
|
| get_internal_type(self)
|
| get_prep_value(self, value)
| Perform preliminary non-db specific value checks and conversions.
|
| pre_save(self, model_instance, add)
| Return field's value just before saving.
|
| save_form_data(self, instance, data)
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.fields.Field:
|
| __copy__(self)
|
| __deepcopy__(self, memodict)
|
| __eq__(self, other)
| Return self==value.
|
| __ge__(self, other, NotImplemented=NotImplemented)
| Return a >= b. Computed by @total_ordering from (not a < b).
|
| __gt__(self, other, NotImplemented=NotImplemented)
| Return a > b. Computed by @total_ordering from (not a < b) and (a != b).
|
| __hash__(self)
| Return hash(self).
|
| __le__(self, other, NotImplemented=NotImplemented)
| Return a <= b. Computed by @total_ordering from (a < b) or (a == b).
|
| __lt__(self, other)
| Return self<value.
|
| __reduce__(self)
| Pickling should return the model._meta.fields instance of the field,
| not a new copy of that field. So, use the app registry to load the
| model and then the field back.
|
| __repr__(self)
| Display the module, class, and name of the field.
|
| __str__(self)
| Return "app_label.model_label.field_name" for fields attached to
| models.
|
| cached_col = <django.utils.functional.cached_property object>
| cast_db_type(self, connection)
| Return the data type to use in the Cast() function.
|
| clean(self, value, model_instance)
| Convert the value's type and run validation. Validation errors
| from to_python() and validate() are propagated. Return the correct
| value if no error is raised.
|
| clone(self)
| Uses deconstruct() to clone a new copy of this Field.
| Will not preserve any class attachments/attribute names.
|
| db_check(self, connection)
| Return the database column check constraint for this field, for the
| provided connection. Works the same way as db_type() for the case that
| get_internal_type() does not map to a preexisting model field.
|
| db_parameters(self, connection)
| Extension of db_type(), providing a range of different return values
| (type, checks). This will look at db_type(), allowing custom model
| fields to override it.
|
| db_type(self, connection)
| Return the database column data type for this field, for the provided
| connection.
|
| db_type_parameters(self, connection)
|
| db_type_suffix(self, connection)
|
| get_attname(self)
|
| get_attname_column(self)
|
| get_choices(self, include_blank=True, blank_choice=[('', '---------')], limit_choices_to=None)
| Return choices with a default blank choices included, for use
| as <select> choices for this field.
|
| get_col(self, alias, output_field=None)
|
| get_db_converters(self, connection)
|
| get_db_prep_save(self, value, connection)
| Return field's value prepared for saving into a database.
|
| get_db_prep_value(self, value, connection, prepared=False)
| Return field's value prepared for interacting with the database backend.
|
| Used by the default implementations of get_db_prep_save().
|
| get_default(self)
| Return the default value for this field.
|
| get_filter_kwargs_for_object(self, obj)
| Return a dict that when passed as kwargs to self.model.filter(), would
| yield all instances having the same value for this field as obj has.
|
| get_pk_value_on_save(self, instance)
| Hook to generate new PK values on save. This method is called when
| saving instances with no primary key value set. If this method returns
| something else than None, then the returned value is used when saving
| the new instance.
|
| has_default(self)
| Return a boolean of whether this field has a default value.
|
| rel_db_type(self, connection)
| Return the data type that a related field pointing to this field should
| use. For example, this method is called by ForeignKey and OneToOneField
| to determine its data type.
|
| run_validators(self, value)
|
| select_format(self, compiler, sql, params)
| Custom format for select clauses. For example, GIS columns need to be
| selected as AsText(table.col) on MySQL as the table.col data can't be
| used by Django.
|
| set_attributes_from_name(self, name)
|
| to_python(self, value)
| Convert the input value into the expected Python data type, raising
| django.core.exceptions.ValidationError if the data can't be converted.
| Return the converted value. Subclasses should override this.
|
| validate(self, value, model_instance)
| Validate value and raise ValidationError if necessary. Subclasses
| should override this to provide validation logic.
|
| validators = <django.utils.functional.cached_property object>
| value_from_object(self, obj)
| Return the value of this field in the given model instance.
|
| value_to_string(self, obj)
| Return a string value of this field from the passed obj.
| This is used by the serialization framework.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from django.db.models.fields.Field:
|
| db_tablespace
|
| flatchoices
| Flattened version of choices tuple.
|
| unique
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from django.db.models.fields.Field:
|
| auto_creation_counter = -11
|
| class_lookups = {'contains': <class 'django.db.models.lookups.Contains...
|
| creation_counter = 58
|
| default_error_messages = {'blank': 'This field cannot be blank.', 'inv...
|
| default_validators = []
|
| empty_strings_allowed = True
|
| empty_values = [None, '', [], (), {}]
|
| hidden = False
|
| many_to_many = None
|
| many_to_one = None
|
| one_to_many = None
|
| one_to_one = None
|
| related_model = None
|
| system_check_deprecated_details = None
|
| system_check_removed_details = None
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| get_lookup(self, lookup_name)
|
| get_transform(self, lookup_name)
|
| ----------------------------------------------------------------------
| Class methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| get_lookups() from builtins.type
|
| register_lookup(lookup, lookup_name=None) from builtins.type
|
| ----------------------------------------------------------------------
| Static methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| merge_dicts(dicts)
| Merge dicts in reverse to preference the order of the original list. e.g.,
| merge_dicts([a, b]) will preference the keys in 'a' over those in 'b'.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
class Index(builtins.object)
| Methods defined here:
|
| __eq__(self, other)
| Return self==value.
|
| __init__(self, *, fields=[], name=None, db_tablespace=None)
| Initialize self. See help(type(self)) for accurate signature.
|
| __repr__(self)
| Return repr(self).
|
| check_name(self)
|
| clone(self)
| Create a copy of this Index.
|
| create_sql(self, model, schema_editor, using='')
|
| deconstruct(self)
|
| remove_sql(self, model, schema_editor)
|
| set_name_with_model(self, model)
| Generate a unique name for the index.
|
| The name is divided into 3 parts - table name (12 chars), field name
| (8 chars) and unique hash + suffix (10 chars). Each part is made to
| fit its size by truncating the excess length.
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| __hash__ = None
|
| max_name_length = 30
|
| suffix = 'idx'
class IntegerField(Field)
| Base class for all field types
|
| Method resolution order:
| IntegerField
| Field
| django.db.models.query_utils.RegisterLookupMixin
| builtins.object
|
| Methods defined here:
|
| check(self, **kwargs)
|
| formfield(self, **kwargs)
| Return a django.forms.Field instance for this field.
|
| get_internal_type(self)
|
| get_prep_value(self, value)
| Perform preliminary non-db specific value checks and conversions.
|
| to_python(self, value)
| Convert the input value into the expected Python data type, raising
| django.core.exceptions.ValidationError if the data can't be converted.
| Return the converted value. Subclasses should override this.
|
| validators = <django.utils.functional.cached_property object>
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| class_lookups = {'gte': <class 'django.db.models.lookups.IntegerGreate...
|
| default_error_messages = {'invalid': "'%(value)s' value must be an int...
|
| description = 'Integer'
|
| empty_strings_allowed = False
|
| ----------------------------------------------------------------------
| Methods inherited from Field:
|
| __copy__(self)
|
| __deepcopy__(self, memodict)
|
| __eq__(self, other)
| Return self==value.
|
| __ge__(self, other, NotImplemented=NotImplemented)
| Return a >= b. Computed by @total_ordering from (not a < b).
|
| __gt__(self, other, NotImplemented=NotImplemented)
| Return a > b. Computed by @total_ordering from (not a < b) and (a != b).
|
| __hash__(self)
| Return hash(self).
|
| __init__(self, verbose_name=None, name=None, primary_key=False, max_length=None, unique=False, blank=False, null=False, db_index=False, rel=None, default=<class 'django.db.models.fields.NOT_PROVIDED'>, editable=True, serialize=True, unique_for_date=None, unique_for_month=None, unique_for_year=None, choices=None, help_text='', db_column=None, db_tablespace=None, auto_created=False, validators=(), error_messages=None)
| Initialize self. See help(type(self)) for accurate signature.
|
| __le__(self, other, NotImplemented=NotImplemented)
| Return a <= b. Computed by @total_ordering from (a < b) or (a == b).
|
| __lt__(self, other)
| Return self<value.
|
| __reduce__(self)
| Pickling should return the model._meta.fields instance of the field,
| not a new copy of that field. So, use the app registry to load the
| model and then the field back.
|
| __repr__(self)
| Display the module, class, and name of the field.
|
| __str__(self)
| Return "app_label.model_label.field_name" for fields attached to
| models.
|
| cached_col = <django.utils.functional.cached_property object>
| cast_db_type(self, connection)
| Return the data type to use in the Cast() function.
|
| clean(self, value, model_instance)
| Convert the value's type and run validation. Validation errors
| from to_python() and validate() are propagated. Return the correct
| value if no error is raised.
|
| clone(self)
| Uses deconstruct() to clone a new copy of this Field.
| Will not preserve any class attachments/attribute names.
|
| contribute_to_class(self, cls, name, private_only=False)
| Register the field with the model class it belongs to.
|
| If private_only is True, create a separate instance of this field
| for every subclass of cls, even if cls is not an abstract model.
|
| db_check(self, connection)
| Return the database column check constraint for this field, for the
| provided connection. Works the same way as db_type() for the case that
| get_internal_type() does not map to a preexisting model field.
|
| db_parameters(self, connection)
| Extension of db_type(), providing a range of different return values
| (type, checks). This will look at db_type(), allowing custom model
| fields to override it.
|
| db_type(self, connection)
| Return the database column data type for this field, for the provided
| connection.
|
| db_type_parameters(self, connection)
|
| db_type_suffix(self, connection)
|
| deconstruct(self)
| Return enough information to recreate the field as a 4-tuple:
|
| * The name of the field on the model, if contribute_to_class() has
| been run.
| * The import path of the field, including the class:e.g.
| django.db.models.IntegerField This should be the most portable
| version, so less specific may be better.
| * A list of positional arguments.
| * A dict of keyword arguments.
|
| Note that the positional or keyword arguments must contain values of
| the following types (including inner values of collection types):
|
| * None, bool, str, int, float, complex, set, frozenset, list, tuple,
| dict
| * UUID
| * datetime.datetime (naive), datetime.date
| * top-level classes, top-level functions - will be referenced by their
| full import path
| * Storage instances - these have their own deconstruct() method
|
| This is because the values here must be serialized into a text format
| (possibly new Python code, possibly JSON) and these are the only types
| with encoding handlers defined.
|
| There's no need to return the exact way the field was instantiated this
| time, just ensure that the resulting field is the same - prefer keyword
| arguments over positional ones, and omit parameters with their default
| values.
|
| get_attname(self)
|
| get_attname_column(self)
|
| get_choices(self, include_blank=True, blank_choice=[('', '---------')], limit_choices_to=None)
| Return choices with a default blank choices included, for use
| as <select> choices for this field.
|
| get_col(self, alias, output_field=None)
|
| get_db_converters(self, connection)
|
| get_db_prep_save(self, value, connection)
| Return field's value prepared for saving into a database.
|
| get_db_prep_value(self, value, connection, prepared=False)
| Return field's value prepared for interacting with the database backend.
|
| Used by the default implementations of get_db_prep_save().
|
| get_default(self)
| Return the default value for this field.
|
| get_filter_kwargs_for_object(self, obj)
| Return a dict that when passed as kwargs to self.model.filter(), would
| yield all instances having the same value for this field as obj has.
|
| get_pk_value_on_save(self, instance)
| Hook to generate new PK values on save. This method is called when
| saving instances with no primary key value set. If this method returns
| something else than None, then the returned value is used when saving
| the new instance.
|
| has_default(self)
| Return a boolean of whether this field has a default value.
|
| pre_save(self, model_instance, add)
| Return field's value just before saving.
|
| rel_db_type(self, connection)
| Return the data type that a related field pointing to this field should
| use. For example, this method is called by ForeignKey and OneToOneField
| to determine its data type.
|
| run_validators(self, value)
|
| save_form_data(self, instance, data)
|
| select_format(self, compiler, sql, params)
| Custom format for select clauses. For example, GIS columns need to be
| selected as AsText(table.col) on MySQL as the table.col data can't be
| used by Django.
|
| set_attributes_from_name(self, name)
|
| validate(self, value, model_instance)
| Validate value and raise ValidationError if necessary. Subclasses
| should override this to provide validation logic.
|
| value_from_object(self, obj)
| Return the value of this field in the given model instance.
|
| value_to_string(self, obj)
| Return a string value of this field from the passed obj.
| This is used by the serialization framework.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from Field:
|
| db_tablespace
|
| flatchoices
| Flattened version of choices tuple.
|
| unique
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from Field:
|
| auto_creation_counter = -11
|
| creation_counter = 58
|
| default_validators = []
|
| empty_values = [None, '', [], (), {}]
|
| hidden = False
|
| many_to_many = None
|
| many_to_one = None
|
| one_to_many = None
|
| one_to_one = None
|
| related_model = None
|
| system_check_deprecated_details = None
|
| system_check_removed_details = None
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| get_lookup(self, lookup_name)
|
| get_transform(self, lookup_name)
|
| ----------------------------------------------------------------------
| Class methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| get_lookups() from builtins.type
|
| register_lookup(lookup, lookup_name=None) from builtins.type
|
| ----------------------------------------------------------------------
| Static methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| merge_dicts(dicts)
| Merge dicts in reverse to preference the order of the original list. e.g.,
| merge_dicts([a, b]) will preference the keys in 'a' over those in 'b'.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
class Lookup(builtins.object)
| Methods defined here:
|
| __init__(self, lhs, rhs)
| Initialize self. See help(type(self)) for accurate signature.
|
| apply_bilateral_transforms(self, value)
|
| as_sql(self, compiler, connection)
|
| batch_process_rhs(self, compiler, connection, rhs=None)
|
| contains_aggregate = <django.utils.functional.cached_property object>
| contains_over_clause = <django.utils.functional.cached_property object>
| get_db_prep_lookup(self, value, connection)
|
| get_group_by_cols(self)
|
| get_prep_lookup(self)
|
| get_source_expressions(self)
|
| process_lhs(self, compiler, connection, lhs=None)
|
| process_rhs(self, compiler, connection)
|
| relabeled_clone(self, relabels)
|
| rhs_is_direct_value(self)
|
| set_source_expressions(self, new_exprs)
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
|
| is_summary
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| lookup_name = None
|
| prepare_rhs = True
class Manager(BaseManagerFromQuerySet)
| Method resolution order:
| Manager
| BaseManagerFromQuerySet
| BaseManager
| builtins.object
|
| Methods inherited from BaseManagerFromQuerySet:
|
| aggregate(self, *args, **kwargs)
| Return a dictionary containing the calculations (aggregation)
| over the current queryset.
|
| If args is present the expression is passed as a kwarg using
| the Aggregate object's default alias.
|
| annotate(self, *args, **kwargs)
| Return a query set in which the returned objects have been annotated
| with extra data or aggregations.
|
| bulk_create(self, *args, **kwargs)
| Insert each of the instances into the database. Do *not* call
| save() on each of the instances, do not send any pre/post_save
| signals, and do not set the primary key attribute if it is an
| autoincrement field (except if features.can_return_ids_from_bulk_insert=True).
| Multi-table models are not supported.
|
| complex_filter(self, *args, **kwargs)
| Return a new QuerySet instance with filter_obj added to the filters.
|
| filter_obj can be a Q object or a dictionary of keyword lookup
| arguments.
|
| This exists to support framework features such as 'limit_choices_to',
| and usually it will be more natural to use other methods.
|
| count(self, *args, **kwargs)
| Perform a SELECT COUNT() and return the number of records as an
| integer.
|
| If the QuerySet is already fully cached, return the length of the
| cached results set to avoid multiple SELECT COUNT(*) calls.
|
| create(self, *args, **kwargs)
| Create a new object with the given kwargs, saving it to the database
| and returning the created object.
|
| dates(self, *args, **kwargs)
| Return a list of date objects representing all available dates for
| the given field_name, scoped to 'kind'.
|
| datetimes(self, *args, **kwargs)
| Return a list of datetime objects representing all available
| datetimes for the given field_name, scoped to 'kind'.
|
| defer(self, *args, **kwargs)
| Defer the loading of data for certain fields until they are accessed.
| Add the set of deferred fields to any existing set of deferred fields.
| The only exception to this is if None is passed in as the only
| parameter, in which case removal all deferrals.
|
| difference(self, *args, **kwargs)
|
| distinct(self, *args, **kwargs)
| Return a new QuerySet instance that will select only distinct results.
|
| earliest(self, *args, **kwargs)
|
| exclude(self, *args, **kwargs)
| Return a new QuerySet instance with NOT (args) ANDed to the existing
| set.
|
| exists(self, *args, **kwargs)
|
| extra(self, *args, **kwargs)
| Add extra SQL fragments to the query.
|
| filter(self, *args, **kwargs)
| Return a new QuerySet instance with the args ANDed to the existing
| set.
|
| first(self, *args, **kwargs)
| Return the first object of a query or None if no match is found.
|
| get(self, *args, **kwargs)
| Perform the query and return a single object matching the given
| keyword arguments.
|
| get_or_create(self, *args, **kwargs)
| Look up an object with the given kwargs, creating one if necessary.
| Return a tuple of (object, created), where created is a boolean
| specifying whether an object was created.
|
| in_bulk(self, *args, **kwargs)
| Return a dictionary mapping each of the given IDs to the object with
| that ID. If `id_list` isn't provided, evaluate the entire QuerySet.
|
| intersection(self, *args, **kwargs)
|
| iterator(self, *args, **kwargs)
| An iterator over the results from applying this QuerySet to the
| database.
|
| last(self, *args, **kwargs)
| Return the last object of a query or None if no match is found.
|
| latest(self, *args, **kwargs)
|
| none(self, *args, **kwargs)
| Return an empty QuerySet.
|
| only(self, *args, **kwargs)
| Essentially, the opposite of defer(). Only the fields passed into this
| method and that are not already specified as deferred are loaded
| immediately when the queryset is evaluated.
|
| order_by(self, *args, **kwargs)
| Return a new QuerySet instance with the ordering changed.
|
| prefetch_related(self, *args, **kwargs)
| Return a new QuerySet instance that will prefetch the specified
| Many-To-One and Many-To-Many related objects when the QuerySet is
| evaluated.
|
| When prefetch_related() is called more than once, append to the list of
| prefetch lookups. If prefetch_related(None) is called, clear the list.
|
| raw(self, *args, **kwargs)
|
| reverse(self, *args, **kwargs)
| Reverse the ordering of the QuerySet.
|
| select_for_update(self, *args, **kwargs)
| Return a new QuerySet instance that will select objects with a
| FOR UPDATE lock.
|
| select_related(self, *args, **kwargs)
| Return a new QuerySet instance that will select related objects.
|
| If fields are specified, they must be ForeignKey fields and only those
| related objects are included in the selection.
|
| If select_related(None) is called, clear the list.
|
| union(self, *args, **kwargs)
|
| update(self, *args, **kwargs)
| Update all elements in the current QuerySet, setting all the given
| fields to the appropriate values.
|
| update_or_create(self, *args, **kwargs)
| Look up an object with the given kwargs, updating one with defaults
| if it exists, otherwise create a new one.
| Return a tuple (object, created), where created is a boolean
| specifying whether an object was created.
|
| using(self, *args, **kwargs)
| Select which database this QuerySet should execute against.
|
| values(self, *args, **kwargs)
|
| values_list(self, *args, **kwargs)
|
| ----------------------------------------------------------------------
| Methods inherited from BaseManager:
|
| __eq__(self, other)
| Return self==value.
|
| __hash__(self)
| Return hash(self).
|
| __init__(self)
| Initialize self. See help(type(self)) for accurate signature.
|
| __str__(self)
| Return "app_label.model_label.manager_name".
|
| all(self)
|
| check(self, **kwargs)
|
| contribute_to_class(self, model, name)
|
| db_manager(self, using=None, hints=None)
|
| deconstruct(self)
| Return a 5-tuple of the form (as_manager (True), manager_class,
| queryset_class, args, kwargs).
|
| Raise a ValueError if the manager is dynamically generated.
|
| get_queryset(self)
| Return a new QuerySet object. Subclasses can override this method to
| customize the behavior of the Manager.
|
| ----------------------------------------------------------------------
| Class methods inherited from BaseManager:
|
| from_queryset(queryset_class, class_name=None) from builtins.type
|
| ----------------------------------------------------------------------
| Static methods inherited from BaseManager:
|
| __new__(cls, *args, **kwargs)
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from BaseManager:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
|
| db
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from BaseManager:
|
| auto_created = False
|
| creation_counter = 14
|
| use_in_migrations = False
class ManyToManyField(RelatedField)
| Provide a many-to-many relation by using an intermediary model that
| holds two ForeignKey fields pointed at the two sides of the relation.
|
| Unless a ``through`` model was provided, ManyToManyField will use the
| create_many_to_many_intermediary_model factory to automatically generate
| the intermediary model.
|
| Method resolution order:
| ManyToManyField
| RelatedField
| django.db.models.fields.mixins.FieldCacheMixin
| django.db.models.fields.Field
| django.db.models.query_utils.RegisterLookupMixin
| builtins.object
|
| Methods defined here:
|
| __init__(self, to, related_name=None, related_query_name=None, limit_choices_to=None, symmetrical=None, through=None, through_fields=None, db_constraint=True, db_table=None, swappable=True, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| check(self, **kwargs)
|
| contribute_to_class(self, cls, name, **kwargs)
| Register the field with the model class it belongs to.
|
| If private_only is True, create a separate instance of this field
| for every subclass of cls, even if cls is not an abstract model.
|
| contribute_to_related_class(self, cls, related)
|
| db_check(self, connection)
| Return the database column check constraint for this field, for the
| provided connection. Works the same way as db_type() for the case that
| get_internal_type() does not map to a preexisting model field.
|
| db_parameters(self, connection)
| Extension of db_type(), providing a range of different return values
| (type, checks). This will look at db_type(), allowing custom model
| fields to override it.
|
| db_type(self, connection)
| Return the database column data type for this field, for the provided
| connection.
|
| deconstruct(self)
| Return enough information to recreate the field as a 4-tuple:
|
| * The name of the field on the model, if contribute_to_class() has
| been run.
| * The import path of the field, including the class:e.g.
| django.db.models.IntegerField This should be the most portable
| version, so less specific may be better.
| * A list of positional arguments.
| * A dict of keyword arguments.
|
| Note that the positional or keyword arguments must contain values of
| the following types (including inner values of collection types):
|
| * None, bool, str, int, float, complex, set, frozenset, list, tuple,
| dict
| * UUID
| * datetime.datetime (naive), datetime.date
| * top-level classes, top-level functions - will be referenced by their
| full import path
| * Storage instances - these have their own deconstruct() method
|
| This is because the values here must be serialized into a text format
| (possibly new Python code, possibly JSON) and these are the only types
| with encoding handlers defined.
|
| There's no need to return the exact way the field was instantiated this
| time, just ensure that the resulting field is the same - prefer keyword
| arguments over positional ones, and omit parameters with their default
| values.
|
| formfield(self, *, using=None, **kwargs)
| Pass ``limit_choices_to`` to the field being constructed.
|
| Only passes it if there is a type that supports related fields.
| This is a similar strategy used to pass the ``queryset`` to the field
| being constructed.
|
| get_path_info(self, filtered_relation=None)
|
| get_reverse_path_info(self, filtered_relation=None)
|
| save_form_data(self, instance, data)
|
| set_attributes_from_rel(self)
|
| value_from_object(self, obj)
| Return the value of this field in the given model instance.
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| description = 'Many-to-many relationship'
|
| many_to_many = True
|
| many_to_one = False
|
| one_to_many = False
|
| one_to_one = False
|
| rel_class = <class 'django.db.models.fields.reverse_related.ManyToMany...
| Used by ManyToManyField to store information about the relation.
|
| ``_meta.get_fields()`` returns this class to provide access to the field
| flags for the reverse relation.
|
| ----------------------------------------------------------------------
| Methods inherited from RelatedField:
|
| do_related_class(self, other, cls)
|
| get_cache_name(self)
|
| get_forward_related_filter(self, obj)
| Return the keyword arguments that when supplied to
| self.model.object.filter(), would select all instances related through
| this field to the remote obj. This is used to build the querysets
| returned by related descriptors. obj is an instance of
| self.related_field.model.
|
| get_limit_choices_to(self)
| Return ``limit_choices_to`` for this model field.
|
| If it is a callable, it will be invoked and the result will be
| returned.
|
| get_reverse_related_filter(self, obj)
| Complement to get_forward_related_filter(). Return the keyword
| arguments that when passed to self.related_field.model.object.filter()
| select all instances of self.related_field.model related through
| this field to obj. obj is an instance of self.model.
|
| related_model = <django.utils.functional.cached_property object>
| related_query_name(self)
| Define the name that can be used to identify this related object in a
| table-spanning query.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from RelatedField:
|
| swappable_setting
| Get the setting that this is powered from for swapping, or None
| if it's not swapped in / marked with swappable=False.
|
| target_field
| When filtering against this relation, return the field on the remote
| model against which the filtering should happen.
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.fields.mixins.FieldCacheMixin:
|
| delete_cached_value(self, instance)
|
| get_cached_value(self, instance, default=<object object at 0x0000020722069580>)
|
| is_cached(self, instance)
|
| set_cached_value(self, instance, value)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from django.db.models.fields.mixins.FieldCacheMixin:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.fields.Field:
|
| __copy__(self)
|
| __deepcopy__(self, memodict)
|
| __eq__(self, other)
| Return self==value.
|
| __ge__(self, other, NotImplemented=NotImplemented)
| Return a >= b. Computed by @total_ordering from (not a < b).
|
| __gt__(self, other, NotImplemented=NotImplemented)
| Return a > b. Computed by @total_ordering from (not a < b) and (a != b).
|
| __hash__(self)
| Return hash(self).
|
| __le__(self, other, NotImplemented=NotImplemented)
| Return a <= b. Computed by @total_ordering from (a < b) or (a == b).
|
| __lt__(self, other)
| Return self<value.
|
| __reduce__(self)
| Pickling should return the model._meta.fields instance of the field,
| not a new copy of that field. So, use the app registry to load the
| model and then the field back.
|
| __repr__(self)
| Display the module, class, and name of the field.
|
| __str__(self)
| Return "app_label.model_label.field_name" for fields attached to
| models.
|
| cached_col = <django.utils.functional.cached_property object>
| cast_db_type(self, connection)
| Return the data type to use in the Cast() function.
|
| clean(self, value, model_instance)
| Convert the value's type and run validation. Validation errors
| from to_python() and validate() are propagated. Return the correct
| value if no error is raised.
|
| clone(self)
| Uses deconstruct() to clone a new copy of this Field.
| Will not preserve any class attachments/attribute names.
|
| db_type_parameters(self, connection)
|
| db_type_suffix(self, connection)
|
| get_attname(self)
|
| get_attname_column(self)
|
| get_choices(self, include_blank=True, blank_choice=[('', '---------')], limit_choices_to=None)
| Return choices with a default blank choices included, for use
| as <select> choices for this field.
|
| get_col(self, alias, output_field=None)
|
| get_db_converters(self, connection)
|
| get_db_prep_save(self, value, connection)
| Return field's value prepared for saving into a database.
|
| get_db_prep_value(self, value, connection, prepared=False)
| Return field's value prepared for interacting with the database backend.
|
| Used by the default implementations of get_db_prep_save().
|
| get_default(self)
| Return the default value for this field.
|
| get_filter_kwargs_for_object(self, obj)
| Return a dict that when passed as kwargs to self.model.filter(), would
| yield all instances having the same value for this field as obj has.
|
| get_internal_type(self)
|
| get_pk_value_on_save(self, instance)
| Hook to generate new PK values on save. This method is called when
| saving instances with no primary key value set. If this method returns
| something else than None, then the returned value is used when saving
| the new instance.
|
| get_prep_value(self, value)
| Perform preliminary non-db specific value checks and conversions.
|
| has_default(self)
| Return a boolean of whether this field has a default value.
|
| pre_save(self, model_instance, add)
| Return field's value just before saving.
|
| rel_db_type(self, connection)
| Return the data type that a related field pointing to this field should
| use. For example, this method is called by ForeignKey and OneToOneField
| to determine its data type.
|
| run_validators(self, value)
|
| select_format(self, compiler, sql, params)
| Custom format for select clauses. For example, GIS columns need to be
| selected as AsText(table.col) on MySQL as the table.col data can't be
| used by Django.
|
| set_attributes_from_name(self, name)
|
| to_python(self, value)
| Convert the input value into the expected Python data type, raising
| django.core.exceptions.ValidationError if the data can't be converted.
| Return the converted value. Subclasses should override this.
|
| validate(self, value, model_instance)
| Validate value and raise ValidationError if necessary. Subclasses
| should override this to provide validation logic.
|
| validators = <django.utils.functional.cached_property object>
| value_to_string(self, obj)
| Return a string value of this field from the passed obj.
| This is used by the serialization framework.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from django.db.models.fields.Field:
|
| db_tablespace
|
| flatchoices
| Flattened version of choices tuple.
|
| unique
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from django.db.models.fields.Field:
|
| auto_creation_counter = -11
|
| class_lookups = {'contains': <class 'django.db.models.lookups.Contains...
|
| creation_counter = 58
|
| default_error_messages = {'blank': 'This field cannot be blank.', 'inv...
|
| default_validators = []
|
| empty_strings_allowed = True
|
| empty_values = [None, '', [], (), {}]
|
| hidden = False
|
| system_check_deprecated_details = None
|
| system_check_removed_details = None
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| get_lookup(self, lookup_name)
|
| get_transform(self, lookup_name)
|
| ----------------------------------------------------------------------
| Class methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| get_lookups() from builtins.type
|
| register_lookup(lookup, lookup_name=None) from builtins.type
|
| ----------------------------------------------------------------------
| Static methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| merge_dicts(dicts)
| Merge dicts in reverse to preference the order of the original list. e.g.,
| merge_dicts([a, b]) will preference the keys in 'a' over those in 'b'.
class ManyToManyRel(ForeignObjectRel)
| Used by ManyToManyField to store information about the relation.
|
| ``_meta.get_fields()`` returns this class to provide access to the field
| flags for the reverse relation.
|
| Method resolution order:
| ManyToManyRel
| ForeignObjectRel
| django.db.models.fields.mixins.FieldCacheMixin
| builtins.object
|
| Methods defined here:
|
| __init__(self, field, to, related_name=None, related_query_name=None, limit_choices_to=None, symmetrical=True, through=None, through_fields=None, db_constraint=True)
| Initialize self. See help(type(self)) for accurate signature.
|
| get_related_field(self)
| Return the field in the 'to' object to which this relationship is tied.
| Provided for symmetry with ManyToOneRel.
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| __slotnames__ = []
|
| ----------------------------------------------------------------------
| Methods inherited from ForeignObjectRel:
|
| __repr__(self)
| Return repr(self).
|
| get_accessor_name(self, model=None)
|
| get_cache_name(self)
| Return the name of the cache key to use for storing an instance of the
| forward model on the reverse model.
|
| get_choices(self, include_blank=True, blank_choice=[('', '---------')])
| Return choices with a default blank choices included, for use
| as <select> choices for this field.
|
| Analog of django.db.models.fields.Field.get_choices(), provided
| initially for utilization by RelatedFieldListFilter.
|
| get_extra_restriction(self, where_class, alias, related_alias)
|
| get_internal_type(self)
|
| get_joining_columns(self)
|
| get_lookup(self, lookup_name)
|
| get_path_info(self, filtered_relation=None)
|
| hidden = <django.utils.functional.cached_property object>
| is_hidden(self)
| Should the related object be hidden?
|
| many_to_many = <django.utils.functional.cached_property object>
| many_to_one = <django.utils.functional.cached_property object>
| name = <django.utils.functional.cached_property object>
| one_to_many = <django.utils.functional.cached_property object>
| one_to_one = <django.utils.functional.cached_property object>
| related_model = <django.utils.functional.cached_property object>
| set_field_name(self)
| Set the related field's name, this is not available until later stages
| of app loading, so set_field_name is called from
| set_attributes_from_rel()
|
| ----------------------------------------------------------------------
| Data descriptors inherited from ForeignObjectRel:
|
| db_type
|
| remote_field
|
| target_field
| When filtering against this relation, return the field on the remote
| model against which the filtering should happen.
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from ForeignObjectRel:
|
| auto_created = True
|
| concrete = False
|
| editable = False
|
| is_relation = True
|
| null = True
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.fields.mixins.FieldCacheMixin:
|
| delete_cached_value(self, instance)
|
| get_cached_value(self, instance, default=<object object at 0x0000020722069580>)
|
| is_cached(self, instance)
|
| set_cached_value(self, instance, value)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from django.db.models.fields.mixins.FieldCacheMixin:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
class ManyToOneRel(ForeignObjectRel)
| Used by the ForeignKey field to store information about the relation.
|
| ``_meta.get_fields()`` returns this class to provide access to the field
| flags for the reverse relation.
|
| Note: Because we somewhat abuse the Rel objects by using them as reverse
| fields we get the funny situation where
| ``ManyToOneRel.many_to_one == False`` and
| ``ManyToOneRel.one_to_many == True``. This is unfortunate but the actual
| ManyToOneRel class is a private API and there is work underway to turn
| reverse relations into actual fields.
|
| Method resolution order:
| ManyToOneRel
| ForeignObjectRel
| django.db.models.fields.mixins.FieldCacheMixin
| builtins.object
|
| Methods defined here:
|
| __getstate__(self)
|
| __init__(self, field, to, field_name, related_name=None, related_query_name=None, limit_choices_to=None, parent_link=False, on_delete=None)
| Initialize self. See help(type(self)) for accurate signature.
|
| get_related_field(self)
| Return the Field in the 'to' object to which this relationship is tied.
|
| set_field_name(self)
| Set the related field's name, this is not available until later stages
| of app loading, so set_field_name is called from
| set_attributes_from_rel()
|
| ----------------------------------------------------------------------
| Methods inherited from ForeignObjectRel:
|
| __repr__(self)
| Return repr(self).
|
| get_accessor_name(self, model=None)
|
| get_cache_name(self)
| Return the name of the cache key to use for storing an instance of the
| forward model on the reverse model.
|
| get_choices(self, include_blank=True, blank_choice=[('', '---------')])
| Return choices with a default blank choices included, for use
| as <select> choices for this field.
|
| Analog of django.db.models.fields.Field.get_choices(), provided
| initially for utilization by RelatedFieldListFilter.
|
| get_extra_restriction(self, where_class, alias, related_alias)
|
| get_internal_type(self)
|
| get_joining_columns(self)
|
| get_lookup(self, lookup_name)
|
| get_path_info(self, filtered_relation=None)
|
| hidden = <django.utils.functional.cached_property object>
| is_hidden(self)
| Should the related object be hidden?
|
| many_to_many = <django.utils.functional.cached_property object>
| many_to_one = <django.utils.functional.cached_property object>
| name = <django.utils.functional.cached_property object>
| one_to_many = <django.utils.functional.cached_property object>
| one_to_one = <django.utils.functional.cached_property object>
| related_model = <django.utils.functional.cached_property object>
| ----------------------------------------------------------------------
| Data descriptors inherited from ForeignObjectRel:
|
| db_type
|
| remote_field
|
| target_field
| When filtering against this relation, return the field on the remote
| model against which the filtering should happen.
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from ForeignObjectRel:
|
| auto_created = True
|
| concrete = False
|
| editable = False
|
| is_relation = True
|
| null = True
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.fields.mixins.FieldCacheMixin:
|
| delete_cached_value(self, instance)
|
| get_cached_value(self, instance, default=<object object at 0x0000020722069580>)
|
| is_cached(self, instance)
|
| set_cached_value(self, instance, value)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from django.db.models.fields.mixins.FieldCacheMixin:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
class Max(Aggregate)
| An SQL function call.
|
| Method resolution order:
| Max
| Aggregate
| django.db.models.expressions.Func
| django.db.models.expressions.SQLiteNumericMixin
| django.db.models.expressions.Expression
| django.db.models.expressions.BaseExpression
| django.db.models.expressions.Combinable
| builtins.object
|
| Data and other attributes defined here:
|
| function = 'MAX'
|
| name = 'Max'
|
| ----------------------------------------------------------------------
| Methods inherited from Aggregate:
|
| __init__(self, *args, filter=None, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| as_sql(self, compiler, connection, **extra_context)
| Responsible for returning a (sql, [params]) tuple to be included
| in the current query.
|
| Different backends can provide their own implementation, by
| providing an `as_{vendor}` method and patching the Expression:
|
| ```
| def override_as_sql(self, compiler, connection):
| # custom logic
| return super().as_sql(compiler, connection)
| setattr(Expression, 'as_' + connection.vendor, override_as_sql)
| ```
|
| Arguments:
| * compiler: the query compiler responsible for generating the query.
| Must have a compile method, returning a (sql, [params]) tuple.
| Calling compiler(value) will return a quoted `value`.
|
| * connection: the database connection used for the current query.
|
| Return: (sql, params)
| Where `sql` is a string containing ordered sql parameters to be
| replaced with the elements of the list `params`.
|
| get_group_by_cols(self)
|
| get_source_expressions(self)
|
| get_source_fields(self)
| Return the underlying field types used by this aggregate.
|
| resolve_expression(self, query=None, allow_joins=True, reuse=None, summarize=False, for_save=False)
| Provide the chance to do any preprocessing or validation before being
| added to the query.
|
| Arguments:
| * query: the backend query implementation
| * allow_joins: boolean allowing or denying use of joins
| in this query
| * reuse: a set of reusable joins for multijoins
| * summarize: a terminal aggregate clause
| * for_save: whether this expression about to be used in a save or update
|
| Return: an Expression to be added to the query.
|
| set_source_expressions(self, exprs)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from Aggregate:
|
| default_alias
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from Aggregate:
|
| contains_aggregate = True
|
| filter_template = '%s FILTER (WHERE %%(filter)s)'
|
| window_compatible = True
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.expressions.Func:
|
| __repr__(self)
| Return repr(self).
|
| copy(self)
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from django.db.models.expressions.Func:
|
| arg_joiner = ', '
|
| arity = None
|
| template = '%(function)s(%(expressions)s)'
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.expressions.SQLiteNumericMixin:
|
| as_sqlite(self, compiler, connection, **extra_context)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from django.db.models.expressions.SQLiteNumericMixin:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.expressions.BaseExpression:
|
| __eq__(self, other)
| Return self==value.
|
| __getstate__(self)
|
| __hash__(self)
| Return hash(self).
|
| asc(self, **kwargs)
|
| contains_column_references = <django.utils.functional.cached_property object>
| contains_over_clause = <django.utils.functional.cached_property object>
| convert_value = <django.utils.functional.cached_property object>
| deconstruct(obj)
| Return a 3-tuple of class import path, positional arguments,
| and keyword arguments.
|
| desc(self, **kwargs)
|
| flatten(self)
| Recursively yield this expression and all subexpressions, in
| depth-first order.
|
| get_db_converters(self, connection)
|
| get_lookup(self, lookup)
|
| get_transform(self, name)
|
| output_field = <django.utils.functional.cached_property object>
| relabeled_clone(self, change_map)
|
| reverse_ordering(self)
|
| ----------------------------------------------------------------------
| Static methods inherited from django.db.models.expressions.BaseExpression:
|
| __new__(cls, *args, **kwargs)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from django.db.models.expressions.BaseExpression:
|
| field
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from django.db.models.expressions.BaseExpression:
|
| filterable = True
|
| is_summary = False
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.expressions.Combinable:
|
| __add__(self, other)
|
| __and__(self, other)
|
| __mod__(self, other)
|
| __mul__(self, other)
|
| __or__(self, other)
|
| __pow__(self, other)
|
| __radd__(self, other)
|
| __rand__(self, other)
|
| __rmod__(self, other)
|
| __rmul__(self, other)
|
| __ror__(self, other)
|
| __rpow__(self, other)
|
| __rsub__(self, other)
|
| __rtruediv__(self, other)
|
| __sub__(self, other)
|
| __truediv__(self, other)
|
| bitand(self, other)
|
| bitleftshift(self, other)
|
| bitor(self, other)
|
| bitrightshift(self, other)
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from django.db.models.expressions.Combinable:
|
| ADD = '+'
|
| BITAND = '&'
|
| BITLEFTSHIFT = '<<'
|
| BITOR = '|'
|
| BITRIGHTSHIFT = '>>'
|
| DIV = '/'
|
| MOD = '%%'
|
| MUL = '*'
|
| POW = '^'
|
| SUB = '-'
class Min(Aggregate)
| An SQL function call.
|
| Method resolution order:
| Min
| Aggregate
| django.db.models.expressions.Func
| django.db.models.expressions.SQLiteNumericMixin
| django.db.models.expressions.Expression
| django.db.models.expressions.BaseExpression
| django.db.models.expressions.Combinable
| builtins.object
|
| Data and other attributes defined here:
|
| function = 'MIN'
|
| name = 'Min'
|
| ----------------------------------------------------------------------
| Methods inherited from Aggregate:
|
| __init__(self, *args, filter=None, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| as_sql(self, compiler, connection, **extra_context)
| Responsible for returning a (sql, [params]) tuple to be included
| in the current query.
|
| Different backends can provide their own implementation, by
| providing an `as_{vendor}` method and patching the Expression:
|
| ```
| def override_as_sql(self, compiler, connection):
| # custom logic
| return super().as_sql(compiler, connection)
| setattr(Expression, 'as_' + connection.vendor, override_as_sql)
| ```
|
| Arguments:
| * compiler: the query compiler responsible for generating the query.
| Must have a compile method, returning a (sql, [params]) tuple.
| Calling compiler(value) will return a quoted `value`.
|
| * connection: the database connection used for the current query.
|
| Return: (sql, params)
| Where `sql` is a string containing ordered sql parameters to be
| replaced with the elements of the list `params`.
|
| get_group_by_cols(self)
|
| get_source_expressions(self)
|
| get_source_fields(self)
| Return the underlying field types used by this aggregate.
|
| resolve_expression(self, query=None, allow_joins=True, reuse=None, summarize=False, for_save=False)
| Provide the chance to do any preprocessing or validation before being
| added to the query.
|
| Arguments:
| * query: the backend query implementation
| * allow_joins: boolean allowing or denying use of joins
| in this query
| * reuse: a set of reusable joins for multijoins
| * summarize: a terminal aggregate clause
| * for_save: whether this expression about to be used in a save or update
|
| Return: an Expression to be added to the query.
|
| set_source_expressions(self, exprs)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from Aggregate:
|
| default_alias
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from Aggregate:
|
| contains_aggregate = True
|
| filter_template = '%s FILTER (WHERE %%(filter)s)'
|
| window_compatible = True
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.expressions.Func:
|
| __repr__(self)
| Return repr(self).
|
| copy(self)
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from django.db.models.expressions.Func:
|
| arg_joiner = ', '
|
| arity = None
|
| template = '%(function)s(%(expressions)s)'
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.expressions.SQLiteNumericMixin:
|
| as_sqlite(self, compiler, connection, **extra_context)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from django.db.models.expressions.SQLiteNumericMixin:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.expressions.BaseExpression:
|
| __eq__(self, other)
| Return self==value.
|
| __getstate__(self)
|
| __hash__(self)
| Return hash(self).
|
| asc(self, **kwargs)
|
| contains_column_references = <django.utils.functional.cached_property object>
| contains_over_clause = <django.utils.functional.cached_property object>
| convert_value = <django.utils.functional.cached_property object>
| deconstruct(obj)
| Return a 3-tuple of class import path, positional arguments,
| and keyword arguments.
|
| desc(self, **kwargs)
|
| flatten(self)
| Recursively yield this expression and all subexpressions, in
| depth-first order.
|
| get_db_converters(self, connection)
|
| get_lookup(self, lookup)
|
| get_transform(self, name)
|
| output_field = <django.utils.functional.cached_property object>
| relabeled_clone(self, change_map)
|
| reverse_ordering(self)
|
| ----------------------------------------------------------------------
| Static methods inherited from django.db.models.expressions.BaseExpression:
|
| __new__(cls, *args, **kwargs)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from django.db.models.expressions.BaseExpression:
|
| field
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from django.db.models.expressions.BaseExpression:
|
| filterable = True
|
| is_summary = False
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.expressions.Combinable:
|
| __add__(self, other)
|
| __and__(self, other)
|
| __mod__(self, other)
|
| __mul__(self, other)
|
| __or__(self, other)
|
| __pow__(self, other)
|
| __radd__(self, other)
|
| __rand__(self, other)
|
| __rmod__(self, other)
|
| __rmul__(self, other)
|
| __ror__(self, other)
|
| __rpow__(self, other)
|
| __rsub__(self, other)
|
| __rtruediv__(self, other)
|
| __sub__(self, other)
|
| __truediv__(self, other)
|
| bitand(self, other)
|
| bitleftshift(self, other)
|
| bitor(self, other)
|
| bitrightshift(self, other)
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from django.db.models.expressions.Combinable:
|
| ADD = '+'
|
| BITAND = '&'
|
| BITLEFTSHIFT = '<<'
|
| BITOR = '|'
|
| BITRIGHTSHIFT = '>>'
|
| DIV = '/'
|
| MOD = '%%'
|
| MUL = '*'
|
| POW = '^'
|
| SUB = '-'
class Model(builtins.object)
| Methods defined here:
|
| __eq__(self, other)
| Return self==value.
|
| __getstate__(self)
| Hook to allow choosing the attributes to pickle.
|
| __hash__(self)
| Return hash(self).
|
| __init__(self, *args, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| __reduce__(self)
| helper for pickle
|
| __repr__(self)
| Return repr(self).
|
| __setstate__(self, state)
|
| __str__(self)
| Return str(self).
|
| clean(self)
| Hook for doing any extra model-wide validation after clean() has been
| called on every field by self.clean_fields. Any ValidationError raised
| by this method will not be associated with a particular field; it will
| have a special-case association with the field defined by NON_FIELD_ERRORS.
|
| clean_fields(self, exclude=None)
| Clean all fields and raise a ValidationError containing a dict
| of all validation errors if any occur.
|
| date_error_message(self, lookup_type, field_name, unique_for)
|
| delete(self, using=None, keep_parents=False)
|
| full_clean(self, exclude=None, validate_unique=True)
| Call clean_fields(), clean(), and validate_unique() on the model.
| Raise a ValidationError for any errors that occur.
|
| get_deferred_fields(self)
| Return a set containing names of deferred fields for this instance.
|
| prepare_database_save(self, field)
|
| refresh_from_db(self, using=None, fields=None)
| Reload field values from the database.
|
| By default, the reloading happens from the database this instance was
| loaded from, or by the read router if this instance wasn't loaded from
| any database. The using parameter will override the default.
|
| Fields can be used to specify which fields to reload. The fields
| should be an iterable of field attnames. If fields is None, then
| all non-deferred fields are reloaded.
|
| When accessing deferred fields of an instance, the deferred loading
| of the field will call this method.
|
| save(self, force_insert=False, force_update=False, using=None, update_fields=None)
| Save the current instance. Override this in a subclass if you want to
| control the saving process.
|
| The 'force_insert' and 'force_update' parameters can be used to insist
| that the "save" must be an SQL insert or update (or equivalent for
| non-SQL backends), respectively. Normally, they should not be set.
|
| save_base(self, raw=False, force_insert=False, force_update=False, using=None, update_fields=None)
| Handle the parts of saving which should be done only once per save,
| yet need to be done in raw saves, too. This includes some sanity
| checks and signal sending.
|
| The 'raw' argument is telling save_base not to save any parent
| models and not to do any changes to the values before save. This
| is used by fixture loading.
|
| serializable_value(self, field_name)
| Return the value of the field name for this instance. If the field is
| a foreign key, return the id value instead of the object. If there's
| no Field object with this name on the model, return the model
| attribute's value.
|
| Used to serialize a field's value (in the serializer, or form output,
| for example). Normally, you would just access the attribute directly
| and not use this method.
|
| unique_error_message(self, model_class, unique_check)
|
| validate_unique(self, exclude=None)
| Check unique constraints on the model and raise ValidationError if any
| failed.
|
| ----------------------------------------------------------------------
| Class methods defined here:
|
| check(**kwargs) from django.db.models.base.ModelBase
|
| from_db(db, field_names, values) from django.db.models.base.ModelBase
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
|
| pk
class NOT_PROVIDED(builtins.object)
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
class NullBooleanField(Field)
| Base class for all field types
|
| Method resolution order:
| NullBooleanField
| Field
| django.db.models.query_utils.RegisterLookupMixin
| builtins.object
|
| Methods defined here:
|
| __init__(self, *args, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| deconstruct(self)
| Return enough information to recreate the field as a 4-tuple:
|
| * The name of the field on the model, if contribute_to_class() has
| been run.
| * The import path of the field, including the class:e.g.
| django.db.models.IntegerField This should be the most portable
| version, so less specific may be better.
| * A list of positional arguments.
| * A dict of keyword arguments.
|
| Note that the positional or keyword arguments must contain values of
| the following types (including inner values of collection types):
|
| * None, bool, str, int, float, complex, set, frozenset, list, tuple,
| dict
| * UUID
| * datetime.datetime (naive), datetime.date
| * top-level classes, top-level functions - will be referenced by their
| full import path
| * Storage instances - these have their own deconstruct() method
|
| This is because the values here must be serialized into a text format
| (possibly new Python code, possibly JSON) and these are the only types
| with encoding handlers defined.
|
| There's no need to return the exact way the field was instantiated this
| time, just ensure that the resulting field is the same - prefer keyword
| arguments over positional ones, and omit parameters with their default
| values.
|
| formfield(self, **kwargs)
| Return a django.forms.Field instance for this field.
|
| get_internal_type(self)
|
| get_prep_value(self, value)
| Perform preliminary non-db specific value checks and conversions.
|
| to_python(self, value)
| Convert the input value into the expected Python data type, raising
| django.core.exceptions.ValidationError if the data can't be converted.
| Return the converted value. Subclasses should override this.
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| default_error_messages = {'invalid': "'%(value)s' value must be either...
|
| description = 'Boolean (Either True, False or None)'
|
| empty_strings_allowed = False
|
| ----------------------------------------------------------------------
| Methods inherited from Field:
|
| __copy__(self)
|
| __deepcopy__(self, memodict)
|
| __eq__(self, other)
| Return self==value.
|
| __ge__(self, other, NotImplemented=NotImplemented)
| Return a >= b. Computed by @total_ordering from (not a < b).
|
| __gt__(self, other, NotImplemented=NotImplemented)
| Return a > b. Computed by @total_ordering from (not a < b) and (a != b).
|
| __hash__(self)
| Return hash(self).
|
| __le__(self, other, NotImplemented=NotImplemented)
| Return a <= b. Computed by @total_ordering from (a < b) or (a == b).
|
| __lt__(self, other)
| Return self<value.
|
| __reduce__(self)
| Pickling should return the model._meta.fields instance of the field,
| not a new copy of that field. So, use the app registry to load the
| model and then the field back.
|
| __repr__(self)
| Display the module, class, and name of the field.
|
| __str__(self)
| Return "app_label.model_label.field_name" for fields attached to
| models.
|
| cached_col = <django.utils.functional.cached_property object>
| cast_db_type(self, connection)
| Return the data type to use in the Cast() function.
|
| check(self, **kwargs)
|
| clean(self, value, model_instance)
| Convert the value's type and run validation. Validation errors
| from to_python() and validate() are propagated. Return the correct
| value if no error is raised.
|
| clone(self)
| Uses deconstruct() to clone a new copy of this Field.
| Will not preserve any class attachments/attribute names.
|
| contribute_to_class(self, cls, name, private_only=False)
| Register the field with the model class it belongs to.
|
| If private_only is True, create a separate instance of this field
| for every subclass of cls, even if cls is not an abstract model.
|
| db_check(self, connection)
| Return the database column check constraint for this field, for the
| provided connection. Works the same way as db_type() for the case that
| get_internal_type() does not map to a preexisting model field.
|
| db_parameters(self, connection)
| Extension of db_type(), providing a range of different return values
| (type, checks). This will look at db_type(), allowing custom model
| fields to override it.
|
| db_type(self, connection)
| Return the database column data type for this field, for the provided
| connection.
|
| db_type_parameters(self, connection)
|
| db_type_suffix(self, connection)
|
| get_attname(self)
|
| get_attname_column(self)
|
| get_choices(self, include_blank=True, blank_choice=[('', '---------')], limit_choices_to=None)
| Return choices with a default blank choices included, for use
| as <select> choices for this field.
|
| get_col(self, alias, output_field=None)
|
| get_db_converters(self, connection)
|
| get_db_prep_save(self, value, connection)
| Return field's value prepared for saving into a database.
|
| get_db_prep_value(self, value, connection, prepared=False)
| Return field's value prepared for interacting with the database backend.
|
| Used by the default implementations of get_db_prep_save().
|
| get_default(self)
| Return the default value for this field.
|
| get_filter_kwargs_for_object(self, obj)
| Return a dict that when passed as kwargs to self.model.filter(), would
| yield all instances having the same value for this field as obj has.
|
| get_pk_value_on_save(self, instance)
| Hook to generate new PK values on save. This method is called when
| saving instances with no primary key value set. If this method returns
| something else than None, then the returned value is used when saving
| the new instance.
|
| has_default(self)
| Return a boolean of whether this field has a default value.
|
| pre_save(self, model_instance, add)
| Return field's value just before saving.
|
| rel_db_type(self, connection)
| Return the data type that a related field pointing to this field should
| use. For example, this method is called by ForeignKey and OneToOneField
| to determine its data type.
|
| run_validators(self, value)
|
| save_form_data(self, instance, data)
|
| select_format(self, compiler, sql, params)
| Custom format for select clauses. For example, GIS columns need to be
| selected as AsText(table.col) on MySQL as the table.col data can't be
| used by Django.
|
| set_attributes_from_name(self, name)
|
| validate(self, value, model_instance)
| Validate value and raise ValidationError if necessary. Subclasses
| should override this to provide validation logic.
|
| validators = <django.utils.functional.cached_property object>
| value_from_object(self, obj)
| Return the value of this field in the given model instance.
|
| value_to_string(self, obj)
| Return a string value of this field from the passed obj.
| This is used by the serialization framework.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from Field:
|
| db_tablespace
|
| flatchoices
| Flattened version of choices tuple.
|
| unique
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from Field:
|
| auto_creation_counter = -11
|
| class_lookups = {'contains': <class 'django.db.models.lookups.Contains...
|
| creation_counter = 58
|
| default_validators = []
|
| empty_values = [None, '', [], (), {}]
|
| hidden = False
|
| many_to_many = None
|
| many_to_one = None
|
| one_to_many = None
|
| one_to_one = None
|
| related_model = None
|
| system_check_deprecated_details = None
|
| system_check_removed_details = None
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| get_lookup(self, lookup_name)
|
| get_transform(self, lookup_name)
|
| ----------------------------------------------------------------------
| Class methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| get_lookups() from builtins.type
|
| register_lookup(lookup, lookup_name=None) from builtins.type
|
| ----------------------------------------------------------------------
| Static methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| merge_dicts(dicts)
| Merge dicts in reverse to preference the order of the original list. e.g.,
| merge_dicts([a, b]) will preference the keys in 'a' over those in 'b'.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
class ObjectDoesNotExist(builtins.Exception)
| The requested object does not exist
|
| Method resolution order:
| ObjectDoesNotExist
| builtins.Exception
| builtins.BaseException
| builtins.object
|
| Data descriptors defined here:
|
| __weakref__
| list of weak references to the object (if defined)
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| silent_variable_failure = True
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.Exception:
|
| __init__(self, /, *args, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| __new__(*args, **kwargs) from builtins.type
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.BaseException:
|
| __delattr__(self, name, /)
| Implement delattr(self, name).
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __reduce__(...)
| helper for pickle
|
| __repr__(self, /)
| Return repr(self).
|
| __setattr__(self, name, value, /)
| Implement setattr(self, name, value).
|
| __setstate__(...)
|
| __str__(self, /)
| Return str(self).
|
| with_traceback(...)
| Exception.with_traceback(tb) --
| set self.__traceback__ to tb and return self.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from builtins.BaseException:
|
| __cause__
| exception cause
|
| __context__
| exception context
|
| __dict__
|
| __suppress_context__
|
| __traceback__
|
| args
class OneToOneField(ForeignKey)
| A OneToOneField is essentially the same as a ForeignKey, with the exception
| that it always carries a "unique" constraint with it and the reverse
| relation always returns the object pointed to (since there will only ever
| be one), rather than returning a list.
|
| Method resolution order:
| OneToOneField
| ForeignKey
| ForeignObject
| RelatedField
| django.db.models.fields.mixins.FieldCacheMixin
| django.db.models.fields.Field
| django.db.models.query_utils.RegisterLookupMixin
| builtins.object
|
| Methods defined here:
|
| __init__(self, to, on_delete, to_field=None, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| deconstruct(self)
| Return enough information to recreate the field as a 4-tuple:
|
| * The name of the field on the model, if contribute_to_class() has
| been run.
| * The import path of the field, including the class:e.g.
| django.db.models.IntegerField This should be the most portable
| version, so less specific may be better.
| * A list of positional arguments.
| * A dict of keyword arguments.
|
| Note that the positional or keyword arguments must contain values of
| the following types (including inner values of collection types):
|
| * None, bool, str, int, float, complex, set, frozenset, list, tuple,
| dict
| * UUID
| * datetime.datetime (naive), datetime.date
| * top-level classes, top-level functions - will be referenced by their
| full import path
| * Storage instances - these have their own deconstruct() method
|
| This is because the values here must be serialized into a text format
| (possibly new Python code, possibly JSON) and these are the only types
| with encoding handlers defined.
|
| There's no need to return the exact way the field was instantiated this
| time, just ensure that the resulting field is the same - prefer keyword
| arguments over positional ones, and omit parameters with their default
| values.
|
| formfield(self, **kwargs)
| Pass ``limit_choices_to`` to the field being constructed.
|
| Only passes it if there is a type that supports related fields.
| This is a similar strategy used to pass the ``queryset`` to the field
| being constructed.
|
| save_form_data(self, instance, data)
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| description = 'One-to-one relationship'
|
| forward_related_accessor_class = <class 'django.db.models.fields.relat...
| Accessor to the related object on the forward side of a one-to-one relation.
|
| In the example::
|
| class Restaurant(Model):
| place = OneToOneField(Place, related_name='restaurant')
|
| ``Restaurant.place`` is a ``ForwardOneToOneDescriptor`` instance.
|
| many_to_many = False
|
| many_to_one = False
|
| one_to_many = False
|
| one_to_one = True
|
| rel_class = <class 'django.db.models.fields.reverse_related.OneToOneRe...
| Used by OneToOneField to store information about the relation.
|
| ``_meta.get_fields()`` returns this class to provide access to the field
| flags for the reverse relation.
|
| related_accessor_class = <class 'django.db.models.fields.related_descr...
| Accessor to the related object on the reverse side of a one-to-one
| relation.
|
| In the example::
|
| class Restaurant(Model):
| place = OneToOneField(Place, related_name='restaurant')
|
| ``Place.restaurant`` is a ``ReverseOneToOneDescriptor`` instance.
|
| ----------------------------------------------------------------------
| Methods inherited from ForeignKey:
|
| check(self, **kwargs)
|
| contribute_to_related_class(self, cls, related)
|
| convert_empty_strings(self, value, expression, connection)
|
| db_check(self, connection)
| Return the database column check constraint for this field, for the
| provided connection. Works the same way as db_type() for the case that
| get_internal_type() does not map to a preexisting model field.
|
| db_parameters(self, connection)
| Extension of db_type(), providing a range of different return values
| (type, checks). This will look at db_type(), allowing custom model
| fields to override it.
|
| db_type(self, connection)
| Return the database column data type for this field, for the provided
| connection.
|
| get_attname(self)
|
| get_attname_column(self)
|
| get_col(self, alias, output_field=None)
|
| get_db_converters(self, connection)
|
| get_db_prep_save(self, value, connection)
| Return field's value prepared for saving into a database.
|
| get_db_prep_value(self, value, connection, prepared=False)
| Return field's value prepared for interacting with the database backend.
|
| Used by the default implementations of get_db_prep_save().
|
| get_default(self)
| Return the to_field if the default value is an object.
|
| get_reverse_path_info(self, filtered_relation=None)
| Get path from the related model to this field's model.
|
| validate(self, value, model_instance)
| Validate value and raise ValidationError if necessary. Subclasses
| should override this to provide validation logic.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from ForeignKey:
|
| target_field
| When filtering against this relation, return the field on the remote
| model against which the filtering should happen.
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from ForeignKey:
|
| default_error_messages = {'invalid': '%(model)s instance with %(field)...
|
| empty_strings_allowed = False
|
| ----------------------------------------------------------------------
| Methods inherited from ForeignObject:
|
| contribute_to_class(self, cls, name, private_only=False, **kwargs)
| Register the field with the model class it belongs to.
|
| If private_only is True, create a separate instance of this field
| for every subclass of cls, even if cls is not an abstract model.
|
| get_extra_descriptor_filter(self, instance)
| Return an extra filter condition for related object fetching when
| user does 'instance.fieldname', that is the extra filter is used in
| the descriptor of the field.
|
| The filter should be either a dict usable in .filter(**kwargs) call or
| a Q-object. The condition will be ANDed together with the relation's
| joining columns.
|
| A parallel method is get_extra_restriction() which is used in
| JOIN and subquery conditions.
|
| get_extra_restriction(self, where_class, alias, related_alias)
| Return a pair condition used for joining and subquery pushdown. The
| condition is something that responds to as_sql(compiler, connection)
| method.
|
| Note that currently referring both the 'alias' and 'related_alias'
| will not work in some conditions, like subquery pushdown.
|
| A parallel method is get_extra_descriptor_filter() which is used in
| instance.fieldname related object fetching.
|
| get_foreign_related_value(self, instance)
|
| get_joining_columns(self, reverse_join=False)
|
| get_local_related_value(self, instance)
|
| get_path_info(self, filtered_relation=None)
| Get path from this field to the related model.
|
| get_reverse_joining_columns(self)
|
| resolve_related_fields(self)
|
| ----------------------------------------------------------------------
| Class methods inherited from ForeignObject:
|
| get_lookups() from builtins.type
|
| ----------------------------------------------------------------------
| Static methods inherited from ForeignObject:
|
| get_instance_value_for_fields(instance, fields)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from ForeignObject:
|
| foreign_related_fields
|
| local_related_fields
|
| related_fields
|
| reverse_related_fields
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from ForeignObject:
|
| class_lookups = {'exact': <class 'django.db.models.fields.related_look...
|
| requires_unique_target = True
|
| ----------------------------------------------------------------------
| Methods inherited from RelatedField:
|
| do_related_class(self, other, cls)
|
| get_cache_name(self)
|
| get_forward_related_filter(self, obj)
| Return the keyword arguments that when supplied to
| self.model.object.filter(), would select all instances related through
| this field to the remote obj. This is used to build the querysets
| returned by related descriptors. obj is an instance of
| self.related_field.model.
|
| get_limit_choices_to(self)
| Return ``limit_choices_to`` for this model field.
|
| If it is a callable, it will be invoked and the result will be
| returned.
|
| get_reverse_related_filter(self, obj)
| Complement to get_forward_related_filter(). Return the keyword
| arguments that when passed to self.related_field.model.object.filter()
| select all instances of self.related_field.model related through
| this field to obj. obj is an instance of self.model.
|
| related_model = <django.utils.functional.cached_property object>
| related_query_name(self)
| Define the name that can be used to identify this related object in a
| table-spanning query.
|
| set_attributes_from_rel(self)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from RelatedField:
|
| swappable_setting
| Get the setting that this is powered from for swapping, or None
| if it's not swapped in / marked with swappable=False.
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.fields.mixins.FieldCacheMixin:
|
| delete_cached_value(self, instance)
|
| get_cached_value(self, instance, default=<object object at 0x0000020722069580>)
|
| is_cached(self, instance)
|
| set_cached_value(self, instance, value)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from django.db.models.fields.mixins.FieldCacheMixin:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.fields.Field:
|
| __copy__(self)
|
| __deepcopy__(self, memodict)
|
| __eq__(self, other)
| Return self==value.
|
| __ge__(self, other, NotImplemented=NotImplemented)
| Return a >= b. Computed by @total_ordering from (not a < b).
|
| __gt__(self, other, NotImplemented=NotImplemented)
| Return a > b. Computed by @total_ordering from (not a < b) and (a != b).
|
| __hash__(self)
| Return hash(self).
|
| __le__(self, other, NotImplemented=NotImplemented)
| Return a <= b. Computed by @total_ordering from (a < b) or (a == b).
|
| __lt__(self, other)
| Return self<value.
|
| __reduce__(self)
| Pickling should return the model._meta.fields instance of the field,
| not a new copy of that field. So, use the app registry to load the
| model and then the field back.
|
| __repr__(self)
| Display the module, class, and name of the field.
|
| __str__(self)
| Return "app_label.model_label.field_name" for fields attached to
| models.
|
| cached_col = <django.utils.functional.cached_property object>
| cast_db_type(self, connection)
| Return the data type to use in the Cast() function.
|
| clean(self, value, model_instance)
| Convert the value's type and run validation. Validation errors
| from to_python() and validate() are propagated. Return the correct
| value if no error is raised.
|
| clone(self)
| Uses deconstruct() to clone a new copy of this Field.
| Will not preserve any class attachments/attribute names.
|
| db_type_parameters(self, connection)
|
| db_type_suffix(self, connection)
|
| get_choices(self, include_blank=True, blank_choice=[('', '---------')], limit_choices_to=None)
| Return choices with a default blank choices included, for use
| as <select> choices for this field.
|
| get_filter_kwargs_for_object(self, obj)
| Return a dict that when passed as kwargs to self.model.filter(), would
| yield all instances having the same value for this field as obj has.
|
| get_internal_type(self)
|
| get_pk_value_on_save(self, instance)
| Hook to generate new PK values on save. This method is called when
| saving instances with no primary key value set. If this method returns
| something else than None, then the returned value is used when saving
| the new instance.
|
| get_prep_value(self, value)
| Perform preliminary non-db specific value checks and conversions.
|
| has_default(self)
| Return a boolean of whether this field has a default value.
|
| pre_save(self, model_instance, add)
| Return field's value just before saving.
|
| rel_db_type(self, connection)
| Return the data type that a related field pointing to this field should
| use. For example, this method is called by ForeignKey and OneToOneField
| to determine its data type.
|
| run_validators(self, value)
|
| select_format(self, compiler, sql, params)
| Custom format for select clauses. For example, GIS columns need to be
| selected as AsText(table.col) on MySQL as the table.col data can't be
| used by Django.
|
| set_attributes_from_name(self, name)
|
| to_python(self, value)
| Convert the input value into the expected Python data type, raising
| django.core.exceptions.ValidationError if the data can't be converted.
| Return the converted value. Subclasses should override this.
|
| validators = <django.utils.functional.cached_property object>
| value_from_object(self, obj)
| Return the value of this field in the given model instance.
|
| value_to_string(self, obj)
| Return a string value of this field from the passed obj.
| This is used by the serialization framework.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from django.db.models.fields.Field:
|
| db_tablespace
|
| flatchoices
| Flattened version of choices tuple.
|
| unique
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from django.db.models.fields.Field:
|
| auto_creation_counter = -11
|
| creation_counter = 58
|
| default_validators = []
|
| empty_values = [None, '', [], (), {}]
|
| hidden = False
|
| system_check_deprecated_details = None
|
| system_check_removed_details = None
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| get_lookup(self, lookup_name)
|
| get_transform(self, lookup_name)
|
| ----------------------------------------------------------------------
| Class methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| register_lookup(lookup, lookup_name=None) from builtins.type
|
| ----------------------------------------------------------------------
| Static methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| merge_dicts(dicts)
| Merge dicts in reverse to preference the order of the original list. e.g.,
| merge_dicts([a, b]) will preference the keys in 'a' over those in 'b'.
class OneToOneRel(ManyToOneRel)
| Used by OneToOneField to store information about the relation.
|
| ``_meta.get_fields()`` returns this class to provide access to the field
| flags for the reverse relation.
|
| Method resolution order:
| OneToOneRel
| ManyToOneRel
| ForeignObjectRel
| django.db.models.fields.mixins.FieldCacheMixin
| builtins.object
|
| Methods defined here:
|
| __init__(self, field, to, field_name, related_name=None, related_query_name=None, limit_choices_to=None, parent_link=False, on_delete=None)
| Initialize self. See help(type(self)) for accurate signature.
|
| ----------------------------------------------------------------------
| Methods inherited from ManyToOneRel:
|
| __getstate__(self)
|
| get_related_field(self)
| Return the Field in the 'to' object to which this relationship is tied.
|
| set_field_name(self)
| Set the related field's name, this is not available until later stages
| of app loading, so set_field_name is called from
| set_attributes_from_rel()
|
| ----------------------------------------------------------------------
| Methods inherited from ForeignObjectRel:
|
| __repr__(self)
| Return repr(self).
|
| get_accessor_name(self, model=None)
|
| get_cache_name(self)
| Return the name of the cache key to use for storing an instance of the
| forward model on the reverse model.
|
| get_choices(self, include_blank=True, blank_choice=[('', '---------')])
| Return choices with a default blank choices included, for use
| as <select> choices for this field.
|
| Analog of django.db.models.fields.Field.get_choices(), provided
| initially for utilization by RelatedFieldListFilter.
|
| get_extra_restriction(self, where_class, alias, related_alias)
|
| get_internal_type(self)
|
| get_joining_columns(self)
|
| get_lookup(self, lookup_name)
|
| get_path_info(self, filtered_relation=None)
|
| hidden = <django.utils.functional.cached_property object>
| is_hidden(self)
| Should the related object be hidden?
|
| many_to_many = <django.utils.functional.cached_property object>
| many_to_one = <django.utils.functional.cached_property object>
| name = <django.utils.functional.cached_property object>
| one_to_many = <django.utils.functional.cached_property object>
| one_to_one = <django.utils.functional.cached_property object>
| related_model = <django.utils.functional.cached_property object>
| ----------------------------------------------------------------------
| Data descriptors inherited from ForeignObjectRel:
|
| db_type
|
| remote_field
|
| target_field
| When filtering against this relation, return the field on the remote
| model against which the filtering should happen.
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from ForeignObjectRel:
|
| auto_created = True
|
| concrete = False
|
| editable = False
|
| is_relation = True
|
| null = True
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.fields.mixins.FieldCacheMixin:
|
| delete_cached_value(self, instance)
|
| get_cached_value(self, instance, default=<object object at 0x0000020722069580>)
|
| is_cached(self, instance)
|
| set_cached_value(self, instance, value)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from django.db.models.fields.mixins.FieldCacheMixin:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
class OrderWrt(django.db.models.fields.IntegerField)
| A proxy for the _order database field that is used when
| Meta.order_with_respect_to is specified.
|
| Method resolution order:
| OrderWrt
| django.db.models.fields.IntegerField
| django.db.models.fields.Field
| django.db.models.query_utils.RegisterLookupMixin
| builtins.object
|
| Methods defined here:
|
| __init__(self, *args, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.fields.IntegerField:
|
| check(self, **kwargs)
|
| formfield(self, **kwargs)
| Return a django.forms.Field instance for this field.
|
| get_internal_type(self)
|
| get_prep_value(self, value)
| Perform preliminary non-db specific value checks and conversions.
|
| to_python(self, value)
| Convert the input value into the expected Python data type, raising
| django.core.exceptions.ValidationError if the data can't be converted.
| Return the converted value. Subclasses should override this.
|
| validators = <django.utils.functional.cached_property object>
| ----------------------------------------------------------------------
| Data and other attributes inherited from django.db.models.fields.IntegerField:
|
| class_lookups = {'gte': <class 'django.db.models.lookups.IntegerGreate...
|
| default_error_messages = {'invalid': "'%(value)s' value must be an int...
|
| description = 'Integer'
|
| empty_strings_allowed = False
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.fields.Field:
|
| __copy__(self)
|
| __deepcopy__(self, memodict)
|
| __eq__(self, other)
| Return self==value.
|
| __ge__(self, other, NotImplemented=NotImplemented)
| Return a >= b. Computed by @total_ordering from (not a < b).
|
| __gt__(self, other, NotImplemented=NotImplemented)
| Return a > b. Computed by @total_ordering from (not a < b) and (a != b).
|
| __hash__(self)
| Return hash(self).
|
| __le__(self, other, NotImplemented=NotImplemented)
| Return a <= b. Computed by @total_ordering from (a < b) or (a == b).
|
| __lt__(self, other)
| Return self<value.
|
| __reduce__(self)
| Pickling should return the model._meta.fields instance of the field,
| not a new copy of that field. So, use the app registry to load the
| model and then the field back.
|
| __repr__(self)
| Display the module, class, and name of the field.
|
| __str__(self)
| Return "app_label.model_label.field_name" for fields attached to
| models.
|
| cached_col = <django.utils.functional.cached_property object>
| cast_db_type(self, connection)
| Return the data type to use in the Cast() function.
|
| clean(self, value, model_instance)
| Convert the value's type and run validation. Validation errors
| from to_python() and validate() are propagated. Return the correct
| value if no error is raised.
|
| clone(self)
| Uses deconstruct() to clone a new copy of this Field.
| Will not preserve any class attachments/attribute names.
|
| contribute_to_class(self, cls, name, private_only=False)
| Register the field with the model class it belongs to.
|
| If private_only is True, create a separate instance of this field
| for every subclass of cls, even if cls is not an abstract model.
|
| db_check(self, connection)
| Return the database column check constraint for this field, for the
| provided connection. Works the same way as db_type() for the case that
| get_internal_type() does not map to a preexisting model field.
|
| db_parameters(self, connection)
| Extension of db_type(), providing a range of different return values
| (type, checks). This will look at db_type(), allowing custom model
| fields to override it.
|
| db_type(self, connection)
| Return the database column data type for this field, for the provided
| connection.
|
| db_type_parameters(self, connection)
|
| db_type_suffix(self, connection)
|
| deconstruct(self)
| Return enough information to recreate the field as a 4-tuple:
|
| * The name of the field on the model, if contribute_to_class() has
| been run.
| * The import path of the field, including the class:e.g.
| django.db.models.IntegerField This should be the most portable
| version, so less specific may be better.
| * A list of positional arguments.
| * A dict of keyword arguments.
|
| Note that the positional or keyword arguments must contain values of
| the following types (including inner values of collection types):
|
| * None, bool, str, int, float, complex, set, frozenset, list, tuple,
| dict
| * UUID
| * datetime.datetime (naive), datetime.date
| * top-level classes, top-level functions - will be referenced by their
| full import path
| * Storage instances - these have their own deconstruct() method
|
| This is because the values here must be serialized into a text format
| (possibly new Python code, possibly JSON) and these are the only types
| with encoding handlers defined.
|
| There's no need to return the exact way the field was instantiated this
| time, just ensure that the resulting field is the same - prefer keyword
| arguments over positional ones, and omit parameters with their default
| values.
|
| get_attname(self)
|
| get_attname_column(self)
|
| get_choices(self, include_blank=True, blank_choice=[('', '---------')], limit_choices_to=None)
| Return choices with a default blank choices included, for use
| as <select> choices for this field.
|
| get_col(self, alias, output_field=None)
|
| get_db_converters(self, connection)
|
| get_db_prep_save(self, value, connection)
| Return field's value prepared for saving into a database.
|
| get_db_prep_value(self, value, connection, prepared=False)
| Return field's value prepared for interacting with the database backend.
|
| Used by the default implementations of get_db_prep_save().
|
| get_default(self)
| Return the default value for this field.
|
| get_filter_kwargs_for_object(self, obj)
| Return a dict that when passed as kwargs to self.model.filter(), would
| yield all instances having the same value for this field as obj has.
|
| get_pk_value_on_save(self, instance)
| Hook to generate new PK values on save. This method is called when
| saving instances with no primary key value set. If this method returns
| something else than None, then the returned value is used when saving
| the new instance.
|
| has_default(self)
| Return a boolean of whether this field has a default value.
|
| pre_save(self, model_instance, add)
| Return field's value just before saving.
|
| rel_db_type(self, connection)
| Return the data type that a related field pointing to this field should
| use. For example, this method is called by ForeignKey and OneToOneField
| to determine its data type.
|
| run_validators(self, value)
|
| save_form_data(self, instance, data)
|
| select_format(self, compiler, sql, params)
| Custom format for select clauses. For example, GIS columns need to be
| selected as AsText(table.col) on MySQL as the table.col data can't be
| used by Django.
|
| set_attributes_from_name(self, name)
|
| validate(self, value, model_instance)
| Validate value and raise ValidationError if necessary. Subclasses
| should override this to provide validation logic.
|
| value_from_object(self, obj)
| Return the value of this field in the given model instance.
|
| value_to_string(self, obj)
| Return a string value of this field from the passed obj.
| This is used by the serialization framework.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from django.db.models.fields.Field:
|
| db_tablespace
|
| flatchoices
| Flattened version of choices tuple.
|
| unique
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from django.db.models.fields.Field:
|
| auto_creation_counter = -11
|
| creation_counter = 58
|
| default_validators = []
|
| empty_values = [None, '', [], (), {}]
|
| hidden = False
|
| many_to_many = None
|
| many_to_one = None
|
| one_to_many = None
|
| one_to_one = None
|
| related_model = None
|
| system_check_deprecated_details = None
|
| system_check_removed_details = None
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| get_lookup(self, lookup_name)
|
| get_transform(self, lookup_name)
|
| ----------------------------------------------------------------------
| Class methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| get_lookups() from builtins.type
|
| register_lookup(lookup, lookup_name=None) from builtins.type
|
| ----------------------------------------------------------------------
| Static methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| merge_dicts(dicts)
| Merge dicts in reverse to preference the order of the original list. e.g.,
| merge_dicts([a, b]) will preference the keys in 'a' over those in 'b'.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
class OuterRef(F)
| An object capable of resolving references to existing query objects.
|
| Method resolution order:
| OuterRef
| F
| Combinable
| builtins.object
|
| Methods defined here:
|
| resolve_expression(self, query=None, allow_joins=True, reuse=None, summarize=False, for_save=False)
|
| ----------------------------------------------------------------------
| Methods inherited from F:
|
| __eq__(self, other)
| Return self==value.
|
| __hash__(self)
| Return hash(self).
|
| __init__(self, name)
| Arguments:
| * name: the name of the field this expression references
|
| __repr__(self)
| Return repr(self).
|
| asc(self, **kwargs)
|
| deconstruct(obj)
| Return a 3-tuple of class import path, positional arguments,
| and keyword arguments.
|
| desc(self, **kwargs)
|
| ----------------------------------------------------------------------
| Static methods inherited from F:
|
| __new__(cls, *args, **kwargs)
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from F:
|
| filterable = True
|
| ----------------------------------------------------------------------
| Methods inherited from Combinable:
|
| __add__(self, other)
|
| __and__(self, other)
|
| __mod__(self, other)
|
| __mul__(self, other)
|
| __or__(self, other)
|
| __pow__(self, other)
|
| __radd__(self, other)
|
| __rand__(self, other)
|
| __rmod__(self, other)
|
| __rmul__(self, other)
|
| __ror__(self, other)
|
| __rpow__(self, other)
|
| __rsub__(self, other)
|
| __rtruediv__(self, other)
|
| __sub__(self, other)
|
| __truediv__(self, other)
|
| bitand(self, other)
|
| bitleftshift(self, other)
|
| bitor(self, other)
|
| bitrightshift(self, other)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from Combinable:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from Combinable:
|
| ADD = '+'
|
| BITAND = '&'
|
| BITLEFTSHIFT = '<<'
|
| BITOR = '|'
|
| BITRIGHTSHIFT = '>>'
|
| DIV = '/'
|
| MOD = '%%'
|
| MUL = '*'
|
| POW = '^'
|
| SUB = '-'
class PositiveIntegerField(PositiveIntegerRelDbTypeMixin, IntegerField)
| Base class for all field types
|
| Method resolution order:
| PositiveIntegerField
| PositiveIntegerRelDbTypeMixin
| IntegerField
| Field
| django.db.models.query_utils.RegisterLookupMixin
| builtins.object
|
| Methods defined here:
|
| formfield(self, **kwargs)
| Return a django.forms.Field instance for this field.
|
| get_internal_type(self)
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| description = 'Positive integer'
|
| ----------------------------------------------------------------------
| Methods inherited from PositiveIntegerRelDbTypeMixin:
|
| rel_db_type(self, connection)
| Return the data type that a related field pointing to this field should
| use. In most cases, a foreign key pointing to a positive integer
| primary key will have an integer column data type but some databases
| (e.g. MySQL) have an unsigned integer type. In that case
| (related_fields_match_type=True), the primary key should return its
| db_type.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from PositiveIntegerRelDbTypeMixin:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
|
| ----------------------------------------------------------------------
| Methods inherited from IntegerField:
|
| check(self, **kwargs)
|
| get_prep_value(self, value)
| Perform preliminary non-db specific value checks and conversions.
|
| to_python(self, value)
| Convert the input value into the expected Python data type, raising
| django.core.exceptions.ValidationError if the data can't be converted.
| Return the converted value. Subclasses should override this.
|
| validators = <django.utils.functional.cached_property object>
| ----------------------------------------------------------------------
| Data and other attributes inherited from IntegerField:
|
| class_lookups = {'gte': <class 'django.db.models.lookups.IntegerGreate...
|
| default_error_messages = {'invalid': "'%(value)s' value must be an int...
|
| empty_strings_allowed = False
|
| ----------------------------------------------------------------------
| Methods inherited from Field:
|
| __copy__(self)
|
| __deepcopy__(self, memodict)
|
| __eq__(self, other)
| Return self==value.
|
| __ge__(self, other, NotImplemented=NotImplemented)
| Return a >= b. Computed by @total_ordering from (not a < b).
|
| __gt__(self, other, NotImplemented=NotImplemented)
| Return a > b. Computed by @total_ordering from (not a < b) and (a != b).
|
| __hash__(self)
| Return hash(self).
|
| __init__(self, verbose_name=None, name=None, primary_key=False, max_length=None, unique=False, blank=False, null=False, db_index=False, rel=None, default=<class 'django.db.models.fields.NOT_PROVIDED'>, editable=True, serialize=True, unique_for_date=None, unique_for_month=None, unique_for_year=None, choices=None, help_text='', db_column=None, db_tablespace=None, auto_created=False, validators=(), error_messages=None)
| Initialize self. See help(type(self)) for accurate signature.
|
| __le__(self, other, NotImplemented=NotImplemented)
| Return a <= b. Computed by @total_ordering from (a < b) or (a == b).
|
| __lt__(self, other)
| Return self<value.
|
| __reduce__(self)
| Pickling should return the model._meta.fields instance of the field,
| not a new copy of that field. So, use the app registry to load the
| model and then the field back.
|
| __repr__(self)
| Display the module, class, and name of the field.
|
| __str__(self)
| Return "app_label.model_label.field_name" for fields attached to
| models.
|
| cached_col = <django.utils.functional.cached_property object>
| cast_db_type(self, connection)
| Return the data type to use in the Cast() function.
|
| clean(self, value, model_instance)
| Convert the value's type and run validation. Validation errors
| from to_python() and validate() are propagated. Return the correct
| value if no error is raised.
|
| clone(self)
| Uses deconstruct() to clone a new copy of this Field.
| Will not preserve any class attachments/attribute names.
|
| contribute_to_class(self, cls, name, private_only=False)
| Register the field with the model class it belongs to.
|
| If private_only is True, create a separate instance of this field
| for every subclass of cls, even if cls is not an abstract model.
|
| db_check(self, connection)
| Return the database column check constraint for this field, for the
| provided connection. Works the same way as db_type() for the case that
| get_internal_type() does not map to a preexisting model field.
|
| db_parameters(self, connection)
| Extension of db_type(), providing a range of different return values
| (type, checks). This will look at db_type(), allowing custom model
| fields to override it.
|
| db_type(self, connection)
| Return the database column data type for this field, for the provided
| connection.
|
| db_type_parameters(self, connection)
|
| db_type_suffix(self, connection)
|
| deconstruct(self)
| Return enough information to recreate the field as a 4-tuple:
|
| * The name of the field on the model, if contribute_to_class() has
| been run.
| * The import path of the field, including the class:e.g.
| django.db.models.IntegerField This should be the most portable
| version, so less specific may be better.
| * A list of positional arguments.
| * A dict of keyword arguments.
|
| Note that the positional or keyword arguments must contain values of
| the following types (including inner values of collection types):
|
| * None, bool, str, int, float, complex, set, frozenset, list, tuple,
| dict
| * UUID
| * datetime.datetime (naive), datetime.date
| * top-level classes, top-level functions - will be referenced by their
| full import path
| * Storage instances - these have their own deconstruct() method
|
| This is because the values here must be serialized into a text format
| (possibly new Python code, possibly JSON) and these are the only types
| with encoding handlers defined.
|
| There's no need to return the exact way the field was instantiated this
| time, just ensure that the resulting field is the same - prefer keyword
| arguments over positional ones, and omit parameters with their default
| values.
|
| get_attname(self)
|
| get_attname_column(self)
|
| get_choices(self, include_blank=True, blank_choice=[('', '---------')], limit_choices_to=None)
| Return choices with a default blank choices included, for use
| as <select> choices for this field.
|
| get_col(self, alias, output_field=None)
|
| get_db_converters(self, connection)
|
| get_db_prep_save(self, value, connection)
| Return field's value prepared for saving into a database.
|
| get_db_prep_value(self, value, connection, prepared=False)
| Return field's value prepared for interacting with the database backend.
|
| Used by the default implementations of get_db_prep_save().
|
| get_default(self)
| Return the default value for this field.
|
| get_filter_kwargs_for_object(self, obj)
| Return a dict that when passed as kwargs to self.model.filter(), would
| yield all instances having the same value for this field as obj has.
|
| get_pk_value_on_save(self, instance)
| Hook to generate new PK values on save. This method is called when
| saving instances with no primary key value set. If this method returns
| something else than None, then the returned value is used when saving
| the new instance.
|
| has_default(self)
| Return a boolean of whether this field has a default value.
|
| pre_save(self, model_instance, add)
| Return field's value just before saving.
|
| run_validators(self, value)
|
| save_form_data(self, instance, data)
|
| select_format(self, compiler, sql, params)
| Custom format for select clauses. For example, GIS columns need to be
| selected as AsText(table.col) on MySQL as the table.col data can't be
| used by Django.
|
| set_attributes_from_name(self, name)
|
| validate(self, value, model_instance)
| Validate value and raise ValidationError if necessary. Subclasses
| should override this to provide validation logic.
|
| value_from_object(self, obj)
| Return the value of this field in the given model instance.
|
| value_to_string(self, obj)
| Return a string value of this field from the passed obj.
| This is used by the serialization framework.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from Field:
|
| db_tablespace
|
| flatchoices
| Flattened version of choices tuple.
|
| unique
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from Field:
|
| auto_creation_counter = -11
|
| creation_counter = 58
|
| default_validators = []
|
| empty_values = [None, '', [], (), {}]
|
| hidden = False
|
| many_to_many = None
|
| many_to_one = None
|
| one_to_many = None
|
| one_to_one = None
|
| related_model = None
|
| system_check_deprecated_details = None
|
| system_check_removed_details = None
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| get_lookup(self, lookup_name)
|
| get_transform(self, lookup_name)
|
| ----------------------------------------------------------------------
| Class methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| get_lookups() from builtins.type
|
| register_lookup(lookup, lookup_name=None) from builtins.type
|
| ----------------------------------------------------------------------
| Static methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| merge_dicts(dicts)
| Merge dicts in reverse to preference the order of the original list. e.g.,
| merge_dicts([a, b]) will preference the keys in 'a' over those in 'b'.
class PositiveSmallIntegerField(PositiveIntegerRelDbTypeMixin, IntegerField)
| Base class for all field types
|
| Method resolution order:
| PositiveSmallIntegerField
| PositiveIntegerRelDbTypeMixin
| IntegerField
| Field
| django.db.models.query_utils.RegisterLookupMixin
| builtins.object
|
| Methods defined here:
|
| formfield(self, **kwargs)
| Return a django.forms.Field instance for this field.
|
| get_internal_type(self)
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| description = 'Positive small integer'
|
| ----------------------------------------------------------------------
| Methods inherited from PositiveIntegerRelDbTypeMixin:
|
| rel_db_type(self, connection)
| Return the data type that a related field pointing to this field should
| use. In most cases, a foreign key pointing to a positive integer
| primary key will have an integer column data type but some databases
| (e.g. MySQL) have an unsigned integer type. In that case
| (related_fields_match_type=True), the primary key should return its
| db_type.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from PositiveIntegerRelDbTypeMixin:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
|
| ----------------------------------------------------------------------
| Methods inherited from IntegerField:
|
| check(self, **kwargs)
|
| get_prep_value(self, value)
| Perform preliminary non-db specific value checks and conversions.
|
| to_python(self, value)
| Convert the input value into the expected Python data type, raising
| django.core.exceptions.ValidationError if the data can't be converted.
| Return the converted value. Subclasses should override this.
|
| validators = <django.utils.functional.cached_property object>
| ----------------------------------------------------------------------
| Data and other attributes inherited from IntegerField:
|
| class_lookups = {'gte': <class 'django.db.models.lookups.IntegerGreate...
|
| default_error_messages = {'invalid': "'%(value)s' value must be an int...
|
| empty_strings_allowed = False
|
| ----------------------------------------------------------------------
| Methods inherited from Field:
|
| __copy__(self)
|
| __deepcopy__(self, memodict)
|
| __eq__(self, other)
| Return self==value.
|
| __ge__(self, other, NotImplemented=NotImplemented)
| Return a >= b. Computed by @total_ordering from (not a < b).
|
| __gt__(self, other, NotImplemented=NotImplemented)
| Return a > b. Computed by @total_ordering from (not a < b) and (a != b).
|
| __hash__(self)
| Return hash(self).
|
| __init__(self, verbose_name=None, name=None, primary_key=False, max_length=None, unique=False, blank=False, null=False, db_index=False, rel=None, default=<class 'django.db.models.fields.NOT_PROVIDED'>, editable=True, serialize=True, unique_for_date=None, unique_for_month=None, unique_for_year=None, choices=None, help_text='', db_column=None, db_tablespace=None, auto_created=False, validators=(), error_messages=None)
| Initialize self. See help(type(self)) for accurate signature.
|
| __le__(self, other, NotImplemented=NotImplemented)
| Return a <= b. Computed by @total_ordering from (a < b) or (a == b).
|
| __lt__(self, other)
| Return self<value.
|
| __reduce__(self)
| Pickling should return the model._meta.fields instance of the field,
| not a new copy of that field. So, use the app registry to load the
| model and then the field back.
|
| __repr__(self)
| Display the module, class, and name of the field.
|
| __str__(self)
| Return "app_label.model_label.field_name" for fields attached to
| models.
|
| cached_col = <django.utils.functional.cached_property object>
| cast_db_type(self, connection)
| Return the data type to use in the Cast() function.
|
| clean(self, value, model_instance)
| Convert the value's type and run validation. Validation errors
| from to_python() and validate() are propagated. Return the correct
| value if no error is raised.
|
| clone(self)
| Uses deconstruct() to clone a new copy of this Field.
| Will not preserve any class attachments/attribute names.
|
| contribute_to_class(self, cls, name, private_only=False)
| Register the field with the model class it belongs to.
|
| If private_only is True, create a separate instance of this field
| for every subclass of cls, even if cls is not an abstract model.
|
| db_check(self, connection)
| Return the database column check constraint for this field, for the
| provided connection. Works the same way as db_type() for the case that
| get_internal_type() does not map to a preexisting model field.
|
| db_parameters(self, connection)
| Extension of db_type(), providing a range of different return values
| (type, checks). This will look at db_type(), allowing custom model
| fields to override it.
|
| db_type(self, connection)
| Return the database column data type for this field, for the provided
| connection.
|
| db_type_parameters(self, connection)
|
| db_type_suffix(self, connection)
|
| deconstruct(self)
| Return enough information to recreate the field as a 4-tuple:
|
| * The name of the field on the model, if contribute_to_class() has
| been run.
| * The import path of the field, including the class:e.g.
| django.db.models.IntegerField This should be the most portable
| version, so less specific may be better.
| * A list of positional arguments.
| * A dict of keyword arguments.
|
| Note that the positional or keyword arguments must contain values of
| the following types (including inner values of collection types):
|
| * None, bool, str, int, float, complex, set, frozenset, list, tuple,
| dict
| * UUID
| * datetime.datetime (naive), datetime.date
| * top-level classes, top-level functions - will be referenced by their
| full import path
| * Storage instances - these have their own deconstruct() method
|
| This is because the values here must be serialized into a text format
| (possibly new Python code, possibly JSON) and these are the only types
| with encoding handlers defined.
|
| There's no need to return the exact way the field was instantiated this
| time, just ensure that the resulting field is the same - prefer keyword
| arguments over positional ones, and omit parameters with their default
| values.
|
| get_attname(self)
|
| get_attname_column(self)
|
| get_choices(self, include_blank=True, blank_choice=[('', '---------')], limit_choices_to=None)
| Return choices with a default blank choices included, for use
| as <select> choices for this field.
|
| get_col(self, alias, output_field=None)
|
| get_db_converters(self, connection)
|
| get_db_prep_save(self, value, connection)
| Return field's value prepared for saving into a database.
|
| get_db_prep_value(self, value, connection, prepared=False)
| Return field's value prepared for interacting with the database backend.
|
| Used by the default implementations of get_db_prep_save().
|
| get_default(self)
| Return the default value for this field.
|
| get_filter_kwargs_for_object(self, obj)
| Return a dict that when passed as kwargs to self.model.filter(), would
| yield all instances having the same value for this field as obj has.
|
| get_pk_value_on_save(self, instance)
| Hook to generate new PK values on save. This method is called when
| saving instances with no primary key value set. If this method returns
| something else than None, then the returned value is used when saving
| the new instance.
|
| has_default(self)
| Return a boolean of whether this field has a default value.
|
| pre_save(self, model_instance, add)
| Return field's value just before saving.
|
| run_validators(self, value)
|
| save_form_data(self, instance, data)
|
| select_format(self, compiler, sql, params)
| Custom format for select clauses. For example, GIS columns need to be
| selected as AsText(table.col) on MySQL as the table.col data can't be
| used by Django.
|
| set_attributes_from_name(self, name)
|
| validate(self, value, model_instance)
| Validate value and raise ValidationError if necessary. Subclasses
| should override this to provide validation logic.
|
| value_from_object(self, obj)
| Return the value of this field in the given model instance.
|
| value_to_string(self, obj)
| Return a string value of this field from the passed obj.
| This is used by the serialization framework.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from Field:
|
| db_tablespace
|
| flatchoices
| Flattened version of choices tuple.
|
| unique
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from Field:
|
| auto_creation_counter = -11
|
| creation_counter = 58
|
| default_validators = []
|
| empty_values = [None, '', [], (), {}]
|
| hidden = False
|
| many_to_many = None
|
| many_to_one = None
|
| one_to_many = None
|
| one_to_one = None
|
| related_model = None
|
| system_check_deprecated_details = None
|
| system_check_removed_details = None
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| get_lookup(self, lookup_name)
|
| get_transform(self, lookup_name)
|
| ----------------------------------------------------------------------
| Class methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| get_lookups() from builtins.type
|
| register_lookup(lookup, lookup_name=None) from builtins.type
|
| ----------------------------------------------------------------------
| Static methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| merge_dicts(dicts)
| Merge dicts in reverse to preference the order of the original list. e.g.,
| merge_dicts([a, b]) will preference the keys in 'a' over those in 'b'.
class Prefetch(builtins.object)
| Methods defined here:
|
| __eq__(self, other)
| Return self==value.
|
| __getstate__(self)
|
| __hash__(self)
| Return hash(self).
|
| __init__(self, lookup, queryset=None, to_attr=None)
| Initialize self. See help(type(self)) for accurate signature.
|
| add_prefix(self, prefix)
|
| get_current_prefetch_to(self, level)
|
| get_current_queryset(self, level)
|
| get_current_to_attr(self, level)
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
class ProtectedError(django.db.utils.IntegrityError)
| Common base class for all non-exit exceptions.
|
| Method resolution order:
| ProtectedError
| django.db.utils.IntegrityError
| django.db.utils.DatabaseError
| django.db.utils.Error
| builtins.Exception
| builtins.BaseException
| builtins.object
|
| Methods defined here:
|
| __init__(self, msg, protected_objects)
| Initialize self. See help(type(self)) for accurate signature.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from django.db.utils.Error:
|
| __weakref__
| list of weak references to the object (if defined)
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.Exception:
|
| __new__(*args, **kwargs) from builtins.type
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.BaseException:
|
| __delattr__(self, name, /)
| Implement delattr(self, name).
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __reduce__(...)
| helper for pickle
|
| __repr__(self, /)
| Return repr(self).
|
| __setattr__(self, name, value, /)
| Implement setattr(self, name, value).
|
| __setstate__(...)
|
| __str__(self, /)
| Return str(self).
|
| with_traceback(...)
| Exception.with_traceback(tb) --
| set self.__traceback__ to tb and return self.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from builtins.BaseException:
|
| __cause__
| exception cause
|
| __context__
| exception context
|
| __dict__
|
| __suppress_context__
|
| __traceback__
|
| args
class Q(django.utils.tree.Node)
| Encapsulate filters as objects that can then be combined logically (using
| `&` and `|`).
|
| Method resolution order:
| Q
| django.utils.tree.Node
| builtins.object
|
| Methods defined here:
|
| __and__(self, other)
|
| __init__(self, *args, **kwargs)
| Construct a new Node. If no connector is given, use the default.
|
| __invert__(self)
|
| __or__(self, other)
|
| deconstruct(self)
|
| resolve_expression(self, query=None, allow_joins=True, reuse=None, summarize=False, for_save=False)
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| AND = 'AND'
|
| OR = 'OR'
|
| default = 'AND'
|
| ----------------------------------------------------------------------
| Methods inherited from django.utils.tree.Node:
|
| __bool__(self)
| Return whether or not this node has children.
|
| __contains__(self, other)
| Return True if 'other' is a direct child of this instance.
|
| __deepcopy__(self, memodict)
|
| __eq__(self, other)
| Return self==value.
|
| __hash__(self)
| Return hash(self).
|
| __len__(self)
| Return the the number of children this node has.
|
| __repr__(self)
| Return repr(self).
|
| __str__(self)
| Return str(self).
|
| add(self, data, conn_type, squash=True)
| Combine this tree and the data represented by data using the
| connector conn_type. The combine is done by squashing the node other
| away if possible.
|
| This tree (self) will never be pushed to a child node of the
| combined tree, nor will the connector or negated properties change.
|
| Return a node which can be used in place of data regardless if the
| node other got squashed or not.
|
| If `squash` is False the data is prepared and added as a child to
| this tree without further logic.
|
| negate(self)
| Negate the sense of the root connector.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from django.utils.tree.Node:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
class QuerySet(builtins.object)
| Represent a lazy database lookup for a set of objects.
|
| Methods defined here:
|
| __and__(self, other)
|
| __bool__(self)
|
| __deepcopy__(self, memo)
| Don't populate the QuerySet's cache.
|
| __getitem__(self, k)
| Retrieve an item or slice from the set of results.
|
| __getstate__(self)
|
| __init__(self, model=None, query=None, using=None, hints=None)
| Initialize self. See help(type(self)) for accurate signature.
|
| __iter__(self)
| The queryset iterator protocol uses three nested iterators in the
| default case:
| 1. sql.compiler:execute_sql()
| - Returns 100 rows at time (constants.GET_ITERATOR_CHUNK_SIZE)
| using cursor.fetchmany(). This part is responsible for
| doing some column masking, and returning the rows in chunks.
| 2. sql.compiler.results_iter()
| - Returns one row at time. At this point the rows are still just
| tuples. In some cases the return values are converted to
| Python values at this location.
| 3. self.iterator()
| - Responsible for turning the rows into model objects.
|
| __len__(self)
|
| __or__(self, other)
|
| __repr__(self)
| Return repr(self).
|
| __setstate__(self, state)
|
| aggregate(self, *args, **kwargs)
| Return a dictionary containing the calculations (aggregation)
| over the current queryset.
|
| If args is present the expression is passed as a kwarg using
| the Aggregate object's default alias.
|
| all(self)
| Return a new QuerySet that is a copy of the current one. This allows a
| QuerySet to proxy for a model manager in some cases.
|
| annotate(self, *args, **kwargs)
| Return a query set in which the returned objects have been annotated
| with extra data or aggregations.
|
| bulk_create(self, objs, batch_size=None)
| Insert each of the instances into the database. Do *not* call
| save() on each of the instances, do not send any pre/post_save
| signals, and do not set the primary key attribute if it is an
| autoincrement field (except if features.can_return_ids_from_bulk_insert=True).
| Multi-table models are not supported.
|
| complex_filter(self, filter_obj)
| Return a new QuerySet instance with filter_obj added to the filters.
|
| filter_obj can be a Q object or a dictionary of keyword lookup
| arguments.
|
| This exists to support framework features such as 'limit_choices_to',
| and usually it will be more natural to use other methods.
|
| count(self)
| Perform a SELECT COUNT() and return the number of records as an
| integer.
|
| If the QuerySet is already fully cached, return the length of the
| cached results set to avoid multiple SELECT COUNT(*) calls.
|
| create(self, **kwargs)
| Create a new object with the given kwargs, saving it to the database
| and returning the created object.
|
| dates(self, field_name, kind, order='ASC')
| Return a list of date objects representing all available dates for
| the given field_name, scoped to 'kind'.
|
| datetimes(self, field_name, kind, order='ASC', tzinfo=None)
| Return a list of datetime objects representing all available
| datetimes for the given field_name, scoped to 'kind'.
|
| defer(self, *fields)
| Defer the loading of data for certain fields until they are accessed.
| Add the set of deferred fields to any existing set of deferred fields.
| The only exception to this is if None is passed in as the only
| parameter, in which case removal all deferrals.
|
| delete(self)
| Delete the records in the current QuerySet.
|
| difference(self, *other_qs)
|
| distinct(self, *field_names)
| Return a new QuerySet instance that will select only distinct results.
|
| earliest(self, *fields, field_name=None)
|
| exclude(self, *args, **kwargs)
| Return a new QuerySet instance with NOT (args) ANDed to the existing
| set.
|
| exists(self)
|
| extra(self, select=None, where=None, params=None, tables=None, order_by=None, select_params=None)
| Add extra SQL fragments to the query.
|
| filter(self, *args, **kwargs)
| Return a new QuerySet instance with the args ANDed to the existing
| set.
|
| first(self)
| Return the first object of a query or None if no match is found.
|
| get(self, *args, **kwargs)
| Perform the query and return a single object matching the given
| keyword arguments.
|
| get_or_create(self, defaults=None, **kwargs)
| Look up an object with the given kwargs, creating one if necessary.
| Return a tuple of (object, created), where created is a boolean
| specifying whether an object was created.
|
| in_bulk(self, id_list=None, *, field_name='pk')
| Return a dictionary mapping each of the given IDs to the object with
| that ID. If `id_list` isn't provided, evaluate the entire QuerySet.
|
| intersection(self, *other_qs)
|
| iterator(self, chunk_size=2000)
| An iterator over the results from applying this QuerySet to the
| database.
|
| last(self)
| Return the last object of a query or None if no match is found.
|
| latest(self, *fields, field_name=None)
|
| none(self)
| Return an empty QuerySet.
|
| only(self, *fields)
| Essentially, the opposite of defer(). Only the fields passed into this
| method and that are not already specified as deferred are loaded
| immediately when the queryset is evaluated.
|
| order_by(self, *field_names)
| Return a new QuerySet instance with the ordering changed.
|
| prefetch_related(self, *lookups)
| Return a new QuerySet instance that will prefetch the specified
| Many-To-One and Many-To-Many related objects when the QuerySet is
| evaluated.
|
| When prefetch_related() is called more than once, append to the list of
| prefetch lookups. If prefetch_related(None) is called, clear the list.
|
| raw(self, raw_query, params=None, translations=None, using=None)
|
| resolve_expression(self, *args, **kwargs)
|
| reverse(self)
| Reverse the ordering of the QuerySet.
|
| select_for_update(self, nowait=False, skip_locked=False, of=())
| Return a new QuerySet instance that will select objects with a
| FOR UPDATE lock.
|
| select_related(self, *fields)
| Return a new QuerySet instance that will select related objects.
|
| If fields are specified, they must be ForeignKey fields and only those
| related objects are included in the selection.
|
| If select_related(None) is called, clear the list.
|
| union(self, *other_qs, all=False)
|
| update(self, **kwargs)
| Update all elements in the current QuerySet, setting all the given
| fields to the appropriate values.
|
| update_or_create(self, defaults=None, **kwargs)
| Look up an object with the given kwargs, updating one with defaults
| if it exists, otherwise create a new one.
| Return a tuple (object, created), where created is a boolean
| specifying whether an object was created.
|
| using(self, alias)
| Select which database this QuerySet should execute against.
|
| values(self, *fields, **expressions)
|
| values_list(self, *fields, flat=False, named=False)
|
| ----------------------------------------------------------------------
| Class methods defined here:
|
| as_manager() from builtins.type
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
|
| db
| Return the database used if this query is executed now.
|
| ordered
| Return True if the QuerySet is ordered -- i.e. has an order_by()
| clause or a default ordering on the model.
class RowRange(WindowFrame)
| Model the frame clause in window expressions. There are two types of frame
| clauses which are subclasses, however, all processing and validation (by no
| means intended to be complete) is done here. Thus, providing an end for a
| frame is optional (the default is UNBOUNDED FOLLOWING, which is the last
| row in the frame).
|
| Method resolution order:
| RowRange
| WindowFrame
| Expression
| BaseExpression
| Combinable
| builtins.object
|
| Methods defined here:
|
| window_frame_start_end(self, connection, start, end)
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| frame_type = 'ROWS'
|
| ----------------------------------------------------------------------
| Methods inherited from WindowFrame:
|
| __init__(self, start=None, end=None)
| Initialize self. See help(type(self)) for accurate signature.
|
| __repr__(self)
| Return repr(self).
|
| __str__(self)
| Return str(self).
|
| as_sql(self, compiler, connection)
| Responsible for returning a (sql, [params]) tuple to be included
| in the current query.
|
| Different backends can provide their own implementation, by
| providing an `as_{vendor}` method and patching the Expression:
|
| ```
| def override_as_sql(self, compiler, connection):
| # custom logic
| return super().as_sql(compiler, connection)
| setattr(Expression, 'as_' + connection.vendor, override_as_sql)
| ```
|
| Arguments:
| * compiler: the query compiler responsible for generating the query.
| Must have a compile method, returning a (sql, [params]) tuple.
| Calling compiler(value) will return a quoted `value`.
|
| * connection: the database connection used for the current query.
|
| Return: (sql, params)
| Where `sql` is a string containing ordered sql parameters to be
| replaced with the elements of the list `params`.
|
| get_group_by_cols(self)
|
| get_source_expressions(self)
|
| set_source_expressions(self, exprs)
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from WindowFrame:
|
| template = '%(frame_type)s BETWEEN %(start)s AND %(end)s'
|
| ----------------------------------------------------------------------
| Methods inherited from BaseExpression:
|
| __eq__(self, other)
| Return self==value.
|
| __getstate__(self)
|
| __hash__(self)
| Return hash(self).
|
| asc(self, **kwargs)
|
| contains_aggregate = <django.utils.functional.cached_property object>
| contains_column_references = <django.utils.functional.cached_property object>
| contains_over_clause = <django.utils.functional.cached_property object>
| convert_value = <django.utils.functional.cached_property object>
| copy(self)
|
| deconstruct(obj)
| Return a 3-tuple of class import path, positional arguments,
| and keyword arguments.
|
| desc(self, **kwargs)
|
| flatten(self)
| Recursively yield this expression and all subexpressions, in
| depth-first order.
|
| get_db_converters(self, connection)
|
| get_lookup(self, lookup)
|
| get_source_fields(self)
| Return the underlying field types used by this aggregate.
|
| get_transform(self, name)
|
| output_field = <django.utils.functional.cached_property object>
| relabeled_clone(self, change_map)
|
| resolve_expression(self, query=None, allow_joins=True, reuse=None, summarize=False, for_save=False)
| Provide the chance to do any preprocessing or validation before being
| added to the query.
|
| Arguments:
| * query: the backend query implementation
| * allow_joins: boolean allowing or denying use of joins
| in this query
| * reuse: a set of reusable joins for multijoins
| * summarize: a terminal aggregate clause
| * for_save: whether this expression about to be used in a save or update
|
| Return: an Expression to be added to the query.
|
| reverse_ordering(self)
|
| ----------------------------------------------------------------------
| Static methods inherited from BaseExpression:
|
| __new__(cls, *args, **kwargs)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from BaseExpression:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
|
| field
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from BaseExpression:
|
| filterable = True
|
| is_summary = False
|
| window_compatible = False
|
| ----------------------------------------------------------------------
| Methods inherited from Combinable:
|
| __add__(self, other)
|
| __and__(self, other)
|
| __mod__(self, other)
|
| __mul__(self, other)
|
| __or__(self, other)
|
| __pow__(self, other)
|
| __radd__(self, other)
|
| __rand__(self, other)
|
| __rmod__(self, other)
|
| __rmul__(self, other)
|
| __ror__(self, other)
|
| __rpow__(self, other)
|
| __rsub__(self, other)
|
| __rtruediv__(self, other)
|
| __sub__(self, other)
|
| __truediv__(self, other)
|
| bitand(self, other)
|
| bitleftshift(self, other)
|
| bitor(self, other)
|
| bitrightshift(self, other)
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from Combinable:
|
| ADD = '+'
|
| BITAND = '&'
|
| BITLEFTSHIFT = '<<'
|
| BITOR = '|'
|
| BITRIGHTSHIFT = '>>'
|
| DIV = '/'
|
| MOD = '%%'
|
| MUL = '*'
|
| POW = '^'
|
| SUB = '-'
class SlugField(CharField)
| Base class for all field types
|
| Method resolution order:
| SlugField
| CharField
| Field
| django.db.models.query_utils.RegisterLookupMixin
| builtins.object
|
| Methods defined here:
|
| __init__(self, *args, max_length=50, db_index=True, allow_unicode=False, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| deconstruct(self)
| Return enough information to recreate the field as a 4-tuple:
|
| * The name of the field on the model, if contribute_to_class() has
| been run.
| * The import path of the field, including the class:e.g.
| django.db.models.IntegerField This should be the most portable
| version, so less specific may be better.
| * A list of positional arguments.
| * A dict of keyword arguments.
|
| Note that the positional or keyword arguments must contain values of
| the following types (including inner values of collection types):
|
| * None, bool, str, int, float, complex, set, frozenset, list, tuple,
| dict
| * UUID
| * datetime.datetime (naive), datetime.date
| * top-level classes, top-level functions - will be referenced by their
| full import path
| * Storage instances - these have their own deconstruct() method
|
| This is because the values here must be serialized into a text format
| (possibly new Python code, possibly JSON) and these are the only types
| with encoding handlers defined.
|
| There's no need to return the exact way the field was instantiated this
| time, just ensure that the resulting field is the same - prefer keyword
| arguments over positional ones, and omit parameters with their default
| values.
|
| formfield(self, **kwargs)
| Return a django.forms.Field instance for this field.
|
| get_internal_type(self)
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| default_validators = [<django.core.validators.RegexValidator object>]
|
| description = 'Slug (up to %(max_length)s)'
|
| ----------------------------------------------------------------------
| Methods inherited from CharField:
|
| cast_db_type(self, connection)
| Return the data type to use in the Cast() function.
|
| check(self, **kwargs)
|
| get_prep_value(self, value)
| Perform preliminary non-db specific value checks and conversions.
|
| to_python(self, value)
| Convert the input value into the expected Python data type, raising
| django.core.exceptions.ValidationError if the data can't be converted.
| Return the converted value. Subclasses should override this.
|
| ----------------------------------------------------------------------
| Methods inherited from Field:
|
| __copy__(self)
|
| __deepcopy__(self, memodict)
|
| __eq__(self, other)
| Return self==value.
|
| __ge__(self, other, NotImplemented=NotImplemented)
| Return a >= b. Computed by @total_ordering from (not a < b).
|
| __gt__(self, other, NotImplemented=NotImplemented)
| Return a > b. Computed by @total_ordering from (not a < b) and (a != b).
|
| __hash__(self)
| Return hash(self).
|
| __le__(self, other, NotImplemented=NotImplemented)
| Return a <= b. Computed by @total_ordering from (a < b) or (a == b).
|
| __lt__(self, other)
| Return self<value.
|
| __reduce__(self)
| Pickling should return the model._meta.fields instance of the field,
| not a new copy of that field. So, use the app registry to load the
| model and then the field back.
|
| __repr__(self)
| Display the module, class, and name of the field.
|
| __str__(self)
| Return "app_label.model_label.field_name" for fields attached to
| models.
|
| cached_col = <django.utils.functional.cached_property object>
| clean(self, value, model_instance)
| Convert the value's type and run validation. Validation errors
| from to_python() and validate() are propagated. Return the correct
| value if no error is raised.
|
| clone(self)
| Uses deconstruct() to clone a new copy of this Field.
| Will not preserve any class attachments/attribute names.
|
| contribute_to_class(self, cls, name, private_only=False)
| Register the field with the model class it belongs to.
|
| If private_only is True, create a separate instance of this field
| for every subclass of cls, even if cls is not an abstract model.
|
| db_check(self, connection)
| Return the database column check constraint for this field, for the
| provided connection. Works the same way as db_type() for the case that
| get_internal_type() does not map to a preexisting model field.
|
| db_parameters(self, connection)
| Extension of db_type(), providing a range of different return values
| (type, checks). This will look at db_type(), allowing custom model
| fields to override it.
|
| db_type(self, connection)
| Return the database column data type for this field, for the provided
| connection.
|
| db_type_parameters(self, connection)
|
| db_type_suffix(self, connection)
|
| get_attname(self)
|
| get_attname_column(self)
|
| get_choices(self, include_blank=True, blank_choice=[('', '---------')], limit_choices_to=None)
| Return choices with a default blank choices included, for use
| as <select> choices for this field.
|
| get_col(self, alias, output_field=None)
|
| get_db_converters(self, connection)
|
| get_db_prep_save(self, value, connection)
| Return field's value prepared for saving into a database.
|
| get_db_prep_value(self, value, connection, prepared=False)
| Return field's value prepared for interacting with the database backend.
|
| Used by the default implementations of get_db_prep_save().
|
| get_default(self)
| Return the default value for this field.
|
| get_filter_kwargs_for_object(self, obj)
| Return a dict that when passed as kwargs to self.model.filter(), would
| yield all instances having the same value for this field as obj has.
|
| get_pk_value_on_save(self, instance)
| Hook to generate new PK values on save. This method is called when
| saving instances with no primary key value set. If this method returns
| something else than None, then the returned value is used when saving
| the new instance.
|
| has_default(self)
| Return a boolean of whether this field has a default value.
|
| pre_save(self, model_instance, add)
| Return field's value just before saving.
|
| rel_db_type(self, connection)
| Return the data type that a related field pointing to this field should
| use. For example, this method is called by ForeignKey and OneToOneField
| to determine its data type.
|
| run_validators(self, value)
|
| save_form_data(self, instance, data)
|
| select_format(self, compiler, sql, params)
| Custom format for select clauses. For example, GIS columns need to be
| selected as AsText(table.col) on MySQL as the table.col data can't be
| used by Django.
|
| set_attributes_from_name(self, name)
|
| validate(self, value, model_instance)
| Validate value and raise ValidationError if necessary. Subclasses
| should override this to provide validation logic.
|
| validators = <django.utils.functional.cached_property object>
| value_from_object(self, obj)
| Return the value of this field in the given model instance.
|
| value_to_string(self, obj)
| Return a string value of this field from the passed obj.
| This is used by the serialization framework.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from Field:
|
| db_tablespace
|
| flatchoices
| Flattened version of choices tuple.
|
| unique
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from Field:
|
| auto_creation_counter = -11
|
| class_lookups = {'contains': <class 'django.db.models.lookups.Contains...
|
| creation_counter = 58
|
| default_error_messages = {'blank': 'This field cannot be blank.', 'inv...
|
| empty_strings_allowed = True
|
| empty_values = [None, '', [], (), {}]
|
| hidden = False
|
| many_to_many = None
|
| many_to_one = None
|
| one_to_many = None
|
| one_to_one = None
|
| related_model = None
|
| system_check_deprecated_details = None
|
| system_check_removed_details = None
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| get_lookup(self, lookup_name)
|
| get_transform(self, lookup_name)
|
| ----------------------------------------------------------------------
| Class methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| get_lookups() from builtins.type
|
| register_lookup(lookup, lookup_name=None) from builtins.type
|
| ----------------------------------------------------------------------
| Static methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| merge_dicts(dicts)
| Merge dicts in reverse to preference the order of the original list. e.g.,
| merge_dicts([a, b]) will preference the keys in 'a' over those in 'b'.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
class SmallIntegerField(IntegerField)
| Base class for all field types
|
| Method resolution order:
| SmallIntegerField
| IntegerField
| Field
| django.db.models.query_utils.RegisterLookupMixin
| builtins.object
|
| Methods defined here:
|
| get_internal_type(self)
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| description = 'Small integer'
|
| ----------------------------------------------------------------------
| Methods inherited from IntegerField:
|
| check(self, **kwargs)
|
| formfield(self, **kwargs)
| Return a django.forms.Field instance for this field.
|
| get_prep_value(self, value)
| Perform preliminary non-db specific value checks and conversions.
|
| to_python(self, value)
| Convert the input value into the expected Python data type, raising
| django.core.exceptions.ValidationError if the data can't be converted.
| Return the converted value. Subclasses should override this.
|
| validators = <django.utils.functional.cached_property object>
| ----------------------------------------------------------------------
| Data and other attributes inherited from IntegerField:
|
| class_lookups = {'gte': <class 'django.db.models.lookups.IntegerGreate...
|
| default_error_messages = {'invalid': "'%(value)s' value must be an int...
|
| empty_strings_allowed = False
|
| ----------------------------------------------------------------------
| Methods inherited from Field:
|
| __copy__(self)
|
| __deepcopy__(self, memodict)
|
| __eq__(self, other)
| Return self==value.
|
| __ge__(self, other, NotImplemented=NotImplemented)
| Return a >= b. Computed by @total_ordering from (not a < b).
|
| __gt__(self, other, NotImplemented=NotImplemented)
| Return a > b. Computed by @total_ordering from (not a < b) and (a != b).
|
| __hash__(self)
| Return hash(self).
|
| __init__(self, verbose_name=None, name=None, primary_key=False, max_length=None, unique=False, blank=False, null=False, db_index=False, rel=None, default=<class 'django.db.models.fields.NOT_PROVIDED'>, editable=True, serialize=True, unique_for_date=None, unique_for_month=None, unique_for_year=None, choices=None, help_text='', db_column=None, db_tablespace=None, auto_created=False, validators=(), error_messages=None)
| Initialize self. See help(type(self)) for accurate signature.
|
| __le__(self, other, NotImplemented=NotImplemented)
| Return a <= b. Computed by @total_ordering from (a < b) or (a == b).
|
| __lt__(self, other)
| Return self<value.
|
| __reduce__(self)
| Pickling should return the model._meta.fields instance of the field,
| not a new copy of that field. So, use the app registry to load the
| model and then the field back.
|
| __repr__(self)
| Display the module, class, and name of the field.
|
| __str__(self)
| Return "app_label.model_label.field_name" for fields attached to
| models.
|
| cached_col = <django.utils.functional.cached_property object>
| cast_db_type(self, connection)
| Return the data type to use in the Cast() function.
|
| clean(self, value, model_instance)
| Convert the value's type and run validation. Validation errors
| from to_python() and validate() are propagated. Return the correct
| value if no error is raised.
|
| clone(self)
| Uses deconstruct() to clone a new copy of this Field.
| Will not preserve any class attachments/attribute names.
|
| contribute_to_class(self, cls, name, private_only=False)
| Register the field with the model class it belongs to.
|
| If private_only is True, create a separate instance of this field
| for every subclass of cls, even if cls is not an abstract model.
|
| db_check(self, connection)
| Return the database column check constraint for this field, for the
| provided connection. Works the same way as db_type() for the case that
| get_internal_type() does not map to a preexisting model field.
|
| db_parameters(self, connection)
| Extension of db_type(), providing a range of different return values
| (type, checks). This will look at db_type(), allowing custom model
| fields to override it.
|
| db_type(self, connection)
| Return the database column data type for this field, for the provided
| connection.
|
| db_type_parameters(self, connection)
|
| db_type_suffix(self, connection)
|
| deconstruct(self)
| Return enough information to recreate the field as a 4-tuple:
|
| * The name of the field on the model, if contribute_to_class() has
| been run.
| * The import path of the field, including the class:e.g.
| django.db.models.IntegerField This should be the most portable
| version, so less specific may be better.
| * A list of positional arguments.
| * A dict of keyword arguments.
|
| Note that the positional or keyword arguments must contain values of
| the following types (including inner values of collection types):
|
| * None, bool, str, int, float, complex, set, frozenset, list, tuple,
| dict
| * UUID
| * datetime.datetime (naive), datetime.date
| * top-level classes, top-level functions - will be referenced by their
| full import path
| * Storage instances - these have their own deconstruct() method
|
| This is because the values here must be serialized into a text format
| (possibly new Python code, possibly JSON) and these are the only types
| with encoding handlers defined.
|
| There's no need to return the exact way the field was instantiated this
| time, just ensure that the resulting field is the same - prefer keyword
| arguments over positional ones, and omit parameters with their default
| values.
|
| get_attname(self)
|
| get_attname_column(self)
|
| get_choices(self, include_blank=True, blank_choice=[('', '---------')], limit_choices_to=None)
| Return choices with a default blank choices included, for use
| as <select> choices for this field.
|
| get_col(self, alias, output_field=None)
|
| get_db_converters(self, connection)
|
| get_db_prep_save(self, value, connection)
| Return field's value prepared for saving into a database.
|
| get_db_prep_value(self, value, connection, prepared=False)
| Return field's value prepared for interacting with the database backend.
|
| Used by the default implementations of get_db_prep_save().
|
| get_default(self)
| Return the default value for this field.
|
| get_filter_kwargs_for_object(self, obj)
| Return a dict that when passed as kwargs to self.model.filter(), would
| yield all instances having the same value for this field as obj has.
|
| get_pk_value_on_save(self, instance)
| Hook to generate new PK values on save. This method is called when
| saving instances with no primary key value set. If this method returns
| something else than None, then the returned value is used when saving
| the new instance.
|
| has_default(self)
| Return a boolean of whether this field has a default value.
|
| pre_save(self, model_instance, add)
| Return field's value just before saving.
|
| rel_db_type(self, connection)
| Return the data type that a related field pointing to this field should
| use. For example, this method is called by ForeignKey and OneToOneField
| to determine its data type.
|
| run_validators(self, value)
|
| save_form_data(self, instance, data)
|
| select_format(self, compiler, sql, params)
| Custom format for select clauses. For example, GIS columns need to be
| selected as AsText(table.col) on MySQL as the table.col data can't be
| used by Django.
|
| set_attributes_from_name(self, name)
|
| validate(self, value, model_instance)
| Validate value and raise ValidationError if necessary. Subclasses
| should override this to provide validation logic.
|
| value_from_object(self, obj)
| Return the value of this field in the given model instance.
|
| value_to_string(self, obj)
| Return a string value of this field from the passed obj.
| This is used by the serialization framework.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from Field:
|
| db_tablespace
|
| flatchoices
| Flattened version of choices tuple.
|
| unique
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from Field:
|
| auto_creation_counter = -11
|
| creation_counter = 58
|
| default_validators = []
|
| empty_values = [None, '', [], (), {}]
|
| hidden = False
|
| many_to_many = None
|
| many_to_one = None
|
| one_to_many = None
|
| one_to_one = None
|
| related_model = None
|
| system_check_deprecated_details = None
|
| system_check_removed_details = None
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| get_lookup(self, lookup_name)
|
| get_transform(self, lookup_name)
|
| ----------------------------------------------------------------------
| Class methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| get_lookups() from builtins.type
|
| register_lookup(lookup, lookup_name=None) from builtins.type
|
| ----------------------------------------------------------------------
| Static methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| merge_dicts(dicts)
| Merge dicts in reverse to preference the order of the original list. e.g.,
| merge_dicts([a, b]) will preference the keys in 'a' over those in 'b'.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
class StdDev(Aggregate)
| An SQL function call.
|
| Method resolution order:
| StdDev
| Aggregate
| django.db.models.expressions.Func
| django.db.models.expressions.SQLiteNumericMixin
| django.db.models.expressions.Expression
| django.db.models.expressions.BaseExpression
| django.db.models.expressions.Combinable
| builtins.object
|
| Methods defined here:
|
| __init__(self, expression, sample=False, **extra)
| Initialize self. See help(type(self)) for accurate signature.
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| name = 'StdDev'
|
| output_field = <django.db.models.fields.FloatField>
|
| ----------------------------------------------------------------------
| Methods inherited from Aggregate:
|
| as_sql(self, compiler, connection, **extra_context)
| Responsible for returning a (sql, [params]) tuple to be included
| in the current query.
|
| Different backends can provide their own implementation, by
| providing an `as_{vendor}` method and patching the Expression:
|
| ```
| def override_as_sql(self, compiler, connection):
| # custom logic
| return super().as_sql(compiler, connection)
| setattr(Expression, 'as_' + connection.vendor, override_as_sql)
| ```
|
| Arguments:
| * compiler: the query compiler responsible for generating the query.
| Must have a compile method, returning a (sql, [params]) tuple.
| Calling compiler(value) will return a quoted `value`.
|
| * connection: the database connection used for the current query.
|
| Return: (sql, params)
| Where `sql` is a string containing ordered sql parameters to be
| replaced with the elements of the list `params`.
|
| get_group_by_cols(self)
|
| get_source_expressions(self)
|
| get_source_fields(self)
| Return the underlying field types used by this aggregate.
|
| resolve_expression(self, query=None, allow_joins=True, reuse=None, summarize=False, for_save=False)
| Provide the chance to do any preprocessing or validation before being
| added to the query.
|
| Arguments:
| * query: the backend query implementation
| * allow_joins: boolean allowing or denying use of joins
| in this query
| * reuse: a set of reusable joins for multijoins
| * summarize: a terminal aggregate clause
| * for_save: whether this expression about to be used in a save or update
|
| Return: an Expression to be added to the query.
|
| set_source_expressions(self, exprs)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from Aggregate:
|
| default_alias
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from Aggregate:
|
| contains_aggregate = True
|
| filter_template = '%s FILTER (WHERE %%(filter)s)'
|
| window_compatible = True
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.expressions.Func:
|
| __repr__(self)
| Return repr(self).
|
| copy(self)
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from django.db.models.expressions.Func:
|
| arg_joiner = ', '
|
| arity = None
|
| function = None
|
| template = '%(function)s(%(expressions)s)'
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.expressions.SQLiteNumericMixin:
|
| as_sqlite(self, compiler, connection, **extra_context)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from django.db.models.expressions.SQLiteNumericMixin:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.expressions.BaseExpression:
|
| __eq__(self, other)
| Return self==value.
|
| __getstate__(self)
|
| __hash__(self)
| Return hash(self).
|
| asc(self, **kwargs)
|
| contains_column_references = <django.utils.functional.cached_property object>
| contains_over_clause = <django.utils.functional.cached_property object>
| convert_value = <django.utils.functional.cached_property object>
| deconstruct(obj)
| Return a 3-tuple of class import path, positional arguments,
| and keyword arguments.
|
| desc(self, **kwargs)
|
| flatten(self)
| Recursively yield this expression and all subexpressions, in
| depth-first order.
|
| get_db_converters(self, connection)
|
| get_lookup(self, lookup)
|
| get_transform(self, name)
|
| relabeled_clone(self, change_map)
|
| reverse_ordering(self)
|
| ----------------------------------------------------------------------
| Static methods inherited from django.db.models.expressions.BaseExpression:
|
| __new__(cls, *args, **kwargs)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from django.db.models.expressions.BaseExpression:
|
| field
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from django.db.models.expressions.BaseExpression:
|
| filterable = True
|
| is_summary = False
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.expressions.Combinable:
|
| __add__(self, other)
|
| __and__(self, other)
|
| __mod__(self, other)
|
| __mul__(self, other)
|
| __or__(self, other)
|
| __pow__(self, other)
|
| __radd__(self, other)
|
| __rand__(self, other)
|
| __rmod__(self, other)
|
| __rmul__(self, other)
|
| __ror__(self, other)
|
| __rpow__(self, other)
|
| __rsub__(self, other)
|
| __rtruediv__(self, other)
|
| __sub__(self, other)
|
| __truediv__(self, other)
|
| bitand(self, other)
|
| bitleftshift(self, other)
|
| bitor(self, other)
|
| bitrightshift(self, other)
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from django.db.models.expressions.Combinable:
|
| ADD = '+'
|
| BITAND = '&'
|
| BITLEFTSHIFT = '<<'
|
| BITOR = '|'
|
| BITRIGHTSHIFT = '>>'
|
| DIV = '/'
|
| MOD = '%%'
|
| MUL = '*'
|
| POW = '^'
|
| SUB = '-'
class Subquery(Expression)
| An explicit subquery. It may contain OuterRef() references to the outer
| query which will be resolved when it is applied to that query.
|
| Method resolution order:
| Subquery
| Expression
| BaseExpression
| Combinable
| builtins.object
|
| Methods defined here:
|
| __init__(self, queryset, output_field=None, **extra)
| Initialize self. See help(type(self)) for accurate signature.
|
| as_sql(self, compiler, connection, template=None, **extra_context)
| Responsible for returning a (sql, [params]) tuple to be included
| in the current query.
|
| Different backends can provide their own implementation, by
| providing an `as_{vendor}` method and patching the Expression:
|
| ```
| def override_as_sql(self, compiler, connection):
| # custom logic
| return super().as_sql(compiler, connection)
| setattr(Expression, 'as_' + connection.vendor, override_as_sql)
| ```
|
| Arguments:
| * compiler: the query compiler responsible for generating the query.
| Must have a compile method, returning a (sql, [params]) tuple.
| Calling compiler(value) will return a quoted `value`.
|
| * connection: the database connection used for the current query.
|
| Return: (sql, params)
| Where `sql` is a string containing ordered sql parameters to be
| replaced with the elements of the list `params`.
|
| copy(self)
|
| get_source_expressions(self)
|
| relabeled_clone(self, change_map)
|
| resolve_expression(self, query=None, allow_joins=True, reuse=None, summarize=False, for_save=False)
| Provide the chance to do any preprocessing or validation before being
| added to the query.
|
| Arguments:
| * query: the backend query implementation
| * allow_joins: boolean allowing or denying use of joins
| in this query
| * reuse: a set of reusable joins for multijoins
| * summarize: a terminal aggregate clause
| * for_save: whether this expression about to be used in a save or update
|
| Return: an Expression to be added to the query.
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| template = '(%(subquery)s)'
|
| ----------------------------------------------------------------------
| Methods inherited from BaseExpression:
|
| __eq__(self, other)
| Return self==value.
|
| __getstate__(self)
|
| __hash__(self)
| Return hash(self).
|
| asc(self, **kwargs)
|
| contains_aggregate = <django.utils.functional.cached_property object>
| contains_column_references = <django.utils.functional.cached_property object>
| contains_over_clause = <django.utils.functional.cached_property object>
| convert_value = <django.utils.functional.cached_property object>
| deconstruct(obj)
| Return a 3-tuple of class import path, positional arguments,
| and keyword arguments.
|
| desc(self, **kwargs)
|
| flatten(self)
| Recursively yield this expression and all subexpressions, in
| depth-first order.
|
| get_db_converters(self, connection)
|
| get_group_by_cols(self)
|
| get_lookup(self, lookup)
|
| get_source_fields(self)
| Return the underlying field types used by this aggregate.
|
| get_transform(self, name)
|
| output_field = <django.utils.functional.cached_property object>
| reverse_ordering(self)
|
| set_source_expressions(self, exprs)
|
| ----------------------------------------------------------------------
| Static methods inherited from BaseExpression:
|
| __new__(cls, *args, **kwargs)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from BaseExpression:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
|
| field
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from BaseExpression:
|
| filterable = True
|
| is_summary = False
|
| window_compatible = False
|
| ----------------------------------------------------------------------
| Methods inherited from Combinable:
|
| __add__(self, other)
|
| __and__(self, other)
|
| __mod__(self, other)
|
| __mul__(self, other)
|
| __or__(self, other)
|
| __pow__(self, other)
|
| __radd__(self, other)
|
| __rand__(self, other)
|
| __rmod__(self, other)
|
| __rmul__(self, other)
|
| __ror__(self, other)
|
| __rpow__(self, other)
|
| __rsub__(self, other)
|
| __rtruediv__(self, other)
|
| __sub__(self, other)
|
| __truediv__(self, other)
|
| bitand(self, other)
|
| bitleftshift(self, other)
|
| bitor(self, other)
|
| bitrightshift(self, other)
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from Combinable:
|
| ADD = '+'
|
| BITAND = '&'
|
| BITLEFTSHIFT = '<<'
|
| BITOR = '|'
|
| BITRIGHTSHIFT = '>>'
|
| DIV = '/'
|
| MOD = '%%'
|
| MUL = '*'
|
| POW = '^'
|
| SUB = '-'
class Sum(Aggregate)
| An SQL function call.
|
| Method resolution order:
| Sum
| Aggregate
| django.db.models.expressions.Func
| django.db.models.expressions.SQLiteNumericMixin
| django.db.models.expressions.Expression
| django.db.models.expressions.BaseExpression
| django.db.models.expressions.Combinable
| builtins.object
|
| Methods defined here:
|
| as_oracle(self, compiler, connection)
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| function = 'SUM'
|
| name = 'Sum'
|
| ----------------------------------------------------------------------
| Methods inherited from Aggregate:
|
| __init__(self, *args, filter=None, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| as_sql(self, compiler, connection, **extra_context)
| Responsible for returning a (sql, [params]) tuple to be included
| in the current query.
|
| Different backends can provide their own implementation, by
| providing an `as_{vendor}` method and patching the Expression:
|
| ```
| def override_as_sql(self, compiler, connection):
| # custom logic
| return super().as_sql(compiler, connection)
| setattr(Expression, 'as_' + connection.vendor, override_as_sql)
| ```
|
| Arguments:
| * compiler: the query compiler responsible for generating the query.
| Must have a compile method, returning a (sql, [params]) tuple.
| Calling compiler(value) will return a quoted `value`.
|
| * connection: the database connection used for the current query.
|
| Return: (sql, params)
| Where `sql` is a string containing ordered sql parameters to be
| replaced with the elements of the list `params`.
|
| get_group_by_cols(self)
|
| get_source_expressions(self)
|
| get_source_fields(self)
| Return the underlying field types used by this aggregate.
|
| resolve_expression(self, query=None, allow_joins=True, reuse=None, summarize=False, for_save=False)
| Provide the chance to do any preprocessing or validation before being
| added to the query.
|
| Arguments:
| * query: the backend query implementation
| * allow_joins: boolean allowing or denying use of joins
| in this query
| * reuse: a set of reusable joins for multijoins
| * summarize: a terminal aggregate clause
| * for_save: whether this expression about to be used in a save or update
|
| Return: an Expression to be added to the query.
|
| set_source_expressions(self, exprs)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from Aggregate:
|
| default_alias
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from Aggregate:
|
| contains_aggregate = True
|
| filter_template = '%s FILTER (WHERE %%(filter)s)'
|
| window_compatible = True
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.expressions.Func:
|
| __repr__(self)
| Return repr(self).
|
| copy(self)
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from django.db.models.expressions.Func:
|
| arg_joiner = ', '
|
| arity = None
|
| template = '%(function)s(%(expressions)s)'
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.expressions.SQLiteNumericMixin:
|
| as_sqlite(self, compiler, connection, **extra_context)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from django.db.models.expressions.SQLiteNumericMixin:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.expressions.BaseExpression:
|
| __eq__(self, other)
| Return self==value.
|
| __getstate__(self)
|
| __hash__(self)
| Return hash(self).
|
| asc(self, **kwargs)
|
| contains_column_references = <django.utils.functional.cached_property object>
| contains_over_clause = <django.utils.functional.cached_property object>
| convert_value = <django.utils.functional.cached_property object>
| deconstruct(obj)
| Return a 3-tuple of class import path, positional arguments,
| and keyword arguments.
|
| desc(self, **kwargs)
|
| flatten(self)
| Recursively yield this expression and all subexpressions, in
| depth-first order.
|
| get_db_converters(self, connection)
|
| get_lookup(self, lookup)
|
| get_transform(self, name)
|
| output_field = <django.utils.functional.cached_property object>
| relabeled_clone(self, change_map)
|
| reverse_ordering(self)
|
| ----------------------------------------------------------------------
| Static methods inherited from django.db.models.expressions.BaseExpression:
|
| __new__(cls, *args, **kwargs)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from django.db.models.expressions.BaseExpression:
|
| field
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from django.db.models.expressions.BaseExpression:
|
| filterable = True
|
| is_summary = False
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.expressions.Combinable:
|
| __add__(self, other)
|
| __and__(self, other)
|
| __mod__(self, other)
|
| __mul__(self, other)
|
| __or__(self, other)
|
| __pow__(self, other)
|
| __radd__(self, other)
|
| __rand__(self, other)
|
| __rmod__(self, other)
|
| __rmul__(self, other)
|
| __ror__(self, other)
|
| __rpow__(self, other)
|
| __rsub__(self, other)
|
| __rtruediv__(self, other)
|
| __sub__(self, other)
|
| __truediv__(self, other)
|
| bitand(self, other)
|
| bitleftshift(self, other)
|
| bitor(self, other)
|
| bitrightshift(self, other)
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from django.db.models.expressions.Combinable:
|
| ADD = '+'
|
| BITAND = '&'
|
| BITLEFTSHIFT = '<<'
|
| BITOR = '|'
|
| BITRIGHTSHIFT = '>>'
|
| DIV = '/'
|
| MOD = '%%'
|
| MUL = '*'
|
| POW = '^'
|
| SUB = '-'
class TextField(Field)
| Base class for all field types
|
| Method resolution order:
| TextField
| Field
| django.db.models.query_utils.RegisterLookupMixin
| builtins.object
|
| Methods defined here:
|
| formfield(self, **kwargs)
| Return a django.forms.Field instance for this field.
|
| get_internal_type(self)
|
| get_prep_value(self, value)
| Perform preliminary non-db specific value checks and conversions.
|
| to_python(self, value)
| Convert the input value into the expected Python data type, raising
| django.core.exceptions.ValidationError if the data can't be converted.
| Return the converted value. Subclasses should override this.
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| description = 'Text'
|
| ----------------------------------------------------------------------
| Methods inherited from Field:
|
| __copy__(self)
|
| __deepcopy__(self, memodict)
|
| __eq__(self, other)
| Return self==value.
|
| __ge__(self, other, NotImplemented=NotImplemented)
| Return a >= b. Computed by @total_ordering from (not a < b).
|
| __gt__(self, other, NotImplemented=NotImplemented)
| Return a > b. Computed by @total_ordering from (not a < b) and (a != b).
|
| __hash__(self)
| Return hash(self).
|
| __init__(self, verbose_name=None, name=None, primary_key=False, max_length=None, unique=False, blank=False, null=False, db_index=False, rel=None, default=<class 'django.db.models.fields.NOT_PROVIDED'>, editable=True, serialize=True, unique_for_date=None, unique_for_month=None, unique_for_year=None, choices=None, help_text='', db_column=None, db_tablespace=None, auto_created=False, validators=(), error_messages=None)
| Initialize self. See help(type(self)) for accurate signature.
|
| __le__(self, other, NotImplemented=NotImplemented)
| Return a <= b. Computed by @total_ordering from (a < b) or (a == b).
|
| __lt__(self, other)
| Return self<value.
|
| __reduce__(self)
| Pickling should return the model._meta.fields instance of the field,
| not a new copy of that field. So, use the app registry to load the
| model and then the field back.
|
| __repr__(self)
| Display the module, class, and name of the field.
|
| __str__(self)
| Return "app_label.model_label.field_name" for fields attached to
| models.
|
| cached_col = <django.utils.functional.cached_property object>
| cast_db_type(self, connection)
| Return the data type to use in the Cast() function.
|
| check(self, **kwargs)
|
| clean(self, value, model_instance)
| Convert the value's type and run validation. Validation errors
| from to_python() and validate() are propagated. Return the correct
| value if no error is raised.
|
| clone(self)
| Uses deconstruct() to clone a new copy of this Field.
| Will not preserve any class attachments/attribute names.
|
| contribute_to_class(self, cls, name, private_only=False)
| Register the field with the model class it belongs to.
|
| If private_only is True, create a separate instance of this field
| for every subclass of cls, even if cls is not an abstract model.
|
| db_check(self, connection)
| Return the database column check constraint for this field, for the
| provided connection. Works the same way as db_type() for the case that
| get_internal_type() does not map to a preexisting model field.
|
| db_parameters(self, connection)
| Extension of db_type(), providing a range of different return values
| (type, checks). This will look at db_type(), allowing custom model
| fields to override it.
|
| db_type(self, connection)
| Return the database column data type for this field, for the provided
| connection.
|
| db_type_parameters(self, connection)
|
| db_type_suffix(self, connection)
|
| deconstruct(self)
| Return enough information to recreate the field as a 4-tuple:
|
| * The name of the field on the model, if contribute_to_class() has
| been run.
| * The import path of the field, including the class:e.g.
| django.db.models.IntegerField This should be the most portable
| version, so less specific may be better.
| * A list of positional arguments.
| * A dict of keyword arguments.
|
| Note that the positional or keyword arguments must contain values of
| the following types (including inner values of collection types):
|
| * None, bool, str, int, float, complex, set, frozenset, list, tuple,
| dict
| * UUID
| * datetime.datetime (naive), datetime.date
| * top-level classes, top-level functions - will be referenced by their
| full import path
| * Storage instances - these have their own deconstruct() method
|
| This is because the values here must be serialized into a text format
| (possibly new Python code, possibly JSON) and these are the only types
| with encoding handlers defined.
|
| There's no need to return the exact way the field was instantiated this
| time, just ensure that the resulting field is the same - prefer keyword
| arguments over positional ones, and omit parameters with their default
| values.
|
| get_attname(self)
|
| get_attname_column(self)
|
| get_choices(self, include_blank=True, blank_choice=[('', '---------')], limit_choices_to=None)
| Return choices with a default blank choices included, for use
| as <select> choices for this field.
|
| get_col(self, alias, output_field=None)
|
| get_db_converters(self, connection)
|
| get_db_prep_save(self, value, connection)
| Return field's value prepared for saving into a database.
|
| get_db_prep_value(self, value, connection, prepared=False)
| Return field's value prepared for interacting with the database backend.
|
| Used by the default implementations of get_db_prep_save().
|
| get_default(self)
| Return the default value for this field.
|
| get_filter_kwargs_for_object(self, obj)
| Return a dict that when passed as kwargs to self.model.filter(), would
| yield all instances having the same value for this field as obj has.
|
| get_pk_value_on_save(self, instance)
| Hook to generate new PK values on save. This method is called when
| saving instances with no primary key value set. If this method returns
| something else than None, then the returned value is used when saving
| the new instance.
|
| has_default(self)
| Return a boolean of whether this field has a default value.
|
| pre_save(self, model_instance, add)
| Return field's value just before saving.
|
| rel_db_type(self, connection)
| Return the data type that a related field pointing to this field should
| use. For example, this method is called by ForeignKey and OneToOneField
| to determine its data type.
|
| run_validators(self, value)
|
| save_form_data(self, instance, data)
|
| select_format(self, compiler, sql, params)
| Custom format for select clauses. For example, GIS columns need to be
| selected as AsText(table.col) on MySQL as the table.col data can't be
| used by Django.
|
| set_attributes_from_name(self, name)
|
| validate(self, value, model_instance)
| Validate value and raise ValidationError if necessary. Subclasses
| should override this to provide validation logic.
|
| validators = <django.utils.functional.cached_property object>
| value_from_object(self, obj)
| Return the value of this field in the given model instance.
|
| value_to_string(self, obj)
| Return a string value of this field from the passed obj.
| This is used by the serialization framework.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from Field:
|
| db_tablespace
|
| flatchoices
| Flattened version of choices tuple.
|
| unique
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from Field:
|
| auto_creation_counter = -11
|
| class_lookups = {'contains': <class 'django.db.models.lookups.Contains...
|
| creation_counter = 58
|
| default_error_messages = {'blank': 'This field cannot be blank.', 'inv...
|
| default_validators = []
|
| empty_strings_allowed = True
|
| empty_values = [None, '', [], (), {}]
|
| hidden = False
|
| many_to_many = None
|
| many_to_one = None
|
| one_to_many = None
|
| one_to_one = None
|
| related_model = None
|
| system_check_deprecated_details = None
|
| system_check_removed_details = None
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| get_lookup(self, lookup_name)
|
| get_transform(self, lookup_name)
|
| ----------------------------------------------------------------------
| Class methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| get_lookups() from builtins.type
|
| register_lookup(lookup, lookup_name=None) from builtins.type
|
| ----------------------------------------------------------------------
| Static methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| merge_dicts(dicts)
| Merge dicts in reverse to preference the order of the original list. e.g.,
| merge_dicts([a, b]) will preference the keys in 'a' over those in 'b'.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
class TimeField(DateTimeCheckMixin, Field)
| Base class for all field types
|
| Method resolution order:
| TimeField
| DateTimeCheckMixin
| Field
| django.db.models.query_utils.RegisterLookupMixin
| builtins.object
|
| Methods defined here:
|
| __init__(self, verbose_name=None, name=None, auto_now=False, auto_now_add=False, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| deconstruct(self)
| Return enough information to recreate the field as a 4-tuple:
|
| * The name of the field on the model, if contribute_to_class() has
| been run.
| * The import path of the field, including the class:e.g.
| django.db.models.IntegerField This should be the most portable
| version, so less specific may be better.
| * A list of positional arguments.
| * A dict of keyword arguments.
|
| Note that the positional or keyword arguments must contain values of
| the following types (including inner values of collection types):
|
| * None, bool, str, int, float, complex, set, frozenset, list, tuple,
| dict
| * UUID
| * datetime.datetime (naive), datetime.date
| * top-level classes, top-level functions - will be referenced by their
| full import path
| * Storage instances - these have their own deconstruct() method
|
| This is because the values here must be serialized into a text format
| (possibly new Python code, possibly JSON) and these are the only types
| with encoding handlers defined.
|
| There's no need to return the exact way the field was instantiated this
| time, just ensure that the resulting field is the same - prefer keyword
| arguments over positional ones, and omit parameters with their default
| values.
|
| formfield(self, **kwargs)
| Return a django.forms.Field instance for this field.
|
| get_db_prep_value(self, value, connection, prepared=False)
| Return field's value prepared for interacting with the database backend.
|
| Used by the default implementations of get_db_prep_save().
|
| get_internal_type(self)
|
| get_prep_value(self, value)
| Perform preliminary non-db specific value checks and conversions.
|
| pre_save(self, model_instance, add)
| Return field's value just before saving.
|
| to_python(self, value)
| Convert the input value into the expected Python data type, raising
| django.core.exceptions.ValidationError if the data can't be converted.
| Return the converted value. Subclasses should override this.
|
| value_to_string(self, obj)
| Return a string value of this field from the passed obj.
| This is used by the serialization framework.
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| class_lookups = {'hour': <class 'django.db.models.functions.datetime.E...
|
| default_error_messages = {'invalid': "'%(value)s' value has an invalid...
|
| description = 'Time'
|
| empty_strings_allowed = False
|
| ----------------------------------------------------------------------
| Methods inherited from DateTimeCheckMixin:
|
| check(self, **kwargs)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from DateTimeCheckMixin:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
|
| ----------------------------------------------------------------------
| Methods inherited from Field:
|
| __copy__(self)
|
| __deepcopy__(self, memodict)
|
| __eq__(self, other)
| Return self==value.
|
| __ge__(self, other, NotImplemented=NotImplemented)
| Return a >= b. Computed by @total_ordering from (not a < b).
|
| __gt__(self, other, NotImplemented=NotImplemented)
| Return a > b. Computed by @total_ordering from (not a < b) and (a != b).
|
| __hash__(self)
| Return hash(self).
|
| __le__(self, other, NotImplemented=NotImplemented)
| Return a <= b. Computed by @total_ordering from (a < b) or (a == b).
|
| __lt__(self, other)
| Return self<value.
|
| __reduce__(self)
| Pickling should return the model._meta.fields instance of the field,
| not a new copy of that field. So, use the app registry to load the
| model and then the field back.
|
| __repr__(self)
| Display the module, class, and name of the field.
|
| __str__(self)
| Return "app_label.model_label.field_name" for fields attached to
| models.
|
| cached_col = <django.utils.functional.cached_property object>
| cast_db_type(self, connection)
| Return the data type to use in the Cast() function.
|
| clean(self, value, model_instance)
| Convert the value's type and run validation. Validation errors
| from to_python() and validate() are propagated. Return the correct
| value if no error is raised.
|
| clone(self)
| Uses deconstruct() to clone a new copy of this Field.
| Will not preserve any class attachments/attribute names.
|
| contribute_to_class(self, cls, name, private_only=False)
| Register the field with the model class it belongs to.
|
| If private_only is True, create a separate instance of this field
| for every subclass of cls, even if cls is not an abstract model.
|
| db_check(self, connection)
| Return the database column check constraint for this field, for the
| provided connection. Works the same way as db_type() for the case that
| get_internal_type() does not map to a preexisting model field.
|
| db_parameters(self, connection)
| Extension of db_type(), providing a range of different return values
| (type, checks). This will look at db_type(), allowing custom model
| fields to override it.
|
| db_type(self, connection)
| Return the database column data type for this field, for the provided
| connection.
|
| db_type_parameters(self, connection)
|
| db_type_suffix(self, connection)
|
| get_attname(self)
|
| get_attname_column(self)
|
| get_choices(self, include_blank=True, blank_choice=[('', '---------')], limit_choices_to=None)
| Return choices with a default blank choices included, for use
| as <select> choices for this field.
|
| get_col(self, alias, output_field=None)
|
| get_db_converters(self, connection)
|
| get_db_prep_save(self, value, connection)
| Return field's value prepared for saving into a database.
|
| get_default(self)
| Return the default value for this field.
|
| get_filter_kwargs_for_object(self, obj)
| Return a dict that when passed as kwargs to self.model.filter(), would
| yield all instances having the same value for this field as obj has.
|
| get_pk_value_on_save(self, instance)
| Hook to generate new PK values on save. This method is called when
| saving instances with no primary key value set. If this method returns
| something else than None, then the returned value is used when saving
| the new instance.
|
| has_default(self)
| Return a boolean of whether this field has a default value.
|
| rel_db_type(self, connection)
| Return the data type that a related field pointing to this field should
| use. For example, this method is called by ForeignKey and OneToOneField
| to determine its data type.
|
| run_validators(self, value)
|
| save_form_data(self, instance, data)
|
| select_format(self, compiler, sql, params)
| Custom format for select clauses. For example, GIS columns need to be
| selected as AsText(table.col) on MySQL as the table.col data can't be
| used by Django.
|
| set_attributes_from_name(self, name)
|
| validate(self, value, model_instance)
| Validate value and raise ValidationError if necessary. Subclasses
| should override this to provide validation logic.
|
| validators = <django.utils.functional.cached_property object>
| value_from_object(self, obj)
| Return the value of this field in the given model instance.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from Field:
|
| db_tablespace
|
| flatchoices
| Flattened version of choices tuple.
|
| unique
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from Field:
|
| auto_creation_counter = -11
|
| creation_counter = 58
|
| default_validators = []
|
| empty_values = [None, '', [], (), {}]
|
| hidden = False
|
| many_to_many = None
|
| many_to_one = None
|
| one_to_many = None
|
| one_to_one = None
|
| related_model = None
|
| system_check_deprecated_details = None
|
| system_check_removed_details = None
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| get_lookup(self, lookup_name)
|
| get_transform(self, lookup_name)
|
| ----------------------------------------------------------------------
| Class methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| get_lookups() from builtins.type
|
| register_lookup(lookup, lookup_name=None) from builtins.type
|
| ----------------------------------------------------------------------
| Static methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| merge_dicts(dicts)
| Merge dicts in reverse to preference the order of the original list. e.g.,
| merge_dicts([a, b]) will preference the keys in 'a' over those in 'b'.
class Transform(django.db.models.query_utils.RegisterLookupMixin, django.db.models.expressions.Func)
| RegisterLookupMixin() is first so that get_lookup() and get_transform()
| first examine self and then check output_field.
|
| Method resolution order:
| Transform
| django.db.models.query_utils.RegisterLookupMixin
| django.db.models.expressions.Func
| django.db.models.expressions.SQLiteNumericMixin
| django.db.models.expressions.Expression
| django.db.models.expressions.BaseExpression
| django.db.models.expressions.Combinable
| builtins.object
|
| Methods defined here:
|
| get_bilateral_transforms(self)
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| lhs
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| arity = 1
|
| bilateral = False
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| get_lookup(self, lookup_name)
|
| get_transform(self, lookup_name)
|
| ----------------------------------------------------------------------
| Class methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| get_lookups() from builtins.type
|
| register_lookup(lookup, lookup_name=None) from builtins.type
|
| ----------------------------------------------------------------------
| Static methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| merge_dicts(dicts)
| Merge dicts in reverse to preference the order of the original list. e.g.,
| merge_dicts([a, b]) will preference the keys in 'a' over those in 'b'.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.expressions.Func:
|
| __init__(self, *expressions, output_field=None, **extra)
| Initialize self. See help(type(self)) for accurate signature.
|
| __repr__(self)
| Return repr(self).
|
| as_sql(self, compiler, connection, function=None, template=None, arg_joiner=None, **extra_context)
| Responsible for returning a (sql, [params]) tuple to be included
| in the current query.
|
| Different backends can provide their own implementation, by
| providing an `as_{vendor}` method and patching the Expression:
|
| ```
| def override_as_sql(self, compiler, connection):
| # custom logic
| return super().as_sql(compiler, connection)
| setattr(Expression, 'as_' + connection.vendor, override_as_sql)
| ```
|
| Arguments:
| * compiler: the query compiler responsible for generating the query.
| Must have a compile method, returning a (sql, [params]) tuple.
| Calling compiler(value) will return a quoted `value`.
|
| * connection: the database connection used for the current query.
|
| Return: (sql, params)
| Where `sql` is a string containing ordered sql parameters to be
| replaced with the elements of the list `params`.
|
| copy(self)
|
| get_source_expressions(self)
|
| resolve_expression(self, query=None, allow_joins=True, reuse=None, summarize=False, for_save=False)
| Provide the chance to do any preprocessing or validation before being
| added to the query.
|
| Arguments:
| * query: the backend query implementation
| * allow_joins: boolean allowing or denying use of joins
| in this query
| * reuse: a set of reusable joins for multijoins
| * summarize: a terminal aggregate clause
| * for_save: whether this expression about to be used in a save or update
|
| Return: an Expression to be added to the query.
|
| set_source_expressions(self, exprs)
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from django.db.models.expressions.Func:
|
| arg_joiner = ', '
|
| function = None
|
| template = '%(function)s(%(expressions)s)'
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.expressions.SQLiteNumericMixin:
|
| as_sqlite(self, compiler, connection, **extra_context)
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.expressions.BaseExpression:
|
| __eq__(self, other)
| Return self==value.
|
| __getstate__(self)
|
| __hash__(self)
| Return hash(self).
|
| asc(self, **kwargs)
|
| contains_aggregate = <django.utils.functional.cached_property object>
| contains_column_references = <django.utils.functional.cached_property object>
| contains_over_clause = <django.utils.functional.cached_property object>
| convert_value = <django.utils.functional.cached_property object>
| deconstruct(obj)
| Return a 3-tuple of class import path, positional arguments,
| and keyword arguments.
|
| desc(self, **kwargs)
|
| flatten(self)
| Recursively yield this expression and all subexpressions, in
| depth-first order.
|
| get_db_converters(self, connection)
|
| get_group_by_cols(self)
|
| get_source_fields(self)
| Return the underlying field types used by this aggregate.
|
| output_field = <django.utils.functional.cached_property object>
| relabeled_clone(self, change_map)
|
| reverse_ordering(self)
|
| ----------------------------------------------------------------------
| Static methods inherited from django.db.models.expressions.BaseExpression:
|
| __new__(cls, *args, **kwargs)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from django.db.models.expressions.BaseExpression:
|
| field
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from django.db.models.expressions.BaseExpression:
|
| filterable = True
|
| is_summary = False
|
| window_compatible = False
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.expressions.Combinable:
|
| __add__(self, other)
|
| __and__(self, other)
|
| __mod__(self, other)
|
| __mul__(self, other)
|
| __or__(self, other)
|
| __pow__(self, other)
|
| __radd__(self, other)
|
| __rand__(self, other)
|
| __rmod__(self, other)
|
| __rmul__(self, other)
|
| __ror__(self, other)
|
| __rpow__(self, other)
|
| __rsub__(self, other)
|
| __rtruediv__(self, other)
|
| __sub__(self, other)
|
| __truediv__(self, other)
|
| bitand(self, other)
|
| bitleftshift(self, other)
|
| bitor(self, other)
|
| bitrightshift(self, other)
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from django.db.models.expressions.Combinable:
|
| ADD = '+'
|
| BITAND = '&'
|
| BITLEFTSHIFT = '<<'
|
| BITOR = '|'
|
| BITRIGHTSHIFT = '>>'
|
| DIV = '/'
|
| MOD = '%%'
|
| MUL = '*'
|
| POW = '^'
|
| SUB = '-'
class URLField(CharField)
| Base class for all field types
|
| Method resolution order:
| URLField
| CharField
| Field
| django.db.models.query_utils.RegisterLookupMixin
| builtins.object
|
| Methods defined here:
|
| __init__(self, verbose_name=None, name=None, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| deconstruct(self)
| Return enough information to recreate the field as a 4-tuple:
|
| * The name of the field on the model, if contribute_to_class() has
| been run.
| * The import path of the field, including the class:e.g.
| django.db.models.IntegerField This should be the most portable
| version, so less specific may be better.
| * A list of positional arguments.
| * A dict of keyword arguments.
|
| Note that the positional or keyword arguments must contain values of
| the following types (including inner values of collection types):
|
| * None, bool, str, int, float, complex, set, frozenset, list, tuple,
| dict
| * UUID
| * datetime.datetime (naive), datetime.date
| * top-level classes, top-level functions - will be referenced by their
| full import path
| * Storage instances - these have their own deconstruct() method
|
| This is because the values here must be serialized into a text format
| (possibly new Python code, possibly JSON) and these are the only types
| with encoding handlers defined.
|
| There's no need to return the exact way the field was instantiated this
| time, just ensure that the resulting field is the same - prefer keyword
| arguments over positional ones, and omit parameters with their default
| values.
|
| formfield(self, **kwargs)
| Return a django.forms.Field instance for this field.
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| default_validators = [<django.core.validators.URLValidator object>]
|
| description = 'URL'
|
| ----------------------------------------------------------------------
| Methods inherited from CharField:
|
| cast_db_type(self, connection)
| Return the data type to use in the Cast() function.
|
| check(self, **kwargs)
|
| get_internal_type(self)
|
| get_prep_value(self, value)
| Perform preliminary non-db specific value checks and conversions.
|
| to_python(self, value)
| Convert the input value into the expected Python data type, raising
| django.core.exceptions.ValidationError if the data can't be converted.
| Return the converted value. Subclasses should override this.
|
| ----------------------------------------------------------------------
| Methods inherited from Field:
|
| __copy__(self)
|
| __deepcopy__(self, memodict)
|
| __eq__(self, other)
| Return self==value.
|
| __ge__(self, other, NotImplemented=NotImplemented)
| Return a >= b. Computed by @total_ordering from (not a < b).
|
| __gt__(self, other, NotImplemented=NotImplemented)
| Return a > b. Computed by @total_ordering from (not a < b) and (a != b).
|
| __hash__(self)
| Return hash(self).
|
| __le__(self, other, NotImplemented=NotImplemented)
| Return a <= b. Computed by @total_ordering from (a < b) or (a == b).
|
| __lt__(self, other)
| Return self<value.
|
| __reduce__(self)
| Pickling should return the model._meta.fields instance of the field,
| not a new copy of that field. So, use the app registry to load the
| model and then the field back.
|
| __repr__(self)
| Display the module, class, and name of the field.
|
| __str__(self)
| Return "app_label.model_label.field_name" for fields attached to
| models.
|
| cached_col = <django.utils.functional.cached_property object>
| clean(self, value, model_instance)
| Convert the value's type and run validation. Validation errors
| from to_python() and validate() are propagated. Return the correct
| value if no error is raised.
|
| clone(self)
| Uses deconstruct() to clone a new copy of this Field.
| Will not preserve any class attachments/attribute names.
|
| contribute_to_class(self, cls, name, private_only=False)
| Register the field with the model class it belongs to.
|
| If private_only is True, create a separate instance of this field
| for every subclass of cls, even if cls is not an abstract model.
|
| db_check(self, connection)
| Return the database column check constraint for this field, for the
| provided connection. Works the same way as db_type() for the case that
| get_internal_type() does not map to a preexisting model field.
|
| db_parameters(self, connection)
| Extension of db_type(), providing a range of different return values
| (type, checks). This will look at db_type(), allowing custom model
| fields to override it.
|
| db_type(self, connection)
| Return the database column data type for this field, for the provided
| connection.
|
| db_type_parameters(self, connection)
|
| db_type_suffix(self, connection)
|
| get_attname(self)
|
| get_attname_column(self)
|
| get_choices(self, include_blank=True, blank_choice=[('', '---------')], limit_choices_to=None)
| Return choices with a default blank choices included, for use
| as <select> choices for this field.
|
| get_col(self, alias, output_field=None)
|
| get_db_converters(self, connection)
|
| get_db_prep_save(self, value, connection)
| Return field's value prepared for saving into a database.
|
| get_db_prep_value(self, value, connection, prepared=False)
| Return field's value prepared for interacting with the database backend.
|
| Used by the default implementations of get_db_prep_save().
|
| get_default(self)
| Return the default value for this field.
|
| get_filter_kwargs_for_object(self, obj)
| Return a dict that when passed as kwargs to self.model.filter(), would
| yield all instances having the same value for this field as obj has.
|
| get_pk_value_on_save(self, instance)
| Hook to generate new PK values on save. This method is called when
| saving instances with no primary key value set. If this method returns
| something else than None, then the returned value is used when saving
| the new instance.
|
| has_default(self)
| Return a boolean of whether this field has a default value.
|
| pre_save(self, model_instance, add)
| Return field's value just before saving.
|
| rel_db_type(self, connection)
| Return the data type that a related field pointing to this field should
| use. For example, this method is called by ForeignKey and OneToOneField
| to determine its data type.
|
| run_validators(self, value)
|
| save_form_data(self, instance, data)
|
| select_format(self, compiler, sql, params)
| Custom format for select clauses. For example, GIS columns need to be
| selected as AsText(table.col) on MySQL as the table.col data can't be
| used by Django.
|
| set_attributes_from_name(self, name)
|
| validate(self, value, model_instance)
| Validate value and raise ValidationError if necessary. Subclasses
| should override this to provide validation logic.
|
| validators = <django.utils.functional.cached_property object>
| value_from_object(self, obj)
| Return the value of this field in the given model instance.
|
| value_to_string(self, obj)
| Return a string value of this field from the passed obj.
| This is used by the serialization framework.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from Field:
|
| db_tablespace
|
| flatchoices
| Flattened version of choices tuple.
|
| unique
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from Field:
|
| auto_creation_counter = -11
|
| class_lookups = {'contains': <class 'django.db.models.lookups.Contains...
|
| creation_counter = 58
|
| default_error_messages = {'blank': 'This field cannot be blank.', 'inv...
|
| empty_strings_allowed = True
|
| empty_values = [None, '', [], (), {}]
|
| hidden = False
|
| many_to_many = None
|
| many_to_one = None
|
| one_to_many = None
|
| one_to_one = None
|
| related_model = None
|
| system_check_deprecated_details = None
|
| system_check_removed_details = None
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| get_lookup(self, lookup_name)
|
| get_transform(self, lookup_name)
|
| ----------------------------------------------------------------------
| Class methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| get_lookups() from builtins.type
|
| register_lookup(lookup, lookup_name=None) from builtins.type
|
| ----------------------------------------------------------------------
| Static methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| merge_dicts(dicts)
| Merge dicts in reverse to preference the order of the original list. e.g.,
| merge_dicts([a, b]) will preference the keys in 'a' over those in 'b'.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
class UUIDField(Field)
| Base class for all field types
|
| Method resolution order:
| UUIDField
| Field
| django.db.models.query_utils.RegisterLookupMixin
| builtins.object
|
| Methods defined here:
|
| __init__(self, verbose_name=None, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| deconstruct(self)
| Return enough information to recreate the field as a 4-tuple:
|
| * The name of the field on the model, if contribute_to_class() has
| been run.
| * The import path of the field, including the class:e.g.
| django.db.models.IntegerField This should be the most portable
| version, so less specific may be better.
| * A list of positional arguments.
| * A dict of keyword arguments.
|
| Note that the positional or keyword arguments must contain values of
| the following types (including inner values of collection types):
|
| * None, bool, str, int, float, complex, set, frozenset, list, tuple,
| dict
| * UUID
| * datetime.datetime (naive), datetime.date
| * top-level classes, top-level functions - will be referenced by their
| full import path
| * Storage instances - these have their own deconstruct() method
|
| This is because the values here must be serialized into a text format
| (possibly new Python code, possibly JSON) and these are the only types
| with encoding handlers defined.
|
| There's no need to return the exact way the field was instantiated this
| time, just ensure that the resulting field is the same - prefer keyword
| arguments over positional ones, and omit parameters with their default
| values.
|
| formfield(self, **kwargs)
| Return a django.forms.Field instance for this field.
|
| get_db_prep_value(self, value, connection, prepared=False)
| Return field's value prepared for interacting with the database backend.
|
| Used by the default implementations of get_db_prep_save().
|
| get_internal_type(self)
|
| to_python(self, value)
| Convert the input value into the expected Python data type, raising
| django.core.exceptions.ValidationError if the data can't be converted.
| Return the converted value. Subclasses should override this.
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| default_error_messages = {'invalid': "'%(value)s' is not a valid UUID....
|
| description = 'Universally unique identifier'
|
| empty_strings_allowed = False
|
| ----------------------------------------------------------------------
| Methods inherited from Field:
|
| __copy__(self)
|
| __deepcopy__(self, memodict)
|
| __eq__(self, other)
| Return self==value.
|
| __ge__(self, other, NotImplemented=NotImplemented)
| Return a >= b. Computed by @total_ordering from (not a < b).
|
| __gt__(self, other, NotImplemented=NotImplemented)
| Return a > b. Computed by @total_ordering from (not a < b) and (a != b).
|
| __hash__(self)
| Return hash(self).
|
| __le__(self, other, NotImplemented=NotImplemented)
| Return a <= b. Computed by @total_ordering from (a < b) or (a == b).
|
| __lt__(self, other)
| Return self<value.
|
| __reduce__(self)
| Pickling should return the model._meta.fields instance of the field,
| not a new copy of that field. So, use the app registry to load the
| model and then the field back.
|
| __repr__(self)
| Display the module, class, and name of the field.
|
| __str__(self)
| Return "app_label.model_label.field_name" for fields attached to
| models.
|
| cached_col = <django.utils.functional.cached_property object>
| cast_db_type(self, connection)
| Return the data type to use in the Cast() function.
|
| check(self, **kwargs)
|
| clean(self, value, model_instance)
| Convert the value's type and run validation. Validation errors
| from to_python() and validate() are propagated. Return the correct
| value if no error is raised.
|
| clone(self)
| Uses deconstruct() to clone a new copy of this Field.
| Will not preserve any class attachments/attribute names.
|
| contribute_to_class(self, cls, name, private_only=False)
| Register the field with the model class it belongs to.
|
| If private_only is True, create a separate instance of this field
| for every subclass of cls, even if cls is not an abstract model.
|
| db_check(self, connection)
| Return the database column check constraint for this field, for the
| provided connection. Works the same way as db_type() for the case that
| get_internal_type() does not map to a preexisting model field.
|
| db_parameters(self, connection)
| Extension of db_type(), providing a range of different return values
| (type, checks). This will look at db_type(), allowing custom model
| fields to override it.
|
| db_type(self, connection)
| Return the database column data type for this field, for the provided
| connection.
|
| db_type_parameters(self, connection)
|
| db_type_suffix(self, connection)
|
| get_attname(self)
|
| get_attname_column(self)
|
| get_choices(self, include_blank=True, blank_choice=[('', '---------')], limit_choices_to=None)
| Return choices with a default blank choices included, for use
| as <select> choices for this field.
|
| get_col(self, alias, output_field=None)
|
| get_db_converters(self, connection)
|
| get_db_prep_save(self, value, connection)
| Return field's value prepared for saving into a database.
|
| get_default(self)
| Return the default value for this field.
|
| get_filter_kwargs_for_object(self, obj)
| Return a dict that when passed as kwargs to self.model.filter(), would
| yield all instances having the same value for this field as obj has.
|
| get_pk_value_on_save(self, instance)
| Hook to generate new PK values on save. This method is called when
| saving instances with no primary key value set. If this method returns
| something else than None, then the returned value is used when saving
| the new instance.
|
| get_prep_value(self, value)
| Perform preliminary non-db specific value checks and conversions.
|
| has_default(self)
| Return a boolean of whether this field has a default value.
|
| pre_save(self, model_instance, add)
| Return field's value just before saving.
|
| rel_db_type(self, connection)
| Return the data type that a related field pointing to this field should
| use. For example, this method is called by ForeignKey and OneToOneField
| to determine its data type.
|
| run_validators(self, value)
|
| save_form_data(self, instance, data)
|
| select_format(self, compiler, sql, params)
| Custom format for select clauses. For example, GIS columns need to be
| selected as AsText(table.col) on MySQL as the table.col data can't be
| used by Django.
|
| set_attributes_from_name(self, name)
|
| validate(self, value, model_instance)
| Validate value and raise ValidationError if necessary. Subclasses
| should override this to provide validation logic.
|
| validators = <django.utils.functional.cached_property object>
| value_from_object(self, obj)
| Return the value of this field in the given model instance.
|
| value_to_string(self, obj)
| Return a string value of this field from the passed obj.
| This is used by the serialization framework.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from Field:
|
| db_tablespace
|
| flatchoices
| Flattened version of choices tuple.
|
| unique
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from Field:
|
| auto_creation_counter = -11
|
| class_lookups = {'contains': <class 'django.db.models.lookups.Contains...
|
| creation_counter = 58
|
| default_validators = []
|
| empty_values = [None, '', [], (), {}]
|
| hidden = False
|
| many_to_many = None
|
| many_to_one = None
|
| one_to_many = None
|
| one_to_one = None
|
| related_model = None
|
| system_check_deprecated_details = None
|
| system_check_removed_details = None
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| get_lookup(self, lookup_name)
|
| get_transform(self, lookup_name)
|
| ----------------------------------------------------------------------
| Class methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| get_lookups() from builtins.type
|
| register_lookup(lookup, lookup_name=None) from builtins.type
|
| ----------------------------------------------------------------------
| Static methods inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| merge_dicts(dicts)
| Merge dicts in reverse to preference the order of the original list. e.g.,
| merge_dicts([a, b]) will preference the keys in 'a' over those in 'b'.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from django.db.models.query_utils.RegisterLookupMixin:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
class Value(Expression)
| Represent a wrapped value as a node within an expression.
|
| Method resolution order:
| Value
| Expression
| BaseExpression
| Combinable
| builtins.object
|
| Methods defined here:
|
| __init__(self, value, output_field=None)
| Arguments:
| * value: the value this expression represents. The value will be
| added into the sql parameter list and properly quoted.
|
| * output_field: an instance of the model field type that this
| expression will return, such as IntegerField() or CharField().
|
| __repr__(self)
| Return repr(self).
|
| as_sql(self, compiler, connection)
| Responsible for returning a (sql, [params]) tuple to be included
| in the current query.
|
| Different backends can provide their own implementation, by
| providing an `as_{vendor}` method and patching the Expression:
|
| ```
| def override_as_sql(self, compiler, connection):
| # custom logic
| return super().as_sql(compiler, connection)
| setattr(Expression, 'as_' + connection.vendor, override_as_sql)
| ```
|
| Arguments:
| * compiler: the query compiler responsible for generating the query.
| Must have a compile method, returning a (sql, [params]) tuple.
| Calling compiler(value) will return a quoted `value`.
|
| * connection: the database connection used for the current query.
|
| Return: (sql, params)
| Where `sql` is a string containing ordered sql parameters to be
| replaced with the elements of the list `params`.
|
| get_group_by_cols(self)
|
| resolve_expression(self, query=None, allow_joins=True, reuse=None, summarize=False, for_save=False)
| Provide the chance to do any preprocessing or validation before being
| added to the query.
|
| Arguments:
| * query: the backend query implementation
| * allow_joins: boolean allowing or denying use of joins
| in this query
| * reuse: a set of reusable joins for multijoins
| * summarize: a terminal aggregate clause
| * for_save: whether this expression about to be used in a save or update
|
| Return: an Expression to be added to the query.
|
| ----------------------------------------------------------------------
| Methods inherited from BaseExpression:
|
| __eq__(self, other)
| Return self==value.
|
| __getstate__(self)
|
| __hash__(self)
| Return hash(self).
|
| asc(self, **kwargs)
|
| contains_aggregate = <django.utils.functional.cached_property object>
| contains_column_references = <django.utils.functional.cached_property object>
| contains_over_clause = <django.utils.functional.cached_property object>
| convert_value = <django.utils.functional.cached_property object>
| copy(self)
|
| deconstruct(obj)
| Return a 3-tuple of class import path, positional arguments,
| and keyword arguments.
|
| desc(self, **kwargs)
|
| flatten(self)
| Recursively yield this expression and all subexpressions, in
| depth-first order.
|
| get_db_converters(self, connection)
|
| get_lookup(self, lookup)
|
| get_source_expressions(self)
|
| get_source_fields(self)
| Return the underlying field types used by this aggregate.
|
| get_transform(self, name)
|
| output_field = <django.utils.functional.cached_property object>
| relabeled_clone(self, change_map)
|
| reverse_ordering(self)
|
| set_source_expressions(self, exprs)
|
| ----------------------------------------------------------------------
| Static methods inherited from BaseExpression:
|
| __new__(cls, *args, **kwargs)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from BaseExpression:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
|
| field
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from BaseExpression:
|
| filterable = True
|
| is_summary = False
|
| window_compatible = False
|
| ----------------------------------------------------------------------
| Methods inherited from Combinable:
|
| __add__(self, other)
|
| __and__(self, other)
|
| __mod__(self, other)
|
| __mul__(self, other)
|
| __or__(self, other)
|
| __pow__(self, other)
|
| __radd__(self, other)
|
| __rand__(self, other)
|
| __rmod__(self, other)
|
| __rmul__(self, other)
|
| __ror__(self, other)
|
| __rpow__(self, other)
|
| __rsub__(self, other)
|
| __rtruediv__(self, other)
|
| __sub__(self, other)
|
| __truediv__(self, other)
|
| bitand(self, other)
|
| bitleftshift(self, other)
|
| bitor(self, other)
|
| bitrightshift(self, other)
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from Combinable:
|
| ADD = '+'
|
| BITAND = '&'
|
| BITLEFTSHIFT = '<<'
|
| BITOR = '|'
|
| BITRIGHTSHIFT = '>>'
|
| DIV = '/'
|
| MOD = '%%'
|
| MUL = '*'
|
| POW = '^'
|
| SUB = '-'
class ValueRange(WindowFrame)
| Model the frame clause in window expressions. There are two types of frame
| clauses which are subclasses, however, all processing and validation (by no
| means intended to be complete) is done here. Thus, providing an end for a
| frame is optional (the default is UNBOUNDED FOLLOWING, which is the last
| row in the frame).
|
| Method resolution order:
| ValueRange
| WindowFrame
| Expression
| BaseExpression
| Combinable
| builtins.object
|
| Methods defined here:
|
| window_frame_start_end(self, connection, start, end)
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| frame_type = 'RANGE'
|
| ----------------------------------------------------------------------
| Methods inherited from WindowFrame:
|
| __init__(self, start=None, end=None)
| Initialize self. See help(type(self)) for accurate signature.
|
| __repr__(self)
| Return repr(self).
|
| __str__(self)
| Return str(self).
|
| as_sql(self, compiler, connection)
| Responsible for returning a (sql, [params]) tuple to be included
| in the current query.
|
| Different backends can provide their own implementation, by
| providing an `as_{vendor}` method and patching the Expression:
|
| ```
| def override_as_sql(self, compiler, connection):
| # custom logic
| return super().as_sql(compiler, connection)
| setattr(Expression, 'as_' + connection.vendor, override_as_sql)
| ```
|
| Arguments:
| * compiler: the query compiler responsible for generating the query.
| Must have a compile method, returning a (sql, [params]) tuple.
| Calling compiler(value) will return a quoted `value`.
|
| * connection: the database connection used for the current query.
|
| Return: (sql, params)
| Where `sql` is a string containing ordered sql parameters to be
| replaced with the elements of the list `params`.
|
| get_group_by_cols(self)
|
| get_source_expressions(self)
|
| set_source_expressions(self, exprs)
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from WindowFrame:
|
| template = '%(frame_type)s BETWEEN %(start)s AND %(end)s'
|
| ----------------------------------------------------------------------
| Methods inherited from BaseExpression:
|
| __eq__(self, other)
| Return self==value.
|
| __getstate__(self)
|
| __hash__(self)
| Return hash(self).
|
| asc(self, **kwargs)
|
| contains_aggregate = <django.utils.functional.cached_property object>
| contains_column_references = <django.utils.functional.cached_property object>
| contains_over_clause = <django.utils.functional.cached_property object>
| convert_value = <django.utils.functional.cached_property object>
| copy(self)
|
| deconstruct(obj)
| Return a 3-tuple of class import path, positional arguments,
| and keyword arguments.
|
| desc(self, **kwargs)
|
| flatten(self)
| Recursively yield this expression and all subexpressions, in
| depth-first order.
|
| get_db_converters(self, connection)
|
| get_lookup(self, lookup)
|
| get_source_fields(self)
| Return the underlying field types used by this aggregate.
|
| get_transform(self, name)
|
| output_field = <django.utils.functional.cached_property object>
| relabeled_clone(self, change_map)
|
| resolve_expression(self, query=None, allow_joins=True, reuse=None, summarize=False, for_save=False)
| Provide the chance to do any preprocessing or validation before being
| added to the query.
|
| Arguments:
| * query: the backend query implementation
| * allow_joins: boolean allowing or denying use of joins
| in this query
| * reuse: a set of reusable joins for multijoins
| * summarize: a terminal aggregate clause
| * for_save: whether this expression about to be used in a save or update
|
| Return: an Expression to be added to the query.
|
| reverse_ordering(self)
|
| ----------------------------------------------------------------------
| Static methods inherited from BaseExpression:
|
| __new__(cls, *args, **kwargs)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from BaseExpression:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
|
| field
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from BaseExpression:
|
| filterable = True
|
| is_summary = False
|
| window_compatible = False
|
| ----------------------------------------------------------------------
| Methods inherited from Combinable:
|
| __add__(self, other)
|
| __and__(self, other)
|
| __mod__(self, other)
|
| __mul__(self, other)
|
| __or__(self, other)
|
| __pow__(self, other)
|
| __radd__(self, other)
|
| __rand__(self, other)
|
| __rmod__(self, other)
|
| __rmul__(self, other)
|
| __ror__(self, other)
|
| __rpow__(self, other)
|
| __rsub__(self, other)
|
| __rtruediv__(self, other)
|
| __sub__(self, other)
|
| __truediv__(self, other)
|
| bitand(self, other)
|
| bitleftshift(self, other)
|
| bitor(self, other)
|
| bitrightshift(self, other)
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from Combinable:
|
| ADD = '+'
|
| BITAND = '&'
|
| BITLEFTSHIFT = '<<'
|
| BITOR = '|'
|
| BITRIGHTSHIFT = '>>'
|
| DIV = '/'
|
| MOD = '%%'
|
| MUL = '*'
|
| POW = '^'
|
| SUB = '-'
class Variance(Aggregate)
| An SQL function call.
|
| Method resolution order:
| Variance
| Aggregate
| django.db.models.expressions.Func
| django.db.models.expressions.SQLiteNumericMixin
| django.db.models.expressions.Expression
| django.db.models.expressions.BaseExpression
| django.db.models.expressions.Combinable
| builtins.object
|
| Methods defined here:
|
| __init__(self, expression, sample=False, **extra)
| Initialize self. See help(type(self)) for accurate signature.
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| name = 'Variance'
|
| output_field = <django.db.models.fields.FloatField>
|
| ----------------------------------------------------------------------
| Methods inherited from Aggregate:
|
| as_sql(self, compiler, connection, **extra_context)
| Responsible for returning a (sql, [params]) tuple to be included
| in the current query.
|
| Different backends can provide their own implementation, by
| providing an `as_{vendor}` method and patching the Expression:
|
| ```
| def override_as_sql(self, compiler, connection):
| # custom logic
| return super().as_sql(compiler, connection)
| setattr(Expression, 'as_' + connection.vendor, override_as_sql)
| ```
|
| Arguments:
| * compiler: the query compiler responsible for generating the query.
| Must have a compile method, returning a (sql, [params]) tuple.
| Calling compiler(value) will return a quoted `value`.
|
| * connection: the database connection used for the current query.
|
| Return: (sql, params)
| Where `sql` is a string containing ordered sql parameters to be
| replaced with the elements of the list `params`.
|
| get_group_by_cols(self)
|
| get_source_expressions(self)
|
| get_source_fields(self)
| Return the underlying field types used by this aggregate.
|
| resolve_expression(self, query=None, allow_joins=True, reuse=None, summarize=False, for_save=False)
| Provide the chance to do any preprocessing or validation before being
| added to the query.
|
| Arguments:
| * query: the backend query implementation
| * allow_joins: boolean allowing or denying use of joins
| in this query
| * reuse: a set of reusable joins for multijoins
| * summarize: a terminal aggregate clause
| * for_save: whether this expression about to be used in a save or update
|
| Return: an Expression to be added to the query.
|
| set_source_expressions(self, exprs)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from Aggregate:
|
| default_alias
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from Aggregate:
|
| contains_aggregate = True
|
| filter_template = '%s FILTER (WHERE %%(filter)s)'
|
| window_compatible = True
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.expressions.Func:
|
| __repr__(self)
| Return repr(self).
|
| copy(self)
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from django.db.models.expressions.Func:
|
| arg_joiner = ', '
|
| arity = None
|
| function = None
|
| template = '%(function)s(%(expressions)s)'
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.expressions.SQLiteNumericMixin:
|
| as_sqlite(self, compiler, connection, **extra_context)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from django.db.models.expressions.SQLiteNumericMixin:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.expressions.BaseExpression:
|
| __eq__(self, other)
| Return self==value.
|
| __getstate__(self)
|
| __hash__(self)
| Return hash(self).
|
| asc(self, **kwargs)
|
| contains_column_references = <django.utils.functional.cached_property object>
| contains_over_clause = <django.utils.functional.cached_property object>
| convert_value = <django.utils.functional.cached_property object>
| deconstruct(obj)
| Return a 3-tuple of class import path, positional arguments,
| and keyword arguments.
|
| desc(self, **kwargs)
|
| flatten(self)
| Recursively yield this expression and all subexpressions, in
| depth-first order.
|
| get_db_converters(self, connection)
|
| get_lookup(self, lookup)
|
| get_transform(self, name)
|
| relabeled_clone(self, change_map)
|
| reverse_ordering(self)
|
| ----------------------------------------------------------------------
| Static methods inherited from django.db.models.expressions.BaseExpression:
|
| __new__(cls, *args, **kwargs)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from django.db.models.expressions.BaseExpression:
|
| field
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from django.db.models.expressions.BaseExpression:
|
| filterable = True
|
| is_summary = False
|
| ----------------------------------------------------------------------
| Methods inherited from django.db.models.expressions.Combinable:
|
| __add__(self, other)
|
| __and__(self, other)
|
| __mod__(self, other)
|
| __mul__(self, other)
|
| __or__(self, other)
|
| __pow__(self, other)
|
| __radd__(self, other)
|
| __rand__(self, other)
|
| __rmod__(self, other)
|
| __rmul__(self, other)
|
| __ror__(self, other)
|
| __rpow__(self, other)
|
| __rsub__(self, other)
|
| __rtruediv__(self, other)
|
| __sub__(self, other)
|
| __truediv__(self, other)
|
| bitand(self, other)
|
| bitleftshift(self, other)
|
| bitor(self, other)
|
| bitrightshift(self, other)
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from django.db.models.expressions.Combinable:
|
| ADD = '+'
|
| BITAND = '&'
|
| BITLEFTSHIFT = '<<'
|
| BITOR = '|'
|
| BITRIGHTSHIFT = '>>'
|
| DIV = '/'
|
| MOD = '%%'
|
| MUL = '*'
|
| POW = '^'
|
| SUB = '-'
class When(Expression)
| An expression that can be combined with other expressions.
|
| Method resolution order:
| When
| Expression
| BaseExpression
| Combinable
| builtins.object
|
| Methods defined here:
|
| __init__(self, condition=None, then=None, **lookups)
| Initialize self. See help(type(self)) for accurate signature.
|
| __repr__(self)
| Return repr(self).
|
| __str__(self)
| Return str(self).
|
| as_sql(self, compiler, connection, template=None, **extra_context)
| Responsible for returning a (sql, [params]) tuple to be included
| in the current query.
|
| Different backends can provide their own implementation, by
| providing an `as_{vendor}` method and patching the Expression:
|
| ```
| def override_as_sql(self, compiler, connection):
| # custom logic
| return super().as_sql(compiler, connection)
| setattr(Expression, 'as_' + connection.vendor, override_as_sql)
| ```
|
| Arguments:
| * compiler: the query compiler responsible for generating the query.
| Must have a compile method, returning a (sql, [params]) tuple.
| Calling compiler(value) will return a quoted `value`.
|
| * connection: the database connection used for the current query.
|
| Return: (sql, params)
| Where `sql` is a string containing ordered sql parameters to be
| replaced with the elements of the list `params`.
|
| get_group_by_cols(self)
|
| get_source_expressions(self)
|
| get_source_fields(self)
| Return the underlying field types used by this aggregate.
|
| resolve_expression(self, query=None, allow_joins=True, reuse=None, summarize=False, for_save=False)
| Provide the chance to do any preprocessing or validation before being
| added to the query.
|
| Arguments:
| * query: the backend query implementation
| * allow_joins: boolean allowing or denying use of joins
| in this query
| * reuse: a set of reusable joins for multijoins
| * summarize: a terminal aggregate clause
| * for_save: whether this expression about to be used in a save or update
|
| Return: an Expression to be added to the query.
|
| set_source_expressions(self, exprs)
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| template = 'WHEN %(condition)s THEN %(result)s'
|
| ----------------------------------------------------------------------
| Methods inherited from BaseExpression:
|
| __eq__(self, other)
| Return self==value.
|
| __getstate__(self)
|
| __hash__(self)
| Return hash(self).
|
| asc(self, **kwargs)
|
| contains_aggregate = <django.utils.functional.cached_property object>
| contains_column_references = <django.utils.functional.cached_property object>
| contains_over_clause = <django.utils.functional.cached_property object>
| convert_value = <django.utils.functional.cached_property object>
| copy(self)
|
| deconstruct(obj)
| Return a 3-tuple of class import path, positional arguments,
| and keyword arguments.
|
| desc(self, **kwargs)
|
| flatten(self)
| Recursively yield this expression and all subexpressions, in
| depth-first order.
|
| get_db_converters(self, connection)
|
| get_lookup(self, lookup)
|
| get_transform(self, name)
|
| output_field = <django.utils.functional.cached_property object>
| relabeled_clone(self, change_map)
|
| reverse_ordering(self)
|
| ----------------------------------------------------------------------
| Static methods inherited from BaseExpression:
|
| __new__(cls, *args, **kwargs)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from BaseExpression:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
|
| field
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from BaseExpression:
|
| filterable = True
|
| is_summary = False
|
| window_compatible = False
|
| ----------------------------------------------------------------------
| Methods inherited from Combinable:
|
| __add__(self, other)
|
| __and__(self, other)
|
| __mod__(self, other)
|
| __mul__(self, other)
|
| __or__(self, other)
|
| __pow__(self, other)
|
| __radd__(self, other)
|
| __rand__(self, other)
|
| __rmod__(self, other)
|
| __rmul__(self, other)
|
| __ror__(self, other)
|
| __rpow__(self, other)
|
| __rsub__(self, other)
|
| __rtruediv__(self, other)
|
| __sub__(self, other)
|
| __truediv__(self, other)
|
| bitand(self, other)
|
| bitleftshift(self, other)
|
| bitor(self, other)
|
| bitrightshift(self, other)
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from Combinable:
|
| ADD = '+'
|
| BITAND = '&'
|
| BITLEFTSHIFT = '<<'
|
| BITOR = '|'
|
| BITRIGHTSHIFT = '>>'
|
| DIV = '/'
|
| MOD = '%%'
|
| MUL = '*'
|
| POW = '^'
|
| SUB = '-'
class Window(Expression)
| An expression that can be combined with other expressions.
|
| Method resolution order:
| Window
| Expression
| BaseExpression
| Combinable
| builtins.object
|
| Methods defined here:
|
| __init__(self, expression, partition_by=None, order_by=None, frame=None, output_field=None)
| Initialize self. See help(type(self)) for accurate signature.
|
| __repr__(self)
| Return repr(self).
|
| __str__(self)
| Return str(self).
|
| as_sql(self, compiler, connection, function=None, template=None)
| Responsible for returning a (sql, [params]) tuple to be included
| in the current query.
|
| Different backends can provide their own implementation, by
| providing an `as_{vendor}` method and patching the Expression:
|
| ```
| def override_as_sql(self, compiler, connection):
| # custom logic
| return super().as_sql(compiler, connection)
| setattr(Expression, 'as_' + connection.vendor, override_as_sql)
| ```
|
| Arguments:
| * compiler: the query compiler responsible for generating the query.
| Must have a compile method, returning a (sql, [params]) tuple.
| Calling compiler(value) will return a quoted `value`.
|
| * connection: the database connection used for the current query.
|
| Return: (sql, params)
| Where `sql` is a string containing ordered sql parameters to be
| replaced with the elements of the list `params`.
|
| get_group_by_cols(self)
|
| get_source_expressions(self)
|
| set_source_expressions(self, exprs)
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| contains_aggregate = False
|
| contains_over_clause = True
|
| filterable = False
|
| template = '%(expression)s OVER (%(window)s)'
|
| ----------------------------------------------------------------------
| Methods inherited from BaseExpression:
|
| __eq__(self, other)
| Return self==value.
|
| __getstate__(self)
|
| __hash__(self)
| Return hash(self).
|
| asc(self, **kwargs)
|
| contains_column_references = <django.utils.functional.cached_property object>
| convert_value = <django.utils.functional.cached_property object>
| copy(self)
|
| deconstruct(obj)
| Return a 3-tuple of class import path, positional arguments,
| and keyword arguments.
|
| desc(self, **kwargs)
|
| flatten(self)
| Recursively yield this expression and all subexpressions, in
| depth-first order.
|
| get_db_converters(self, connection)
|
| get_lookup(self, lookup)
|
| get_source_fields(self)
| Return the underlying field types used by this aggregate.
|
| get_transform(self, name)
|
| output_field = <django.utils.functional.cached_property object>
| relabeled_clone(self, change_map)
|
| resolve_expression(self, query=None, allow_joins=True, reuse=None, summarize=False, for_save=False)
| Provide the chance to do any preprocessing or validation before being
| added to the query.
|
| Arguments:
| * query: the backend query implementation
| * allow_joins: boolean allowing or denying use of joins
| in this query
| * reuse: a set of reusable joins for multijoins
| * summarize: a terminal aggregate clause
| * for_save: whether this expression about to be used in a save or update
|
| Return: an Expression to be added to the query.
|
| reverse_ordering(self)
|
| ----------------------------------------------------------------------
| Static methods inherited from BaseExpression:
|
| __new__(cls, *args, **kwargs)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from BaseExpression:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
|
| field
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from BaseExpression:
|
| is_summary = False
|
| window_compatible = False
|
| ----------------------------------------------------------------------
| Methods inherited from Combinable:
|
| __add__(self, other)
|
| __and__(self, other)
|
| __mod__(self, other)
|
| __mul__(self, other)
|
| __or__(self, other)
|
| __pow__(self, other)
|
| __radd__(self, other)
|
| __rand__(self, other)
|
| __rmod__(self, other)
|
| __rmul__(self, other)
|
| __ror__(self, other)
|
| __rpow__(self, other)
|
| __rsub__(self, other)
|
| __rtruediv__(self, other)
|
| __sub__(self, other)
|
| __truediv__(self, other)
|
| bitand(self, other)
|
| bitleftshift(self, other)
|
| bitor(self, other)
|
| bitrightshift(self, other)
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from Combinable:
|
| ADD = '+'
|
| BITAND = '&'
|
| BITLEFTSHIFT = '<<'
|
| BITOR = '|'
|
| BITRIGHTSHIFT = '>>'
|
| DIV = '/'
|
| MOD = '%%'
|
| MUL = '*'
|
| POW = '^'
|
| SUB = '-'
class WindowFrame(Expression)
| Model the frame clause in window expressions. There are two types of frame
| clauses which are subclasses, however, all processing and validation (by no
| means intended to be complete) is done here. Thus, providing an end for a
| frame is optional (the default is UNBOUNDED FOLLOWING, which is the last
| row in the frame).
|
| Method resolution order:
| WindowFrame
| Expression
| BaseExpression
| Combinable
| builtins.object
|
| Methods defined here:
|
| __init__(self, start=None, end=None)
| Initialize self. See help(type(self)) for accurate signature.
|
| __repr__(self)
| Return repr(self).
|
| __str__(self)
| Return str(self).
|
| as_sql(self, compiler, connection)
| Responsible for returning a (sql, [params]) tuple to be included
| in the current query.
|
| Different backends can provide their own implementation, by
| providing an `as_{vendor}` method and patching the Expression:
|
| ```
| def override_as_sql(self, compiler, connection):
| # custom logic
| return super().as_sql(compiler, connection)
| setattr(Expression, 'as_' + connection.vendor, override_as_sql)
| ```
|
| Arguments:
| * compiler: the query compiler responsible for generating the query.
| Must have a compile method, returning a (sql, [params]) tuple.
| Calling compiler(value) will return a quoted `value`.
|
| * connection: the database connection used for the current query.
|
| Return: (sql, params)
| Where `sql` is a string containing ordered sql parameters to be
| replaced with the elements of the list `params`.
|
| get_group_by_cols(self)
|
| get_source_expressions(self)
|
| set_source_expressions(self, exprs)
|
| window_frame_start_end(self, connection, start, end)
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| template = '%(frame_type)s BETWEEN %(start)s AND %(end)s'
|
| ----------------------------------------------------------------------
| Methods inherited from BaseExpression:
|
| __eq__(self, other)
| Return self==value.
|
| __getstate__(self)
|
| __hash__(self)
| Return hash(self).
|
| asc(self, **kwargs)
|
| contains_aggregate = <django.utils.functional.cached_property object>
| contains_column_references = <django.utils.functional.cached_property object>
| contains_over_clause = <django.utils.functional.cached_property object>
| convert_value = <django.utils.functional.cached_property object>
| copy(self)
|
| deconstruct(obj)
| Return a 3-tuple of class import path, positional arguments,
| and keyword arguments.
|
| desc(self, **kwargs)
|
| flatten(self)
| Recursively yield this expression and all subexpressions, in
| depth-first order.
|
| get_db_converters(self, connection)
|
| get_lookup(self, lookup)
|
| get_source_fields(self)
| Return the underlying field types used by this aggregate.
|
| get_transform(self, name)
|
| output_field = <django.utils.functional.cached_property object>
| relabeled_clone(self, change_map)
|
| resolve_expression(self, query=None, allow_joins=True, reuse=None, summarize=False, for_save=False)
| Provide the chance to do any preprocessing or validation before being
| added to the query.
|
| Arguments:
| * query: the backend query implementation
| * allow_joins: boolean allowing or denying use of joins
| in this query
| * reuse: a set of reusable joins for multijoins
| * summarize: a terminal aggregate clause
| * for_save: whether this expression about to be used in a save or update
|
| Return: an Expression to be added to the query.
|
| reverse_ordering(self)
|
| ----------------------------------------------------------------------
| Static methods inherited from BaseExpression:
|
| __new__(cls, *args, **kwargs)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from BaseExpression:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
|
| field
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from BaseExpression:
|
| filterable = True
|
| is_summary = False
|
| window_compatible = False
|
| ----------------------------------------------------------------------
| Methods inherited from Combinable:
|
| __add__(self, other)
|
| __and__(self, other)
|
| __mod__(self, other)
|
| __mul__(self, other)
|
| __or__(self, other)
|
| __pow__(self, other)
|
| __radd__(self, other)
|
| __rand__(self, other)
|
| __rmod__(self, other)
|
| __rmul__(self, other)
|
| __ror__(self, other)
|
| __rpow__(self, other)
|
| __rsub__(self, other)
|
| __rtruediv__(self, other)
|
| __sub__(self, other)
|
| __truediv__(self, other)
|
| bitand(self, other)
|
| bitleftshift(self, other)
|
| bitor(self, other)
|
| bitrightshift(self, other)
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from Combinable:
|
| ADD = '+'
|
| BITAND = '&'
|
| BITLEFTSHIFT = '<<'
|
| BITOR = '|'
|
| BITRIGHTSHIFT = '>>'
|
| DIV = '/'
|
| MOD = '%%'
|
| MUL = '*'
|
| POW = '^'
|
| SUB = '-'
FUNCTIONS
CASCADE(collector, field, sub_objs, using)
DO_NOTHING(collector, field, sub_objs, using)
PROTECT(collector, field, sub_objs, using)
SET(value)
SET_DEFAULT(collector, field, sub_objs, using)
SET_NULL(collector, field, sub_objs, using)
permalink(func)
Decorator that calls urls.reverse() to return a URL using parameters
returned by the decorated function "func".
"func" should be a function that returns a tuple in one of the
following formats:
(viewname, viewargs)
(viewname, viewargs, viewkwargs)
prefetch_related_objects(model_instances, *related_lookups)
Populate prefetched object caches for a list of model instances based on
the lookups/Prefetch instances given.
DATA
BLANK_CHOICE_DASH = [('', '---------')]
DEFERRED = <Deferred field>
__all__ = ['Aggregate', 'Avg', 'Count', 'Max', 'Min', 'StdDev', 'Sum',...
FILE
c:\users\robin\venv\cn_engine\lib\site-packages\django\db\models\__init__.py
django.db 中的models
最新推荐文章于 2025-06-30 20:07:59 发布