| Age | Commit message (Collapse) | Author | |
|---|---|---|---|
| 2013-04-26 | Deal with List/Instance suffixes for viewsets | Tom Christie | |
| 2013-04-04 | Factor view names/descriptions out of View class | Tom Christie | |
| 2013-02-22 | XML cleanup | Tom Christie | |
| 2013-02-04 | Cleanup imports | Tom Christie | |
| Mostly adding `from __future__ import unicode_literals` everywhere. | |||
| 2013-02-01 | Py3k cleanup | Tom Christie | |
| 2013-02-01 | Merge branch 'p3k' of https://github.com/linovia/django-rest-framework into ↵ | Tom Christie | |
| working Conflicts: rest_framework/authentication.py rest_framework/relations.py rest_framework/serializers.py rest_framework/settings.py rest_framework/tests/authentication.py rest_framework/tests/genericrelations.py rest_framework/tests/generics.py rest_framework/tests/relations_hyperlink.py rest_framework/tests/relations_nested.py rest_framework/tests/relations_pk.py rest_framework/tests/serializer.py | |||
| 2013-01-15 | Add 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-05 | deprecate simplejson | Juan Riaza | |
| 2013-01-03 | Move the various compat things to the compat module. | Xavier Ordoquy | |
| 2012-11-24 | Every (base) test should now pass with python3. | Xavier Ordoquy | |
| 2012-11-23 | Default encoding should probably be latin-1 as some RFC seems to imply it. | Xavier Ordoquy | |
| 2012-11-22 | 6 first tests passes under python 3.2 | Xavier Ordoquy | |
| 2012-11-22 | First passing test under p3k \o/ | Xavier Ordoquy | |
| 2012-11-07 | Make filtering optional, and pluggable. | Tom Christie | |
| 2012-11-07 | Fix repeated breadcrumbs when optional trailing slash is used | Tom Christie | |
| 2012-10-15 | Tweak parsers to take parser_context | Tom Christie | |
| 2012-10-10 | Fix yaml rendering | Tom Christie | |
| 2012-09-20 | Change package name: djangorestframework -> rest_framework | Tom Christie | |
