summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2012-12-13 22:11:06 +0100
committerClaude Paroz <claude@2xlibre.net>2013-03-02 10:29:02 +0100
commit8ee1eddb7e148de89aebde9e68da495633fc1ec9 (patch)
tree36b83db0cf15b0be47557449b9ed056646099542 /docs
parent0f306cad8442f9808e4410f190f434144ff6376a (diff)
Add a BinaryField model field
Thanks Michael Jung, Charl Botha and Florian Apolloner for review and help on the patch.
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/models/fields.txt16
-rw-r--r--docs/releases/1.6.txt6
2 files changed, 22 insertions, 0 deletions
diff --git a/docs/ref/models/fields.txt b/docs/ref/models/fields.txt
index 1a0f93cf9d..1dbc8c3998 100644
--- a/docs/ref/models/fields.txt
+++ b/docs/ref/models/fields.txt
@@ -347,6 +347,22 @@ A 64 bit integer, much like an :class:`IntegerField` except that it is
guaranteed to fit numbers from -9223372036854775808 to 9223372036854775807. The
default form widget for this field is a :class:`~django.forms.TextInput`.
+``BinaryField``
+-------------------
+
+.. class:: BinaryField([**options])
+
+.. versionadded:: 1.6
+
+A field to store raw binary data. It only supports ``bytes`` assignment. Be
+aware that this field has limited functionality. For example, it is not possible
+to filter a queryset on a ``BinaryField`` value.
+
+.. admonition:: Abusing ``BinaryField``
+
+ Although you might think about storing files in the database, consider that
+ it is bad design in 99% of the cases. This field is *not* a replacement for
+ proper :ref.`static files <static-files> handling.
``BooleanField``
----------------
diff --git a/docs/releases/1.6.txt b/docs/releases/1.6.txt
index 34fa687290..89e7ff17ee 100644
--- a/docs/releases/1.6.txt
+++ b/docs/releases/1.6.txt
@@ -53,6 +53,12 @@ UTC. This limitation was lifted in Django 1.6. Use :meth:`QuerySet.datetimes()
<django.db.models.query.QuerySet.datetimes>` to perform time zone aware
aggregation on a :class:`~django.db.models.DateTimeField`.
+``BinaryField`` model field
+~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+A new :class:`django.db.models.BinaryField` model field allows to store raw
+binary data in the database.
+
Minor features
~~~~~~~~~~~~~~