This is a reference of both fields that are implemented in djangotoolbox and fields specific to MongoDB.
(In signatures, ... represents arbitrary positional and keyword arguments that are passed to django.db.models.Field.)
Field representing a Python list.
If the optional keyword argument ordering is given, it must be a callable that is passed to list.sort() as key argument. If ordering is given, the items in the list will be sorted before sending them to the database.
Field representing a Python set.
Field representing a Python dict.
The field type conversions described in AbstractIterableField only affect values of the dictionary, not keys.
Depending on the backend, keys that aren’t strings might not be allowed.
Field that allows you to embed a model instance.
| Parameters: | model – (optional) The model class that shall be embedded (may also be passed as string similar to relation fields) |
|---|
A field for storing blobs of binary data.
The value might either be a string (or something that can be converted to a string), or a file-like object.
In the latter case, the object has to provide a read method from which the blob is read.
GridFS field to store large chunks of data (blobs) in GridFS.
Model instances keep references (ObjectIds) to GridFS files (gridfs.GridOut) which are fetched on first attribute access.
| Parameters: | delete – Whether to delete the data stored in the GridFS (as GridFS files) when model instances are deleted (default: True). Note that this doesn’t have any influence on what happens if you update the blob value by assigning a new file, in which case the old file is always deleted. |
|---|
Similar to GridFSField, but the data is represented as a bytestring on Python side. This implies that all data has to be copied into memory, so GridFSString is for smaller chunks of data only.