Commit Graph

2766 Commits

Author SHA1 Message Date
Simon Charette
d87f2bc7b6 OrderingFilter adjustements (#3983)
* Made sure the OrderingFilter relies on Field.verbose_name.

* Marked OrderingFilter's order labels for translation.
2016-04-08 15:37:23 +01:00
Xavier Ordoquy
29a2e549c1 Merge remote-tracking branch 'reference/master' into bug/fix_correct_string_type 2016-04-07 18:03:12 +02:00
Xavier Ordoquy
2622588b30 Typo correction. 2016-04-07 18:00:17 +02:00
Xavier Ordoquy
019c6db759 Fix the string_types / text_types confusion introduced in #4025 (#4035) 2016-04-07 16:34:27 +01:00
Jonathan Liuti
78e4ea0d6e No auth view failing permission should raise 403
A view with no `authentication_classes` set and that fails a

permission check should raise a 403 with the message from the

failing permission.
2016-04-07 16:24:26 +01:00
Xavier Ordoquy
763aab6b45 Fix the string_types / text_types confusion introduced in #4025 2016-04-05 16:29:16 +02:00
Nitesh Lohchab
09aa8f76c4 python2.x and 3.x compatible 2016-04-03 18:39:32 +05:30
Nitesh Lohchab
c22b92a66c type('') to str 2016-04-03 00:07:45 +05:30
Xavier Ordoquy
67ac0486f5 Merge pull request #4006 from mochawich/patch-1
Reorder initializing the view
2016-03-31 13:53:14 +02:00
Tom Viner
3e5a1397d7 remove trailing slash from cramer cursor link 2016-03-24 20:37:38 +00:00
Xavier Ordoquy
cfb77ae6fa Merge pull request #3273 from olliewalsh/breadcrumbs_view_name
Do not ignore overridden View.get_view_name() in breadcrumbs
2016-03-23 01:10:13 +01:00
Xavier Ordoquy
0e8306341d Merge pull request #3936 from carltongibson/null-uuid-fk-take2
Fix None UUID ForeignKey serialization
2016-03-22 22:46:33 +01:00
Mohamad Nour Chawich
03270431ed Reorder initializing the view
Determining the version and performing content negotiation should be done before ensuring the permission of the request. The reason is that these information can be used in handling the exceptions. For example different versions may return different error scheme. Also, the rendering class can be used to determine how to exception handler response should be rendered.
2016-03-20 21:46:37 +01:00
Maxime R
24694ddcb4 Fixed use of deprecated Query.aggregates
In Django 1.8 [`Query.aggregates` is replaced by `annotations`](https://docs.djangoproject.com/es/1.9/releases/1.8/#aggregate-methods-and-modules).

Using aggregates currently raises a `RemovedInDjango20Warning`. [Django's source](https://github.com/django/django/blob/1.8/django/db/models/sql/query.py#L192)
2016-03-18 16:16:13 +01:00
Stephan Groß
a101251a2a Fix blank lines around docstrings 2016-03-17 11:06:47 +00:00
Carlton Gibson
2ef74cfa61 Bring check for null fk to BaseSerializer.to_representation 2016-03-13 20:39:19 +01:00
Mitar
2f49df8242 Run JavaScript only when DOM is ready. 2016-03-12 16:52:31 -08:00
Jared Lang
7ac8cc760c Fix empty pk detection in HyperlinkRelatedField.get_url
This implementation allows detection of empty values that are non-nullable, allowing the field to return None values for such cases
2016-02-29 12:56:56 -08:00
José Padilla
69c0de4faa Merge pull request #3953 from akarambir/remove-old-django-checks
Closes #3952: Remove old django checks from tests and compat
2016-02-19 11:08:45 -04:00
Karambir Singh Nain
69f1e3a9fd Remove old django checks from tests and compat
Remove skipping of tests for Django<1.8. Remove several functions from compat.py not needed for Django>=1.8
2016-02-19 01:47:45 +05:30
Erick Wilder
8109752061 Closes #3937. Support callable as the value of initial for any serializer.Field 2016-02-17 10:52:21 +01:00
Carlton Gibson
20d1fdba69 Fix None UUID ForeignKey serialization 2016-02-16 09:29:48 +01:00
Xavier Ordoquy
3693e938a4 Merge pull request #3908 from kostya0shift/fix_exceptions_force_text
Fixed _force_text_recursive typo
2016-02-12 08:24:13 +01:00
Federico Bond
03b5438d07 Add missing space in serializer error message 2016-02-11 15:09:21 -03:00
blag
89d575a52a Remove version string from admin template 2016-02-09 05:56:47 -07:00
blag
d2ca8872c0 Remove version string from base template 2016-02-08 22:36:39 -07:00
Mikalai Radchuk
59ab3a291c Fixes vertical html layout for BooleanField
`HTMLFormRenderer` renders `BooleanField` field as not checked if vertical layout are used.
2016-02-08 17:07:16 +03:00
Kostya Esmukov
3ea1fe61a0 Fixed _force_text_recursive typo 2016-02-07 18:58:19 +03:00
Simon Charette
1a052d6ee3 Silenced deprecation warnings on Django 1.8. 2016-02-04 13:49:55 -05:00
Mikalai Radchuk
1f2a32d506 Fixes docstrings in fields.py
Fixes docstrings for `to_choices_dict` and `flatten_choices_dict` functions in fields.py.

Mistakes were introduced in #4d69286
2016-02-03 12:36:00 +03:00
José Padilla
0512c394a3 Merge pull request #3875 from m1kola/bugfix/HTMLFormRenderer-render-renderer_context-default
Fixes AttributeError in HTMLFormRenderer.render
2016-02-01 16:28:11 -04:00
Mikhail Nacharov
d0f7b04805 enhancement #3886 Internationalization in admin interface rest_framework.authtoken
+ verbose_name in models.Token fields
+ Meta-options verbose_name & verbose_name_plural
+ Labels in AuthTokenSerializer fields in case of usages in Brousable API
+ provide AppConfig class as described in django documentation with verbose_name came through ugettext_lazy
2016-02-01 13:20:16 +05:00
Mikalay Radchuk
714607307e Fixes AttributeError in HTMLFormRenderer.render
If `HTMLFormRenderer.render` will be called with default arguments,
`AttributeError: 'NoneType' object has no attribute 'get'` will be raised.
2016-01-26 21:26:30 +03:00
Xavier Ordoquy
9e8ddb88fc Restore the abstract on Token model when the app isn't declared
The fact that we don't import Token from authentication doesn't invalidate
the need for the model to be abstract whenever the authtoken isn't listed
in the INSTALLED_APPS.
2016-01-21 13:28:32 +01:00
Xavier Ordoquy
328000fb34 Merge pull request #3624 from d6bels/master
Login form autofocus
2016-01-20 18:21:03 +01:00
Xavier Ordoquy
f1b28b4d63 Merge pull request #3605 from ryanhiebert/slug-related-field-queryset
RelatedField get_queryset and context
2016-01-20 18:17:29 +01:00
Xavier Ordoquy
e7fbd264ca Merge pull request #3703 from sniegu/master
Add missing csrf_token in AdminRenderer post form.
2016-01-19 16:58:39 +01:00
Xavier Ordoquy
8ea7d6b5c6 Merge remote-tracking branch 'origin/master' into markdown-compat
Conflicts:
	requirements/requirements-optionals.txt
2016-01-19 15:34:56 +01:00
Brad Montgomery
40b5774a33 QueryParameterVersioning does not use default version
QueryParameterVersioning does not fall back to the value used in the `DEFAULT_VERSION` setting, while other versioning schemes do. This looks like a minor change, and incorporates the `self.default_version` set in the superclass.

I'll sheepishly admit that I edited this inline without running any tests or anything, so please let me know if this needs more work.
2016-01-14 12:00:30 -06:00
Mads Jensen
215e1b6c6b Regarding #3729
python -Werror generates warnings informing that on_delete is a required keyword in Django 2.0
2016-01-14 15:14:33 +01:00
Mads Jensen
a9c394f5b7 2015 update in __init__.py file 2016-01-13 12:54:56 +01:00
areski
4e01796303 Test for TimeField not handling empty values 2016-01-11 12:16:26 +01:00
areski
a76c3ed051 Fixed TimeField not handling empty values 2016-01-11 12:14:40 +01:00
Mikalai Radchuk
6b207d93d6 DateField.to_representation unicode compatibility 2016-01-11 13:11:01 +03:00
José Padilla
057cf13578 Merge pull request #3815 from atombrella/keys_dict_3786
Fixes #3786
2016-01-09 22:47:53 -04:00
Tom Christie
f01a3d9c36 Merge pull request #3801 from koordinates/fix-nested-validation-error
Fix nested validation error being rendered incorrectly.
2016-01-07 09:22:23 +00:00
Mads Jensen
d4cdb21de9 Fixes #3786
Minor fix for dictionary key lookup in settings file
2016-01-06 22:51:11 +01:00
Kevin Massey
7cd3933144 Fixes #3804, avoiding update of Meta.extra_kwargs
Added unit test to cover.
2016-01-06 15:04:51 -05:00
Craig de Stigter
651319e2da Fix nested validation error being rendered incorrectly.
Previously an extra list wrapped nested validation errors raised from serializer's validate() methods.
That was inconsistent with the format of validation errors raised by validate_<fieldname> methods.
i.e. these two resulted in *different* behaviour:

    def validate_foo(self):
        raise ValidationError(['bar'])

    def validate(self):
        raise ValidationError({'foo': ['bar']})
2016-01-06 16:05:43 +13:00
Tom Christie
37f7b76f72 Merge pull request #3785 from sheppard/authtoken-import
don't import authtoken model until needed
2016-01-05 17:28:48 +00:00