Commit Graph

25 Commits

Author SHA1 Message Date
Konstantin Kuchkov
71f87a5864
Fix NamespaceVersioning ignoring DEFAULT_VERSION on non-None namespaces (#7278)
* Fix the case where if the namespace is not None and there's no match,
  NamespaceVersioning always raises NotFound even if DEFAULT_VERSION
  is set or None is in ALLOWED_VERSIONS

* Add test cases
2023-06-14 19:24:09 +06:00
jornvanwier
a25aac7d67
fix URLPathVersioning reverse fallback (#7247)
* fix URLPathVersioning reverse fallback

* add test for URLPathVersioning reverse fallback

* Update tests/test_versioning.py

---------

Co-authored-by: Jorn van Wier <jorn.van.wier@thunderbyte.ai>
Co-authored-by: Asif Saif Uddin <auvipy@gmail.com>
2023-05-18 09:46:40 +06:00
Adam Johnson
410575dace
Replace all url() calls with path() or re_path() (#7512)
* url() is deprecated in Django 3.1

* update given feedbacks on url() is deprecated in Django 3.1

* Fix test_urlpatterns.py to continue testing mixed re_path() and path()

* Fix one missed reference

Co-authored-by: sanjusci <sanju.sci9@gmail.com>
2020-09-08 15:32:27 +01:00
Jon Dufresne
3f19e66d9f Replace all usage ugettext functions with the non-u versions (#6634)
On Python 3, the ugettext functions are a simple aliases of their non-u
counterparts (the 'u' represents Python 2 unicode type). Starting with
Django 3.0, the u versions will be deprecated.

https://docs.djangoproject.com/en/dev/releases/3.0/#id2

> django.utils.translation.ugettext(), ugettext_lazy(), ugettext_noop(),
> ungettext(), and ungettext_lazy() are deprecated in favor of the
> functions that they’re aliases for:
> django.utils.translation.gettext(), gettext_lazy(), gettext_noop(),
> ngettext(), and ngettext_lazy().
2019-05-01 07:49:54 +02:00
Carlton Gibson
0407a0df8a
Dropped Python 2 compatibility. (#6615)
Thanks to Jon Dufresne (@jdufresne) for review.

Co-authored-by: Asif Saif Uddin <auvipy@gmail.com>
Co-authored-by: Rizwan Mansuri <Rizwan@webbyfox.com>
2019-04-30 17:53:44 +02:00
Yaser Khahani
0cf18c4163 Use Default Version in URLPathVersioning if 'version' Didn't Specified by Client (#6380)
* Use Default Version in URLPathVersioning if 'version' Didn't Passed

* Clean Code
2019-01-08 11:34:54 +00:00
Artem Muterko
4dd71d68d2 Remove extra parentheses (#4789) 2017-01-08 16:09:23 +00:00
Daniel Hahler
378b04eeaa Fix handling of ALLOWED_VERSIONS and no DEFAULT_VERSION (#4370)
When only `ALLOWED_VERSIONS` but no `DEFAULT_VERSION` is specified, a
version should be enforced.
2016-08-10 15:19:56 +01:00
Dmitry Dygalo
e1768bdc16 Fixed various typos (#4366) 2016-08-08 09:32:22 +01:00
Tom Christie
bc3485ab7d Namespace versioning with nested namespaces (#4219)
Support nested namespaces with namespaced versioning.
2016-06-23 16:00:11 +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
José Padilla
7351a3f6ca Sort imports with isort 2015-06-25 16:55:51 -04:00
José Padilla
83c9136c90 Cleanup import following PEP 8 style guide 2015-06-25 16:10:17 -04:00
José Padilla
0be6d87fac Fix versioning urls 2015-06-15 16:51:37 -04:00
Tom Christie
e1c4513312 Fix NamespaceVersioning with hyperlinked serializer fields 2015-02-05 00:58:09 +00:00
Brandon Cazander
77d061d234 Provide rest_framework.resolve. Fixes #2489 2015-02-02 20:37:33 -08:00
Tom Christie
3cc39ffbce NotImplemented -> NotImplementedError 2015-01-19 15:22:38 +00:00
Craig Blaszczyk
91e316f781 prefer single quotes in source and double quotes in user visible strings; add some missing full stops to user visible strings 2015-01-07 12:46:23 +00:00
Craig Blaszczyk
9a4267049b use double quotes in user messages 2015-01-07 12:33:37 +00:00
Craig Blaszczyk
4c32083b8b use double quotes for user visible strings; end user visible strings in full stops; add some missing translation tags 2015-01-07 12:01:11 +00:00
Tom Christie
05a6eaec8a More docs, plus 'ALLOWED_VERSIONS' setting. 2014-12-17 12:41:46 +00:00
Tom Christie
70bd3a32f7 Minor comment tweak 2014-12-16 20:01:01 +00:00
Tom Christie
fe9647ce92 AcceptHeaderVersioning to return unicode strings. 2014-12-16 16:37:32 +00:00
Tom Christie
4e91ec6133 Added NamespaceVersioning 2014-12-16 16:14:08 +00:00
Tom Christie
6e51e4f5cd Versioning first pass 2014-12-16 15:34:19 +00:00