doc_content
stringlengths
1
386k
doc_id
stringlengths
5
188
bulk_create(objs, batch_size=None, ignore_conflicts=False)
django.ref.models.querysets#django.db.models.query.QuerySet.bulk_create
bulk_update(objs, fields, batch_size=None)
django.ref.models.querysets#django.db.models.query.QuerySet.bulk_update
contains(obj)
django.ref.models.querysets#django.db.models.query.QuerySet.contains
count()
django.ref.models.querysets#django.db.models.query.QuerySet.count
create(**kwargs)
django.ref.models.querysets#django.db.models.query.QuerySet.create
dates(field, kind, order='ASC')
django.ref.models.querysets#django.db.models.query.QuerySet.dates
datetimes(field_name, kind, order='ASC', tzinfo=None, is_dst=None)
django.ref.models.querysets#django.db.models.query.QuerySet.datetimes
db The database that will be used if this query is executed now.
django.ref.models.querysets#django.db.models.query.QuerySet.db
defer(*fields)
django.ref.models.querysets#django.db.models.query.QuerySet.defer
delete()
django.ref.models.querysets#django.db.models.query.QuerySet.delete
difference(*other_qs)
django.ref.models.querysets#django.db.models.query.QuerySet.difference
distinct(*fields)
django.ref.models.querysets#django.db.models.query.QuerySet.distinct
earliest(*fields)
django.ref.models.querysets#django.db.models.query.QuerySet.earliest
exclude(*args, **kwargs)
django.ref.models.querysets#django.db.models.query.QuerySet.exclude
exists()
django.ref.models.querysets#django.db.models.query.QuerySet.exists
explain(format=None, **options)
django.ref.models.querysets#django.db.models.query.QuerySet.explain
extra(select=None, where=None, params=None, tables=None, order_by=None, select_params=None)
django.ref.models.querysets#django.db.models.query.QuerySet.extra
filter(*args, **kwargs)
django.ref.models.querysets#django.db.models.query.QuerySet.filter
first()
django.ref.models.querysets#django.db.models.query.QuerySet.first
get(*args, **kwargs)
django.ref.models.querysets#django.db.models.query.QuerySet.get
get_or_create(defaults=None, **kwargs)
django.ref.models.querysets#django.db.models.query.QuerySet.get_or_create
in_bulk(id_list=None, *, field_name='pk')
django.ref.models.querysets#django.db.models.query.QuerySet.in_bulk
intersection(*other_qs)
django.ref.models.querysets#django.db.models.query.QuerySet.intersection
iterator(chunk_size=2000)
django.ref.models.querysets#django.db.models.query.QuerySet.iterator
last()
django.ref.models.querysets#django.db.models.query.QuerySet.last
latest(*fields)
django.ref.models.querysets#django.db.models.query.QuerySet.latest
none()
django.ref.models.querysets#django.db.models.query.QuerySet.none
only(*fields)
django.ref.models.querysets#django.db.models.query.QuerySet.only
order_by(*fields)
django.ref.models.querysets#django.db.models.query.QuerySet.order_by
ordered True if the QuerySet is ordered — i.e. has an order_by() clause or a default ordering on the model. False otherwise.
django.ref.models.querysets#django.db.models.query.QuerySet.ordered
prefetch_related(*lookups)
django.ref.models.querysets#django.db.models.query.QuerySet.prefetch_related
raw(raw_query, params=(), translations=None, using=None)
django.ref.models.querysets#django.db.models.query.QuerySet.raw
reverse()
django.ref.models.querysets#django.db.models.query.QuerySet.reverse
select_for_update(nowait=False, skip_locked=False, of=(), no_key=False)
django.ref.models.querysets#django.db.models.query.QuerySet.select_for_update
select_related(*fields)
django.ref.models.querysets#django.db.models.query.QuerySet.select_related
union(*other_qs, all=False)
django.ref.models.querysets#django.db.models.query.QuerySet.union
update(**kwargs)
django.ref.models.querysets#django.db.models.query.QuerySet.update
update_or_create(defaults=None, **kwargs)
django.ref.models.querysets#django.db.models.query.QuerySet.update_or_create
using(alias)
django.ref.models.querysets#django.db.models.query.QuerySet.using
values(*fields, **expressions)
django.ref.models.querysets#django.db.models.query.QuerySet.values
values_list(*fields, flat=False, named=False)
django.ref.models.querysets#django.db.models.query.QuerySet.values_list
RESTRICT Prevent deletion of the referenced object by raising RestrictedError (a subclass of django.db.IntegrityError). Unlike PROTECT, deletion of the referenced object is allowed if it also references a different object that is being deleted in the same operation, but via a CASCADE relationship. Consider this set o...
django.ref.models.fields#django.db.models.RESTRICT
SET() Set the ForeignKey to the value passed to SET(), or if a callable is passed in, the result of calling it. In most cases, passing a callable will be necessary to avoid executing queries at the time your models.py is imported: from django.conf import settings from django.contrib.auth import get_user_model from dj...
django.ref.models.fields#django.db.models.SET
SET_DEFAULT Set the ForeignKey to its default value; a default for the ForeignKey must be set.
django.ref.models.fields#django.db.models.SET_DEFAULT
SET_NULL Set the ForeignKey null; this is only possible if null is True.
django.ref.models.fields#django.db.models.SET_NULL
django.db.models.signals.class_prepared
django.ref.signals#django.db.models.signals.class_prepared
django.db.models.signals.m2m_changed
django.ref.signals#django.db.models.signals.m2m_changed
django.db.models.signals.post_delete
django.ref.signals#django.db.models.signals.post_delete
django.db.models.signals.post_init
django.ref.signals#django.db.models.signals.post_init
django.db.models.signals.post_migrate
django.ref.signals#django.db.models.signals.post_migrate
django.db.models.signals.post_save
django.ref.signals#django.db.models.signals.post_save
django.db.models.signals.pre_delete
django.ref.signals#django.db.models.signals.pre_delete
django.db.models.signals.pre_init
django.ref.signals#django.db.models.signals.pre_init
django.db.models.signals.pre_migrate
django.ref.signals#django.db.models.signals.pre_migrate
django.db.models.signals.pre_save
django.ref.signals#django.db.models.signals.pre_save
class SlugField(max_length=50, **options)
django.ref.models.fields#django.db.models.SlugField
SlugField.allow_unicode If True, the field accepts Unicode letters in addition to ASCII letters. Defaults to False.
django.ref.models.fields#django.db.models.SlugField.allow_unicode
class SmallAutoField(**options)
django.ref.models.fields#django.db.models.SmallAutoField
class SmallIntegerField(**options)
django.ref.models.fields#django.db.models.SmallIntegerField
class StdDev(expression, output_field=None, sample=False, filter=None, default=None, **extra) Returns the standard deviation of the data in the provided expression. Default alias: <field>__stddev Return type: float if input is int, otherwise same as input field, or output_field if supplied Has one optional argumen...
django.ref.models.querysets#django.db.models.StdDev
sample By default, StdDev returns the population standard deviation. However, if sample=True, the return value will be the sample standard deviation.
django.ref.models.querysets#django.db.models.StdDev.sample
class Subquery(queryset, output_field=None)
django.ref.models.expressions#django.db.models.Subquery
class Sum(expression, output_field=None, distinct=False, filter=None, default=None, **extra) Computes the sum of all values of the given expression. Default alias: <field>__sum Return type: same as input field, or output_field if supplied Has one optional argument: distinct If distinct=True, Sum returns the su...
django.ref.models.querysets#django.db.models.Sum
distinct If distinct=True, Sum returns the sum of unique values. This is the SQL equivalent of SUM(DISTINCT <field>). The default value is False.
django.ref.models.querysets#django.db.models.Sum.distinct
class TextField(**options)
django.ref.models.fields#django.db.models.TextField
TextField.db_collation New in Django 3.2. The database collation name of the field. Note Collation names are not standardized. As such, this will not be portable across multiple database backends. Oracle Oracle does not support collations for a TextField.
django.ref.models.fields#django.db.models.TextField.db_collation
class TimeField(auto_now=False, auto_now_add=False, **options)
django.ref.models.fields#django.db.models.TimeField
class Transform A Transform is a generic class to implement field transformations. A prominent example is __year that transforms a DateField into a IntegerField. The notation to use a Transform in a lookup expression is <expression>__<transformation> (e.g. date__year). This class follows the Query Expression API, whi...
django.ref.models.lookups#django.db.models.Transform
bilateral A boolean indicating whether this transformation should apply to both lhs and rhs. Bilateral transformations will be applied to rhs in the same order as they appear in the lookup expression. By default it is set to False. For example usage, see How to write custom lookups.
django.ref.models.lookups#django.db.models.Transform.bilateral
lhs The left-hand side - what is being transformed. It must follow the Query Expression API.
django.ref.models.lookups#django.db.models.Transform.lhs
lookup_name The name of the lookup, used for identifying it on parsing query expressions. It cannot contain the string "__".
django.ref.models.lookups#django.db.models.Transform.lookup_name
output_field Defines the class this transformation outputs. It must be a Field instance. By default is the same as its lhs.output_field.
django.ref.models.lookups#django.db.models.Transform.output_field
class UniqueConstraint(*expressions, fields=(), name=None, condition=None, deferrable=None, include=None, opclasses=()) Creates a unique constraint in the database.
django.ref.models.constraints#django.db.models.UniqueConstraint
UniqueConstraint.condition
django.ref.models.constraints#django.db.models.UniqueConstraint.condition
UniqueConstraint.deferrable
django.ref.models.constraints#django.db.models.UniqueConstraint.deferrable
UniqueConstraint.expressions
django.ref.models.constraints#django.db.models.UniqueConstraint.expressions
UniqueConstraint.fields
django.ref.models.constraints#django.db.models.UniqueConstraint.fields
UniqueConstraint.include
django.ref.models.constraints#django.db.models.UniqueConstraint.include
UniqueConstraint.name
django.ref.models.constraints#django.db.models.UniqueConstraint.name
UniqueConstraint.opclasses
django.ref.models.constraints#django.db.models.UniqueConstraint.opclasses
class URLField(max_length=200, **options)
django.ref.models.fields#django.db.models.URLField
class UUIDField(**options)
django.ref.models.fields#django.db.models.UUIDField
class Value(value, output_field=None)
django.ref.models.expressions#django.db.models.Value
class Variance(expression, output_field=None, sample=False, filter=None, default=None, **extra) Returns the variance of the data in the provided expression. Default alias: <field>__variance Return type: float if input is int, otherwise same as input field, or output_field if supplied Has one optional argument: s...
django.ref.models.querysets#django.db.models.Variance
sample By default, Variance returns the population variance. However, if sample=True, the return value will be the sample variance.
django.ref.models.querysets#django.db.models.Variance.sample
atomic(using=None, savepoint=True, durable=False) Atomicity is the defining property of database transactions. atomic allows us to create a block of code within which the atomicity on the database is guaranteed. If the block of code is successfully completed, the changes are committed to the database. If there is an ...
django.topics.db.transactions#django.db.transaction.atomic
clean_savepoints(using=None) Resets the counter used to generate unique savepoint IDs.
django.topics.db.transactions#django.db.transaction.clean_savepoints
commit(using=None)
django.topics.db.transactions#django.db.transaction.commit
get_autocommit(using=None)
django.topics.db.transactions#django.db.transaction.get_autocommit
get_rollback(using=None)
django.topics.db.transactions#django.db.transaction.get_rollback
non_atomic_requests(using=None) This decorator will negate the effect of ATOMIC_REQUESTS for a given view: from django.db import transaction @transaction.non_atomic_requests def my_view(request): do_stuff() @transaction.non_atomic_requests(using='other') def my_other_view(request): do_stuff_on_the_other_dat...
django.topics.db.transactions#django.db.transaction.non_atomic_requests
on_commit(func, using=None)
django.topics.db.transactions#django.db.transaction.on_commit
rollback(using=None)
django.topics.db.transactions#django.db.transaction.rollback
savepoint(using=None) Creates a new savepoint. This marks a point in the transaction that is known to be in a “good” state. Returns the savepoint ID (sid).
django.topics.db.transactions#django.db.transaction.savepoint
savepoint_commit(sid, using=None) Releases savepoint sid. The changes performed since the savepoint was created become part of the transaction.
django.topics.db.transactions#django.db.transaction.savepoint_commit
savepoint_rollback(sid, using=None) Rolls back the transaction to savepoint sid.
django.topics.db.transactions#django.db.transaction.savepoint_rollback
set_autocommit(autocommit, using=None)
django.topics.db.transactions#django.db.transaction.set_autocommit
set_rollback(rollback, using=None)
django.topics.db.transactions#django.db.transaction.set_rollback
receiver(signal) [source] Parameters: signal – A signal or a list of signals to connect a function to.
django.topics.signals#django.dispatch.receiver
class Signal [source]
django.topics.signals#django.dispatch.Signal