djongo package

Submodules

djongo.base module

djongo.compiler module

class djongo.compiler.SQLCompiler(query, connection, using)

Bases: object

djongo.cursor module

djongo.database module

exception djongo.database.DataError

Bases: djongo.database.DatabaseError

exception djongo.database.DatabaseError

Bases: djongo.database.Error

exception djongo.database.Error

Bases: Exception

exception djongo.database.IntegrityError

Bases: djongo.database.DatabaseError

exception djongo.database.InterfaceError

Bases: djongo.database.Error

exception djongo.database.InternalError

Bases: djongo.database.DatabaseError

exception djongo.database.NotSupportedError

Bases: djongo.database.DatabaseError

exception djongo.database.OperationalError

Bases: djongo.database.DatabaseError

exception djongo.database.ProgrammingError

Bases: djongo.database.DatabaseError

djongo.database.connect(**kwargs)

djongo.features module

class djongo.features.DatabaseFeatures(connection)

Bases: django.db.backends.base.features.BaseDatabaseFeatures

has_bulk_insert = False
has_native_uuid_field = True
supports_transactions = False

djongo.introspection module

class djongo.introspection.DatabaseIntrospection(connection)

Bases: django.db.backends.base.introspection.BaseDatabaseIntrospection

SAMPLE_SIZE = 10000
TYPE_MAPPING = {<class 'int'>: <class 'bson.int64.Int64'>}
data_types_reverse = {<class 'str'>: 'CharField', 'text': 'TextField', <class 'bson.int64.Int64'>: 'BigIntegerField', <class 'datetime.date'>: 'DateField', <class 'bson.objectid.ObjectId'>: 'ObjectIdField', <class 'float'>: 'FloatField', <class 'datetime.datetime'>: 'DateTimeField', <class 'dict'>: 'JSONField', <class 'collections.OrderedDict'>: 'JSONField', <class 'bool'>: 'BooleanField', <class 'int'>: 'IntegerField', <class 'list'>: 'JSONField'}
get_constraints(cursor, table_name)

Retrieve any constraints or keys (unique, pk, fk, check, index) across one or more columns. Since MongoDB doesn’t really support foreign keys this will only ever return unique constraints and primary keys

get_indexes(cursor, table_name)

Effectively an alias for get_constraints

get_key_columns(cursor, table_name)

Key columns are not supported so this always returns []

get_relations(cursor, table_name)

Relations are not supported so this always returns []

get_table_description(cursor, table_name)

Get a colletction description by fetching a sample of SAMPLE_SIZE and analyzing it’s contents. Because MongoDB doesn’t have a fixed document specification this is only an approximation but depending on the SAMPLE_SIZE relative to the collection size it can be rather accurate.

get_table_list(cursor)

Return a list of MongDB collections (tables)

djongo.operations module

class djongo.operations.DatabaseOperations(connection)

Bases: django.db.backends.base.operations.BaseDatabaseOperations

adapt_datefield_value(value)
adapt_datetimefield_value(value)
adapt_timefield_value(value)
convert_datefield_value(value, expression, connection, context)
convert_timefield_value(value, expression, connection, context)
get_db_converters(expression)
max_name_length()
no_limit_value()
quote_name(name)
sql_flush(style, tables, sequences, allow_cascade=False)

djongo.schema module

class djongo.schema.DatabaseSchemaEditor(connection, collect_sql=False, atomic=True)

Bases: django.db.backends.base.schema.BaseDatabaseSchemaEditor

Module contents