aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework
AgeCommit message (Collapse)Author
2013-01-26Version 2.1.172.1.17Tom Christie
2013-01-26Test for custom pagination serializers. Also refs #604.Tom Christie
2013-01-26Fix issues with custom pagination serializersTom Christie
2013-01-26Serializers should accept source='*' argument. Fixes #604.Tom Christie
(Test also incoming)
2013-01-25Test for GFK, using RelatedField. Refs #607.Tom Christie
2013-01-25Cleaning up GFK test module. Refs #607.Tom Christie
2013-01-24Test for #552.Tom Christie
2013-01-23Merge pull request #603 from minddust/validation_errorTom Christie
Add failed testcase for fieldvalidation + fix
2013-01-23Pass PaginationSerializer context through to child ModelSerializer on init. ↵Tom Christie
Fixes #595. Fixes #552.
2013-01-23Improve validate_<fieldname> fixStephan Groß
2013-01-23Add separate test for failed custom validationStephan Groß
2013-01-22Merge branch 'master' into unauthenticated_responseTom Christie
Conflicts: docs/api-guide/authentication.md
2013-01-21WWW-Authenticate responsesTom Christie
2013-01-21Merge pull request #602 from kevinastone/masterTom Christie
TestCase for `format_suffix_patterns`
2013-01-21Don't do an inverted if test.Tom Christie
2013-01-21Tweaked some method names to be more clear and added a docstring to the test ↵Kevin Stone
case class. Signed-off-by: Kevin Stone <kevinastone@gmail.com>
2013-01-21Add possible solution for field validation errorStephan Groß
2013-01-21Add failed testcase for fieldvalidationStephan Groß
2013-01-20Added test case for format_suffix_patterns to validate changes introduced ↵Kevin Stone
with issue #593. Signed-off-by: Kevin Stone <kevinastone@gmail.com>
2013-01-19Include kwargs in included URLsTom Christie
2013-01-19Drop print statementTom Christie
2013-01-19`format_suffix_patterns` now support `include`-style nested URL patterns. ↵Tom Christie
Fixes #593
2013-01-19Raise assertion errors if @api_view decorator is applied incorrectly. Fixes ↵Tom Christie
#596.
2013-01-19Drop unneeded testTom Christie
2013-01-18Raise Validation Errors when relationships receive incorrect types. Fixes #590.Tom Christie
2013-01-18Revert accidental merge.Tom Christie
2013-01-16Use None to delete nested object as opposed to _delete flagMark Aaron Shirley
2013-01-16Move nested serializer logic into .field_from_native()Mark Aaron Shirley
2013-01-16Add one-to-one nested update and delete functionalityMark Aaron Shirley
2013-01-16Update errant test commentMark Aaron Shirley
2013-01-16Update one-to-one test namesMark Aaron Shirley
2013-01-16Remove commented out debug codeMark Aaron Shirley
2013-01-16Add nested create for 1to1 reverse relationshipsMark Aaron Shirley
2013-01-16Drop bits of relations_slug tests which don't mirror existing tests.Tom Christie
2013-01-16Merge branch 'master' of ↵Tom Christie
https://github.com/steve-gregory/django-rest-framework into slug-field-fixes
2013-01-15Added a new file 'relations_slug.py' that tests Nullable Foreign Keys and ↵Steven Gregory
the SlugRelatedField
2013-01-15Merge pull request #584 from radiosilence/masterTom Christie
Adding timedelta support to JSONEncoder, and an example of how to add decode support to a serializer.
2013-01-15Add timedelta encoder to the JSONEncoder class.James Cleveland
Whilst this commit adds *encoding* of timedeltas to a string of a floating point value of the seconds, you must add your own serializer field for whatever timedelta model field you are using. This is because Django doesn't support any kind of timedelta field out-of-the-box, so you have to either implement your own or use django-timedelta. If this is the case and you want to serialise timedelta input, you will have to implement your own special field to use for the timedelta, which is not included in core as it is based on a 3rd party library. Here is an example: import datetime import timedelta from django import forms from django.core import validators from django.core.exceptions import ValidationError from django.utils.translation import ugettext_lazy as _ from rest_framework.fields import WritableField class TimedeltaField(WritableField): type_name = 'TimedeltaField' form_field_class = forms.FloatField default_error_messages = { 'invalid': _("'%s' value must be in seconds."), } def from_native(self, value): if value in validators.EMPTY_VALUES: return None try: return datetime.timedelta(seconds=float(value)) except (TypeError, ValueError): msg = self.error_messages['invalid'] % value raise ValidationError(msg) Which is based on the FloatField. This field can then be used in your serializer like this: from yourapp.fields import TimedeltaField class YourSerializer(serializers.ModelSerializer): duration = TimedeltaField()
2013-01-15correcting template: closing tag was missingJohannes Spielmann
2013-01-15Update docstringsTom Christie
2013-01-14Version 2.1.162.1.16Tom Christie
2013-01-12PK fields should only be read-only if they are an AutoField. Fixes #563Tom Christie
2013-01-12auto_now and auto_now_add fields should be read only by defaultTom Christie
2013-01-10unused importsJuan Riaza
2013-01-08Merge remote-tracking branch 'upstream/master' into null-one-to-oneMark Aaron Shirley
2013-01-08Merge pull request #566 from mjtamlyn/patch-1Tom Christie
ObtainAuthToken pluggable Serializer.
2013-01-08Merge branch 'master' of https://github.com/tomchristie/django-rest-frameworkTom Christie
2013-01-08Fix inconsistent view_name logic. Fixes #567.Tom Christie
2013-01-08ObtainAuthToken pluggable Serializer.Marc Tamlyn
It should have serializer_class in the same way as any other API view.
2013-01-07Create separate *NullableOneToOneTests TestCaseMark Aaron Shirley