Re: Django 3.0 Compatibility

2019-12-02 Thread Carlton Gibson
3.11 is due to be released soon. But did you actually try it with 3.10? Does it not already just work? > On 2 Dec 2019, at 15:20, Raunaq Singh wrote: > > Hello everyone! > > Django 3.0 has been released today. Does anyone know what's DRF's support > plan for the same? > > Thank you :) > >

Re: Does Django REST framework supports django 3 alpha release ?

2019-10-01 Thread Carlton Gibson
I think (but need to check) that DRF’s master branch is already compatible with Django 3.0a1. Before Django 3.0 is released Django REST Framework will have a compatible release available. (The current “preview” period is precisely for this purpose.) > On 1 Oct 2019, at 07:42, PK P. wrote: >

Re: exact lookup in SearchFilter

2019-09-17 Thread Carlton Gibson
That looks like it’ll land in v3.1, so “just making a subclass” might be the way to go for the meantime. C. > On 17 Sep 2019, at 12:23, Oskar Persson wrote: > > It would be nice to have a way to use "exact" instead of "iexact" in > SearchFilter, especially for UUIDField when using SQLite or

Re: Docstring and schemas problem

2019-09-01 Thread Carlton Gibson
Hi Stefano. Parsing the docstring is not yet implemented for OpenAPI schemas. There is basic parsing as part of the CoreAPI stuff which could be ported. This wouldn’t be hard I’d think, so would be a good opportunity to contribute. A couple of points: * We’re never going to do anything very

Re: validated_data empty when is_valid() is True

2019-08-20 Thread Carlton Gibson
Can you print(serialized) in the shell? Auto generated ID fields are read-only I think. On Tue, 20 Aug 2019 at 14:40, David Binetti wrote: > I'm perplexed and can't figure out what I'm missing. I've stripped a > ModelSerializer down to just the PK (a UUID) and am trying to create a > serialize

Re: OpenAPI Schema Generation and lazy strings

2019-07-24 Thread Carlton Gibson
Hiya. Can you open a ticket? (I’m guessing we may need to throw in a force_text()...) Thanks! On Wed, 24 Jul 2019 at 10:14, Chris Vigelius wrote: > Hello, > > I'm trying to use the new generateschema command from 3.10. However it > seems this does not handle lazy strings correctly. > > Using t

Re: get_schema_view() seems to ignore api prefix

2019-07-18 Thread Carlton Gibson
Hi Christopher, Reading #6675, I’m not entirely convinced it’s the same issue. (Related, sure.) Could you open a ticket with your exact case as well please? I’d rather close it as a duplicate than miss a second case. Thanks. Kind Regards, Carlton > On 18 Jul 2019, at 21:57, Carl

Re: get_schema_view() seems to ignore api prefix

2019-07-18 Thread Carlton Gibson
Grrr. That totally missed my radar. (Life.) OK, thanks I’ll have a look at that. (PRs with test cases still welcome 🙂) > On 18 Jul 2019, at 21:55, Christopher Sund wrote: > > On the DRF github it appears there is an open Issue # >

Re: get_schema_view() seems to ignore api prefix

2019-07-18 Thread Carlton Gibson
The `url` parameter is meant to set the base url, so assuming you’re passing this, it could be a bug. Can you open an issue with full details: https://github.com/encode/django-rest-framework/issues/new (A PR adding a test case for this would be awesome, if you’re up for that.) If we can ver

Re: camelCase support

2019-05-13 Thread Carlton Gibson
https://github.com/vbabiy/djangorestframework-camel-case > On 13 May 2019, at 18:47, Cesar Canassa wrote: > > It's a system-to-system API, it's not being consumed by a browser. I have to > follow camelCase because it's the internal company standard for APIs > > On Mon, May 13, 2019 at 6:43 PM

Django REST Framework v3.9.3

2019-04-29 Thread Carlton Gibson
Django REST Framework v3.9.3 is now available on PyPI. This will be the last version of Django REST Framework to support Python 2, so if you're on that, update now. -- You received this message because you are subscribed to the Google Groups "Django REST framework" group. To unsubscribe from

Version 3.9.2 now available.

2019-03-03 Thread Carlton Gibson
Django REST Framework version 3.9.2 is now available on PyPI. https://pypi.org/project/djangorestframework/ See the release notes for more details: https://www.django-rest-framework.org/community/release-notes/#392 Thanks to everyone who contributed effort for this release. Kind Regards, Carl

Re: Best way to add bulk operation routes under standard ModelViewSet route

2019-02-15 Thread Carlton Gibson
HI Clara. Nothing wrong with any of the options... I personally would use option 4, declaring an APIView class (or GenericAPIView subclass as appropriate) for each endpoint, abstracting any re-usable bit, like the serialiser class or what-not. You can add extra actions to your viewset. That’

Re: Can we have different fields included when deserializing than when serializing?

2019-02-07 Thread Carlton Gibson
Try this: https://www.django-rest-framework.org/api-guide/fields/#write_only Worth having a look through all those options. There’s lots good there. Good luck. > On 6 Feb 2019, at 20:13, steve.haw...@cohereum.com wrote: >

Re: Filtering a field list or disabling the HTML form in the browsable API

2019-01-30 Thread Carlton Gibson
> On 31 Jan 2019, at 08:22, Jayen wrote: > > Should I have separate views for the two types of users? Argh! 🙂 It depends… — there’s so many things to consider. It’d be simpler. But it would affect your URL structure. And so on… If the issue if just the Browsable API, I’d think about using r

Re: Filtering a field list or disabling the HTML form in the browsable API

2019-01-30 Thread Carlton Gibson
Hi Jayen. > On 31 Jan 2019, at 07:12, Jayen Jayen wrote: > > I have a model for which I only allow POST requests for some users (no GET or > other method). I am using `viewsets.ModelViewSet` and > `serializers.HyperlinkedModelSerializer`. There’s many things that could be going on but, why

Re: ImportError: Could not import 'rest_framework.filters.DjangoFilterBackend' for API setting

2019-01-19 Thread Carlton Gibson
The backend was moved out in 3.5 and went through the deprecation process, finally being removed in 3.7. https://www.django-rest-framework.org/community/3.7-announcement/ Update your imports to use django_filters.rest_framework, as per the docs linked in Jakob's reply. Sent from my iPhone >

Re: Sorry to be "that noob" but help with Create/Post using TemplateHTMLRenderer and a nested serializer?

2018-11-14 Thread Carlton Gibson
Looking at your original error, it seems you have a QuerySet where you should have an instance: Got AttributeError when attempting to get a value for field `software` on serializer `LicensedSoftwareSerializer`. The serializer field might be named incorrectly and not match any attribute or key o

Re: Sorry to be "that noob" but help with Create/Post using TemplateHTMLRenderer and a nested serializer?

2018-11-14 Thread Carlton Gibson
Well, you can’t see from what you’ve provided but you LicencedSoftware model doesn’t have a foreign key called software to your Software model. Sort that out and it will work. (Look at your references and make sure the names match.) Sent from my iPhone > On 14 Nov 2018, at 18:29, Toni Marie

Re: Sorry to be "that noob" but help with Create/Post using TemplateHTMLRenderer and a nested serializer?

2018-11-14 Thread Carlton Gibson
Hi Toni I guess you’re hitting this: https://github.com/encode/django-rest-framework/issues/5236 See the PR here: https://github.com/encode/django-rest-framework/pull/6095

Re: Python 3.7

2018-09-04 Thread Carlton Gibson
There’s a PR adding CI coverage: https://github.com/encode/django-rest-framework/pull/6141 Bar an adjustment to a test, it all passes. You should be good to go. If you find any issues, let us know on the issue tracker. > On 5 Sep 201

Re: Content negotiation vs serializer

2018-08-28 Thread Carlton Gibson
> On 27 Aug 2018, at 21:32, Ola > wrote: > > I have a usecase where I need to implement different serializers for > different format. In `get_serializer()` or `get_serializer_class()` inspect the format and act appropriately. -- You received this messa

Re: Database for Unit Test

2018-08-21 Thread Carlton Gibson
> On 22 Aug 2018, at 08:46, Alexander Lamas > wrote: > > NOTE: I'm running my unit tests via Microsoft Visual Studio. Configure this to use `django-admin test` (or py.test or …). django-admin takes care of creating the test database for you. (And setting up

Re: Apps aren't loaded yet

2018-08-21 Thread Carlton Gibson
how > can I do that? > > Thank you very much! > > Alex > > On Mon, Aug 20, 2018 at 5:17 PM, Carlton Gibson <mailto:carlton.gib...@gmail.com>> wrote: > How are you running your tests? (django-admin test does all this for you…) > > >> On 20 Aug 2018,

Re: Apps aren't loaded yet

2018-08-20 Thread Carlton Gibson
How are you running your tests? (django-admin test does all this for you…) > On 20 Aug 2018, at 10:16, Alexander Lamas > wrote: > > I actually, just found out that I have to add these 2 lines in the beginning > of my test file. > > import django > django.se

Re: Apps aren't loaded yet

2018-08-20 Thread Carlton Gibson
> On 20 Aug 2018, at 09:33, Alexander Lamas > wrote: > > I'm getting a message like "Apps aren't loaded yet". This normally means you’re trying “use” a model at import-time, i.e. when the scripts are first loaded. Look at the full traceback and see where you

Re: Making data case insensitive

2018-05-10 Thread Carlton Gibson
Hi Manoj. Check out the field validation docs: http://www.django-rest-framework.org/api-guide/serializers/#field-level-validation Implement a `validate_name` method to transform using `value.lower()`. (or similar.) Kind Regards, Carlton -- You received this message because you are subscri

Re: APIClient and accept_language header

2018-04-16 Thread Carlton Gibson
Hi David, > On 14 Apr 2018, at 07:41, Daviddd > wrote: > > ACCEPT_LANGUAGE='es' I think you’d need to pass it like this: HTTP_ACCEPT_LANGUAGE=‘es' Kind Regards, Carlton -- You received this message because you are subscribed to the Google Groups "Djan

Re: Optional trailing slashes in Routers

2018-04-13 Thread Carlton Gibson
Hi German, > On 13 Apr 2018, at 11:39, German Prostakov > wrote: > > ...without such workaround… Given how simple the workaround is, I’d bet on “No” as to including such in DRF itself. (It’s just not worth the code and tests etc.) Maybe a PR on the docs with the

Re: Usage of read_only=True with default=serializers.CurrentUserDefault() in 3.8.2

2018-04-11 Thread Carlton Gibson
Hi Stuart. This was a breaking change in v3.8. It was necessary in order to support dotted-sources with nullable fields. (The tl;dr is that having the default set for read-only fields in these cases led to unavoidable inconsistencies, so we had to change it.) You now need to pass the value of

Re: How to see document for older version?

2018-04-11 Thread Carlton Gibson
Hi. > On 11 Apr 2018, at 07:53, HyeonChol Jang wrote: > How do I access document for the specific version? Your best bet is to build the docs locally. * Clone the repo. * Check out the 3.7.7 tag * pip install mkdocs * mkdocs build http://www.django-rest-framework.org/topics/contributing/#b

Version 3.8.2 Released

2018-04-06 Thread Carlton Gibson
Hi All, Django REST Framework version 3.8.2 is now available on PyPI. https://pypi.python.org/pypi/djangorestframework/3.8.2 Release Notes: http://www.django-rest-framework.org/topics/release-notes/#38 2 Enjoy. Kind Regards,

Version 3.8.1 Released

2018-04-04 Thread Carlton Gibson
Hi All, Django REST Framework version 3.8.1 is now available on PyPI. https://pypi.python.org/pypi/djangorestframework/3.8.1 It's just a quick fix for a BC issue introduced in 3.8. Thanks to Xavier and Ryan for the quick report and turnaround. Release Notes: http://www.django-rest-framewo

Version 3.8.0 Released

2018-04-03 Thread Carlton Gibson
Hi All v3.8 is now available on PyPI: https://pypi.python.org/pypi/djangorestframework/3.8.0 See the Release Announcement: http://www.django-rest-framework.org/topics/3.8-announcement/ https://github.com/encode/django-rest-framework/releases/tag/3.8.0 And Release Notes: http:

Re: How to add documents to ViewSet

2018-02-01 Thread Carlton Gibson
Hi. This approach isn’t going to work with ViewSets. As you have seen, ManualSchema will be applied to each route, with no ability to scope per-action. (This is more a problem with ViewSets than anything else…) Instead you need to subclass either ManualSchema or AutoSchema and override `get_l

Version 3.7.4 Released

2017-12-20 Thread Carlton Gibson
Hi All v3.7.4 is now available on PyPI. https://pypi.python.org/pypi/djangorestframework/3.7.4 https://github.com/encode/django-rest-framework/releases/tag/3.7.4 Enjoy. Kind Regards, Carlton -- You received this message because you are subscribed to the Google Groups "Django REST framewor

Re: Which version to use for Django 1.8 (running Ecommerce site)

2017-11-10 Thread Carlton Gibson
But if you are *implementing* a new solution now you should not be using Django 1.8 — it's been out of mainstream support for nearly two years! Seriously time to upgrade. On Friday, 10 November 2017 07:32:42 UTC+1, Web Architect wrote: > > Hi, > > We have an ecommerce site running on Django 1.8

Re: Which version to use for Django 1.8 (running Ecommerce site)

2017-11-10 Thread Carlton Gibson
IIRC we dropped 1.8 support for v3.7, so 3.6.x will be your latest version. (You’ll need to look up the exact values.) > On 10 Nov 2017, at 07:32, Web Architect > wrote: > > Hi, > > We have an ecommerce site running on Django 1.8. We are planning to implement > API

Django REST Framework v3.7.3 Released.

2017-11-06 Thread Carlton Gibson
It's all go today! Django REST Framework v 3.7.2 introduced an `AppRegistryNotReady` error importing the contrib.auth views. This is was speedily reported and resolved. v3.7.3 is no available on PyPI. Enjoy. Kind Regards, Carlton -- You received this message because you are subscribed t

Django REST Framework v3.7.2 Released

2017-11-06 Thread Carlton Gibson
Hi All. Django REST Framework v3.7.2 is available now. https://github.com/encode/django-rest-framework/releases Enjoy. Kind Regards, Carlton -- You received this message because you are subscribed to the Google Groups "Django REST framework" group. To unsubscribe from this group and stop

Re: Interact button does not use correct url for api requests

2017-10-19 Thread Carlton Gibson
Hi Dustin, Try passing the `schema_url` argument. http://www.django-rest-framework.org/topics/documenting-your-api/#include_docs_url On Tuesday, 10 October 2017 19:16:16 UTC+2, Dustin Wyatt wrote: > > urls.py > ``` > router = routers.DefaultRouter() > router.register('instagram', InstagramView

Version 3.7.1 Released

2017-10-16 Thread Carlton Gibson
Hi all. Django REST Framework version 3.7.1 is now available on PyPI. This cleans up a schema generation naming conflict, improves compat with the Django 2.0 alpha, and a few other bits and pieces. See the 3.7.1 Milestone

Version 3.7.0 Released

2017-10-06 Thread Carlton Gibson
Hi all. Django REST Framework version 3.7.0 is now available on PyPI. Headline feature is the ability to add per-view customisation to schema generation. * Release Announcement: http://www.django-rest-framework.org/topics/3.7-announcement/ * 3.7.0 Milestone: https://github.com/encode/djang

Version 3.6.4 now on PyPI

2017-08-22 Thread Carlton Gibson
Django REST framework 3.6.4 has now been released. Release notes are in the usual place: http://www.django-rest-framework.org/topics/release-notes/#36x-series Enjoy. -- You received this message because you are subscribed to the Google Groups "Django REST framework" group. To unsubscribe fro

Re: Question: Permission in documentation

2017-05-26 Thread Carlton Gibson
Hi Greg, The flow here is this: documentation.get_docs_view() -> schemas.get_schema_view -> schemas. SchemaView SchemaView is (just) and APIView subclass — so you can set `permission_classes` as normal. *However*, there's not currently API to pass permission_classes down from the wrapping

Re: [GitHub Process]: New Project for API Docs?

2017-05-22 Thread Carlton Gibson
In that case I might create the labels. (Projects as still a bit half-baked in terms of functionality — especially from the list view.) On Saturday, 20 May 2017 05:08:54 UTC+2, Tom Christie wrote: > > I'd be totally cool with us having labels for "Schema generation" and > "Interactive API docs

Re: [GitHub Process]: New Project for API Docs?

2017-05-19 Thread Carlton Gibson
OK. 👍 I created project. Alas no way to add issues from the list view. (Grrr. GitHub... 🙂) On Friday, 19 May 2017 10:53:00 UTC+2, Xavier Ordoquy wrote: > > > > Le 19 mai 2017 à 10:42, Carlton Gibson > a écrit : > > > > Hiya, > > > > I'm trying

[GitHub Process]: New Project for API Docs?

2017-05-19 Thread Carlton Gibson
Hiya, I'm trying to get a grip on the tickets relating to the generated API documentation. My issue is GitHub's tracker doesn't offer great ways of filtering to just the relevant tickets. In the past we've tried using Labels to group tickets by functionality, but we have those for Process.