diff --git a/README.md b/README.md index a9ea12427..a4c56103a 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,13 @@ To run the tests. # Changelog +## 2.1.8 + +**Date**: 8th Dec 2012 + +* Fix for creating nullable Foreign Keys with `''` as well as `None`. +* Added `null=` related field option. + ## 2.1.7 **Date**: 7th Dec 2012 diff --git a/docs/api-guide/fields.md b/docs/api-guide/fields.md index 1d4c34cb9..50a09701e 100644 --- a/docs/api-guide/fields.md +++ b/docs/api-guide/fields.md @@ -293,6 +293,7 @@ By default these fields are read-write, although you can change this behaviour u **Arguments**: * `queryset` - By default `ModelSerializer` classes will use the default queryset for the relationship. `Serializer` classes must either set a queryset explicitly, or set `read_only=True`. +* `null` - If set to `True`, the field will accept values of `None` or the emptystring for nullable relationships. ## SlugRelatedField / ManySlugRelatedField @@ -304,6 +305,7 @@ By default these fields read-write, although you can change this behaviour using * `slug_field` - The field on the target that should be used to represent it. This should be a field that uniquely identifies any given instance. For example, `username`. * `queryset` - By default `ModelSerializer` classes will use the default queryset for the relationship. `Serializer` classes must either set a queryset explicitly, or set `read_only=True`. +* `null` - If set to `True`, the field will accept values of `None` or the emptystring for nullable relationships. ## HyperlinkedRelatedField / ManyHyperlinkedRelatedField @@ -319,6 +321,7 @@ By default, `HyperlinkedRelatedField` is read-write, although you can change thi * `slug_field` - The field on the target that should be used for the lookup. Default is `'slug'`. * `pk_url_kwarg` - The named url parameter for the pk field lookup. Default is `pk`. * `slug_url_kwarg` - The named url parameter for the slug field lookup. Default is to use the same value as given for `slug_field`. +* `null` - If set to `True`, the field will accept values of `None` or the emptystring for nullable relationships. ## HyperLinkedIdentityField diff --git a/docs/topics/release-notes.md b/docs/topics/release-notes.md index 5b371d01e..46eb1494d 100644 --- a/docs/topics/release-notes.md +++ b/docs/topics/release-notes.md @@ -4,6 +4,13 @@ > > — Eric S. Raymond, [The Cathedral and the Bazaar][cite]. +## 2.1.8 + +**Date**: 8th Dec 2012 + +* Fix for creating nullable Foreign Keys with `''` as well as `None`. +* Added `null=` related field option. + ## 2.1.7 **Date**: 7th Dec 2012 @@ -14,7 +21,7 @@ * Added pickle support for serialized data. * Support `source='dotted.notation'` style for nested serializers. * Make `Request.user` settable. -* Bugfix: Fix `RegexField` to work with `BrowsableAPIRenderer` +* Bugfix: Fix `RegexField` to work with `BrowsableAPIRenderer`. ## 2.1.6 diff --git a/rest_framework/__init__.py b/rest_framework/__init__.py index da2c5d5cb..02a606754 100644 --- a/rest_framework/__init__.py +++ b/rest_framework/__init__.py @@ -1,3 +1,3 @@ -__version__ = '2.1.7' +__version__ = '2.1.8' VERSION = __version__ # synonym