doc_content stringlengths 1 386k | doc_id stringlengths 5 188 |
|---|---|
class StringAgg(expression, delimiter, distinct=False, filter=None, default=None, ordering=())
Returns the input values concatenated into a string, separated by the delimiter string, or default if there are no values.
delimiter
Required argument. Needs to be a string.
distinct
An optional boolean argument t... | django.ref.contrib.postgres.aggregates#django.contrib.postgres.aggregates.StringAgg |
delimiter
Required argument. Needs to be a string. | django.ref.contrib.postgres.aggregates#django.contrib.postgres.aggregates.StringAgg.delimiter |
distinct
An optional boolean argument that determines if concatenated values will be distinct. Defaults to False. | django.ref.contrib.postgres.aggregates#django.contrib.postgres.aggregates.StringAgg.distinct |
ordering
An optional string of a field name (with an optional "-" prefix which indicates descending order) or an expression (or a tuple or list of strings and/or expressions) that specifies the ordering of the elements in the result string. Examples are the same as for ArrayAgg.ordering. | django.ref.contrib.postgres.aggregates#django.contrib.postgres.aggregates.StringAgg.ordering |
class ExclusionConstraint(*, name, expressions, index_type=None, condition=None, deferrable=None, include=None, opclasses=())
Creates an exclusion constraint in the database. Internally, PostgreSQL implements exclusion constraints using indexes. The default index type is GiST. To use them, you need to activate the bt... | django.ref.contrib.postgres.constraints#django.contrib.postgres.constraints.ExclusionConstraint |
ExclusionConstraint.condition | django.ref.contrib.postgres.constraints#django.contrib.postgres.constraints.ExclusionConstraint.condition |
ExclusionConstraint.deferrable | django.ref.contrib.postgres.constraints#django.contrib.postgres.constraints.ExclusionConstraint.deferrable |
ExclusionConstraint.expressions | django.ref.contrib.postgres.constraints#django.contrib.postgres.constraints.ExclusionConstraint.expressions |
ExclusionConstraint.include | django.ref.contrib.postgres.constraints#django.contrib.postgres.constraints.ExclusionConstraint.include |
ExclusionConstraint.index_type | django.ref.contrib.postgres.constraints#django.contrib.postgres.constraints.ExclusionConstraint.index_type |
ExclusionConstraint.name | django.ref.contrib.postgres.constraints#django.contrib.postgres.constraints.ExclusionConstraint.name |
ExclusionConstraint.opclasses | django.ref.contrib.postgres.constraints#django.contrib.postgres.constraints.ExclusionConstraint.opclasses |
class ArraySubquery(queryset) | django.ref.contrib.postgres.expressions#django.contrib.postgres.expressions.ArraySubquery |
class ArrayField(base_field, size=None, **options)
A field for storing lists of data. Most field types can be used, and you pass another field instance as the base_field. You may also specify a size. ArrayField can be nested to store multi-dimensional arrays. If you give the field a default, ensure it’s a callable su... | django.ref.contrib.postgres.fields#django.contrib.postgres.fields.ArrayField |
base_field
This is a required argument. Specifies the underlying data type and behavior for the array. It should be an instance of a subclass of Field. For example, it could be an IntegerField or a CharField. Most field types are permitted, with the exception of those handling relational data (ForeignKey, OneToOneFie... | django.ref.contrib.postgres.fields#django.contrib.postgres.fields.ArrayField.base_field |
size
This is an optional argument. If passed, the array will have a maximum size as specified. This will be passed to the database, although PostgreSQL at present does not enforce the restriction. | django.ref.contrib.postgres.fields#django.contrib.postgres.fields.ArrayField.size |
class BigIntegerRangeField(**options)
Stores a range of large integers. Based on a BigIntegerField. Represented by an int8range in the database and a NumericRange in Python. Regardless of the bounds specified when saving the data, PostgreSQL always returns a range in a canonical form that includes the lower bound and... | django.ref.contrib.postgres.fields#django.contrib.postgres.fields.BigIntegerRangeField |
class CICharField(**options) | django.ref.contrib.postgres.fields#django.contrib.postgres.fields.CICharField |
class CIEmailField(**options) | django.ref.contrib.postgres.fields#django.contrib.postgres.fields.CIEmailField |
class CIText(**options)
A mixin to create case-insensitive text fields backed by the citext type. Read about the performance considerations prior to using it. To use citext, use the CITextExtension operation to set up the citext extension in PostgreSQL before the first CreateModel migration operation. If you’re using... | django.ref.contrib.postgres.fields#django.contrib.postgres.fields.CIText |
class CITextField(**options)
These fields subclass CharField, EmailField, and TextField, respectively. max_length won’t be enforced in the database since citext behaves similar to PostgreSQL’s text type. | django.ref.contrib.postgres.fields#django.contrib.postgres.fields.CITextField |
class DateRangeField(**options)
Stores a range of dates. Based on a DateField. Represented by a daterange in the database and a DateRange in Python. Regardless of the bounds specified when saving the data, PostgreSQL always returns a range in a canonical form that includes the lower bound and excludes the upper bound... | django.ref.contrib.postgres.fields#django.contrib.postgres.fields.DateRangeField |
class DateTimeRangeField(**options)
Stores a range of timestamps. Based on a DateTimeField. Represented by a tstzrange in the database and a DateTimeTZRange in Python. | django.ref.contrib.postgres.fields#django.contrib.postgres.fields.DateTimeRangeField |
class DecimalRangeField(**options)
Stores a range of floating point values. Based on a DecimalField. Represented by a numrange in the database and a NumericRange in Python. | django.ref.contrib.postgres.fields#django.contrib.postgres.fields.DecimalRangeField |
class django.contrib.postgres.forms.BaseRangeField
Base class for form range fields.
base_field
The form field to use.
range_type
The psycopg2 range type to use. | django.ref.contrib.postgres.fields#django.contrib.postgres.fields.django.contrib.postgres.forms.BaseRangeField |
base_field
The form field to use. | django.ref.contrib.postgres.fields#django.contrib.postgres.fields.django.contrib.postgres.forms.BaseRangeField.base_field |
range_type
The psycopg2 range type to use. | django.ref.contrib.postgres.fields#django.contrib.postgres.fields.django.contrib.postgres.forms.BaseRangeField.range_type |
class HStoreField(**options)
A field for storing key-value pairs. The Python data type used is a dict. Keys must be strings, and values may be either strings or nulls (None in Python). To use this field, you’ll need to: Add 'django.contrib.postgres' in your INSTALLED_APPS.
Set up the hstore extension in PostgreSQL.... | django.ref.contrib.postgres.fields#django.contrib.postgres.fields.HStoreField |
class IntegerRangeField(**options)
Stores a range of integers. Based on an IntegerField. Represented by an int4range in the database and a NumericRange in Python. Regardless of the bounds specified when saving the data, PostgreSQL always returns a range in a canonical form that includes the lower bound and excludes t... | django.ref.contrib.postgres.fields#django.contrib.postgres.fields.IntegerRangeField |
class RangeBoundary(inclusive_lower=True, inclusive_upper=False)
inclusive_lower
If True (default), the lower bound is inclusive '[', otherwise it’s exclusive '('.
inclusive_upper
If False (default), the upper bound is exclusive ')', otherwise it’s inclusive ']'. | django.ref.contrib.postgres.fields#django.contrib.postgres.fields.RangeBoundary |
inclusive_lower
If True (default), the lower bound is inclusive '[', otherwise it’s exclusive '('. | django.ref.contrib.postgres.fields#django.contrib.postgres.fields.RangeBoundary.inclusive_lower |
inclusive_upper
If False (default), the upper bound is exclusive ')', otherwise it’s inclusive ']'. | django.ref.contrib.postgres.fields#django.contrib.postgres.fields.RangeBoundary.inclusive_upper |
class RangeField(**options)
Base class for model range fields.
base_field
The model field class to use.
range_type
The psycopg2 range type to use.
form_field
The form field class to use. Should be a subclass of django.contrib.postgres.forms.BaseRangeField. | django.ref.contrib.postgres.fields#django.contrib.postgres.fields.RangeField |
base_field
The model field class to use. | django.ref.contrib.postgres.fields#django.contrib.postgres.fields.RangeField.base_field |
form_field
The form field class to use. Should be a subclass of django.contrib.postgres.forms.BaseRangeField. | django.ref.contrib.postgres.fields#django.contrib.postgres.fields.RangeField.form_field |
range_type
The psycopg2 range type to use. | django.ref.contrib.postgres.fields#django.contrib.postgres.fields.RangeField.range_type |
class RangeOperators | django.ref.contrib.postgres.fields#django.contrib.postgres.fields.RangeOperators |
class DateRangeField
Based on DateField and translates its input into DateRange. Default for DateRangeField. | django.ref.contrib.postgres.forms#django.contrib.postgres.forms.DateRangeField |
class DateTimeRangeField
Based on DateTimeField and translates its input into DateTimeTZRange. Default for DateTimeRangeField. | django.ref.contrib.postgres.forms#django.contrib.postgres.forms.DateTimeRangeField |
class DecimalRangeField
Based on DecimalField and translates its input into NumericRange. Default for DecimalRangeField. | django.ref.contrib.postgres.forms#django.contrib.postgres.forms.DecimalRangeField |
class HStoreField
A field which accepts JSON encoded data for an HStoreField. It casts all values (except nulls) to strings. It is represented by an HTML <textarea>. User friendly forms HStoreField is not particularly user friendly in most cases, however it is a useful way to format data from a client-side widget fo... | django.ref.contrib.postgres.forms#django.contrib.postgres.forms.HStoreField |
class IntegerRangeField
Based on IntegerField and translates its input into NumericRange. Default for IntegerRangeField and BigIntegerRangeField. | django.ref.contrib.postgres.forms#django.contrib.postgres.forms.IntegerRangeField |
class RangeWidget(base_widget, attrs=None)
Widget used by all of the range fields. Based on MultiWidget. RangeWidget has one required argument:
base_widget
A RangeWidget comprises a 2-tuple of base_widget.
decompress(value)
Takes a single “compressed” value of a field, for example a DateRangeField, and retu... | django.ref.contrib.postgres.forms#django.contrib.postgres.forms.RangeWidget |
base_widget
A RangeWidget comprises a 2-tuple of base_widget. | django.ref.contrib.postgres.forms#django.contrib.postgres.forms.RangeWidget.base_widget |
decompress(value)
Takes a single “compressed” value of a field, for example a DateRangeField, and returns a tuple representing a lower and upper bound. | django.ref.contrib.postgres.forms#django.contrib.postgres.forms.RangeWidget.decompress |
class SimpleArrayField(base_field, delimiter=', ', max_length=None, min_length=None)
A field which maps to an array. It is represented by an HTML <input>.
base_field
This is a required argument. It specifies the underlying form field for the array. This is not used to render any HTML, but it is used to process th... | django.ref.contrib.postgres.forms#django.contrib.postgres.forms.SimpleArrayField |
base_field
This is a required argument. It specifies the underlying form field for the array. This is not used to render any HTML, but it is used to process the submitted data and validate it. For example: >>> from django import forms
>>> from django.contrib.postgres.forms import SimpleArrayField
>>> class NumberLis... | django.ref.contrib.postgres.forms#django.contrib.postgres.forms.SimpleArrayField.base_field |
delimiter
This is an optional argument which defaults to a comma: ,. This value is used to split the submitted data. It allows you to chain SimpleArrayField for multidimensional data: >>> from django import forms
>>> from django.contrib.postgres.forms import SimpleArrayField
>>> class GridForm(forms.Form):
... p... | django.ref.contrib.postgres.forms#django.contrib.postgres.forms.SimpleArrayField.delimiter |
max_length
This is an optional argument which validates that the array does not exceed the stated length. | django.ref.contrib.postgres.forms#django.contrib.postgres.forms.SimpleArrayField.max_length |
min_length
This is an optional argument which validates that the array reaches at least the stated length. | django.ref.contrib.postgres.forms#django.contrib.postgres.forms.SimpleArrayField.min_length |
class SplitArrayField(base_field, size, remove_trailing_nulls=False)
This field handles arrays by reproducing the underlying field a fixed number of times.
base_field
This is a required argument. It specifies the form field to be repeated.
size
This is the fixed number of times the underlying field will be ... | django.ref.contrib.postgres.forms#django.contrib.postgres.forms.SplitArrayField |
base_field
This is a required argument. It specifies the form field to be repeated. | django.ref.contrib.postgres.forms#django.contrib.postgres.forms.SplitArrayField.base_field |
remove_trailing_nulls
By default, this is set to False. When False, each value from the repeated fields is stored. When set to True, any trailing values which are blank will be stripped from the result. If the underlying field has required=True, but remove_trailing_nulls is True, then null values are only allowed at ... | django.ref.contrib.postgres.forms#django.contrib.postgres.forms.SplitArrayField.remove_trailing_nulls |
size
This is the fixed number of times the underlying field will be used. | django.ref.contrib.postgres.forms#django.contrib.postgres.forms.SplitArrayField.size |
class RandomUUID | django.ref.contrib.postgres.functions#django.contrib.postgres.functions.RandomUUID |
class TransactionNow | django.ref.contrib.postgres.functions#django.contrib.postgres.functions.TransactionNow |
class BloomIndex(*expressions, length=None, columns=(), **options)
Creates a bloom index. To use this index access you need to activate the bloom extension on PostgreSQL. You can install it using the BloomExtension migration operation. Provide an integer number of bits from 1 to 4096 to the length parameter to specif... | django.ref.contrib.postgres.indexes#django.contrib.postgres.indexes.BloomIndex |
class BrinIndex(*expressions, autosummarize=None, pages_per_range=None, **options)
Creates a BRIN index. Set the autosummarize parameter to True to enable automatic summarization to be performed by autovacuum. The pages_per_range argument takes a positive integer. Changed in Django 3.2: Positional argument *expressi... | django.ref.contrib.postgres.indexes#django.contrib.postgres.indexes.BrinIndex |
class BTreeIndex(*expressions, fillfactor=None, **options)
Creates a B-Tree index. Provide an integer value from 10 to 100 to the fillfactor parameter to tune how packed the index pages will be. PostgreSQL’s default is 90. Changed in Django 3.2: Positional argument *expressions was added in order to support function... | django.ref.contrib.postgres.indexes#django.contrib.postgres.indexes.BTreeIndex |
class GinIndex(*expressions, fastupdate=None, gin_pending_list_limit=None, **options)
Creates a gin index. To use this index on data types not in the built-in operator classes, you need to activate the btree_gin extension on PostgreSQL. You can install it using the BtreeGinExtension migration operation. Set the fastu... | django.ref.contrib.postgres.indexes#django.contrib.postgres.indexes.GinIndex |
class GistIndex(*expressions, buffering=None, fillfactor=None, **options)
Creates a GiST index. These indexes are automatically created on spatial fields with spatial_index=True. They’re also useful on other types, such as HStoreField or the range fields. To use this index on data types not in the built-in gist opera... | django.ref.contrib.postgres.indexes#django.contrib.postgres.indexes.GistIndex |
class HashIndex(*expressions, fillfactor=None, **options)
Creates a hash index. Provide an integer value from 10 to 100 to the fillfactor parameter to tune how packed the index pages will be. PostgreSQL’s default is 90. Use this index only on PostgreSQL 10 and later Hash indexes have been available in PostgreSQL for... | django.ref.contrib.postgres.indexes#django.contrib.postgres.indexes.HashIndex |
class OpClass(expression, name)
An OpClass() expression represents the expression with a custom operator class that can be used to define functional indexes or unique constraints. To use it, you need to add 'django.contrib.postgres' in your INSTALLED_APPS. Set the name parameter to the name of the operator class. For... | django.ref.contrib.postgres.indexes#django.contrib.postgres.indexes.OpClass |
class SpGistIndex(*expressions, fillfactor=None, **options)
Creates an SP-GiST index. Provide an integer value from 10 to 100 to the fillfactor parameter to tune how packed the index pages will be. PostgreSQL’s default is 90. Changed in Django 3.2: Positional argument *expressions was added in order to support funct... | django.ref.contrib.postgres.indexes#django.contrib.postgres.indexes.SpGistIndex |
class AddConstraintNotValid(model_name, constraint)
Like AddConstraint, but avoids validating the constraint on existing rows. | django.ref.contrib.postgres.operations#django.contrib.postgres.operations.AddConstraintNotValid |
class AddIndexConcurrently(model_name, index)
Like AddIndex, but creates an index with the CONCURRENTLY option. This has a few caveats to be aware of when using this option, see the PostgreSQL documentation of building indexes concurrently. | django.ref.contrib.postgres.operations#django.contrib.postgres.operations.AddIndexConcurrently |
class BloomExtension
Installs the bloom extension. | django.ref.contrib.postgres.operations#django.contrib.postgres.operations.BloomExtension |
class BtreeGinExtension
Installs the btree_gin extension. | django.ref.contrib.postgres.operations#django.contrib.postgres.operations.BtreeGinExtension |
class BtreeGistExtension
Installs the btree_gist extension. | django.ref.contrib.postgres.operations#django.contrib.postgres.operations.BtreeGistExtension |
class CITextExtension
Installs the citext extension. | django.ref.contrib.postgres.operations#django.contrib.postgres.operations.CITextExtension |
class CreateCollation(name, locale, *, provider='libc', deterministic=True)
Creates a collation with the given name, locale and provider. Set the deterministic parameter to False to create a non-deterministic collation, such as for case-insensitive filtering. | django.ref.contrib.postgres.operations#django.contrib.postgres.operations.CreateCollation |
class CreateExtension(name)
An Operation subclass which installs a PostgreSQL extension. For common extensions, use one of the more specific subclasses below.
name
This is a required argument. The name of the extension to be installed. | django.ref.contrib.postgres.operations#django.contrib.postgres.operations.CreateExtension |
name
This is a required argument. The name of the extension to be installed. | django.ref.contrib.postgres.operations#django.contrib.postgres.operations.CreateExtension.name |
class CryptoExtension
Installs the pgcrypto extension. | django.ref.contrib.postgres.operations#django.contrib.postgres.operations.CryptoExtension |
class HStoreExtension
Installs the hstore extension and also sets up the connection to interpret hstore data for possible use in subsequent migrations. | django.ref.contrib.postgres.operations#django.contrib.postgres.operations.HStoreExtension |
class RemoveCollation(name, locale, *, provider='libc', deterministic=True)
Removes the collations named name. When reversed this is creating a collation with the provided locale, provider, and deterministic arguments. Therefore, locale is required to make this operation reversible. | django.ref.contrib.postgres.operations#django.contrib.postgres.operations.RemoveCollation |
class RemoveIndexConcurrently(model_name, name)
Like RemoveIndex, but removes the index with the CONCURRENTLY option. This has a few caveats to be aware of when using this option, see the PostgreSQL documentation. | django.ref.contrib.postgres.operations#django.contrib.postgres.operations.RemoveIndexConcurrently |
class TrigramExtension
Installs the pg_trgm extension. | django.ref.contrib.postgres.operations#django.contrib.postgres.operations.TrigramExtension |
class UnaccentExtension
Installs the unaccent extension. | django.ref.contrib.postgres.operations#django.contrib.postgres.operations.UnaccentExtension |
class ValidateConstraint(model_name, name)
Scans through the table and validates the given check constraint on existing rows. | django.ref.contrib.postgres.operations#django.contrib.postgres.operations.ValidateConstraint |
class SearchHeadline(expression, query, config=None, start_sel=None, stop_sel=None, max_words=None, min_words=None, short_word=None, highlight_all=None, max_fragments=None, fragment_delimiter=None) | django.ref.contrib.postgres.search#django.contrib.postgres.search.SearchHeadline |
class SearchQuery(value, config=None, search_type='plain') | django.ref.contrib.postgres.search#django.contrib.postgres.search.SearchQuery |
class SearchRank(vector, query, weights=None, normalization=None, cover_density=False) | django.ref.contrib.postgres.search#django.contrib.postgres.search.SearchRank |
class SearchVector(*expressions, config=None, weight=None) | django.ref.contrib.postgres.search#django.contrib.postgres.search.SearchVector |
class SearchVectorField | django.ref.contrib.postgres.search#django.contrib.postgres.search.SearchVectorField |
class TrigramDistance(expression, string, **extra) | django.ref.contrib.postgres.search#django.contrib.postgres.search.TrigramDistance |
class TrigramSimilarity(expression, string, **extra) | django.ref.contrib.postgres.search#django.contrib.postgres.search.TrigramSimilarity |
class TrigramWordDistance(string, expression, **extra) | django.ref.contrib.postgres.search#django.contrib.postgres.search.TrigramWordDistance |
class TrigramWordSimilarity(string, expression, **extra) | django.ref.contrib.postgres.search#django.contrib.postgres.search.TrigramWordSimilarity |
class KeysValidator(keys, strict=False, messages=None)
Validates that the given keys are contained in the value. If strict is True, then it also checks that there are no other keys present. The messages passed should be a dict containing the keys missing_keys and/or extra_keys. Note Note that this checks only for th... | django.ref.contrib.postgres.validators#django.contrib.postgres.validators.KeysValidator |
class RangeMaxValueValidator(limit_value, message=None)
Validates that the upper bound of the range is not greater than limit_value. | django.ref.contrib.postgres.validators#django.contrib.postgres.validators.RangeMaxValueValidator |
class RangeMinValueValidator(limit_value, message=None)
Validates that the lower bound of the range is not less than the limit_value. | django.ref.contrib.postgres.validators#django.contrib.postgres.validators.RangeMinValueValidator |
class middleware.RedirectFallbackMiddleware
You can change the HttpResponse classes used by the middleware by creating a subclass of RedirectFallbackMiddleware and overriding response_gone_class and/or response_redirect_class.
response_gone_class
The HttpResponse class used when a Redirect is not found for the re... | django.ref.contrib.redirects#django.contrib.redirects.middleware.RedirectFallbackMiddleware |
response_gone_class
The HttpResponse class used when a Redirect is not found for the requested path or has a blank new_path value. Defaults to HttpResponseGone. | django.ref.contrib.redirects#django.contrib.redirects.middleware.RedirectFallbackMiddleware.response_gone_class |
response_redirect_class
The HttpResponse class that handles the redirect. Defaults to HttpResponsePermanentRedirect. | django.ref.contrib.redirects#django.contrib.redirects.middleware.RedirectFallbackMiddleware.response_redirect_class |
class models.Redirect
Redirects are represented by a standard Django model, which lives in django/contrib/redirects/models.py. You can access redirect objects via the Django database API. For example: >>> from django.conf import settings
>>> from django.contrib.redirects.models import Redirect
>>> # Add a new redirec... | django.ref.contrib.redirects#django.contrib.redirects.models.Redirect |
SchemaEditor
class BaseDatabaseSchemaEditor
Django’s migration system is split into two parts; the logic for calculating and storing what operations should be run (django.db.migrations), and the database abstraction layer that turns things like “create a model” or “delete a field” into SQL - which is the job of the... | django.ref.schema-editor |
Search A common task for web applications is to search some data in the database with user input. In a simple case, this could be filtering a list of objects by a category. A more complex use case might require searching with weighting, categorization, highlighting, multiple languages, and so on. This document explains... | django.topics.db.search |
class backends.base.SessionBase
This is the base class for all session objects. It has the following standard dictionary methods:
__getitem__(key)
Example: fav_color = request.session['fav_color']
__setitem__(key, value)
Example: request.session['fav_color'] = 'blue'
__delitem__(key)
Example: del requ... | django.topics.http.sessions#django.contrib.sessions.backends.base.SessionBase |
__contains__(key)
Example: 'fav_color' in request.session | django.topics.http.sessions#django.contrib.sessions.backends.base.SessionBase.__contains__ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.