djongo package¶
Subpackages¶
Submodules¶
djongo.base module¶
djongo.cursor module¶
djongo.database module¶
-
exception
djongo.database.
DataError
¶
-
exception
djongo.database.
DatabaseError
¶ Bases:
djongo.database.Error
-
exception
djongo.database.
Error
¶ Bases:
Exception
-
exception
djongo.database.
IntegrityError
¶
-
exception
djongo.database.
InterfaceError
¶ Bases:
djongo.database.Error
-
exception
djongo.database.
InternalError
¶
-
exception
djongo.database.
NotSupportedError
¶
-
exception
djongo.database.
OperationalError
¶
-
exception
djongo.database.
ProgrammingError
¶
-
djongo.database.
connect
(**kwargs)¶
djongo.features module¶
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