Re: action methods is not allowed to have more methods rather than their viewsets

2020-09-30 Thread Carl Nobile
As I said I don't use ViewSets, but if you add in mixins that cause the signature of the ViewSet to change it cannot easily and automatically generate schemas--at least this is my understanding. The mixins are used in generic views and are not generally needed when defining your own views except un

Re: action methods is not allowed to have more methods rather than their viewsets

2020-09-29 Thread Ali Yazdi
I've got a new problem with this new viewset that when I generate schema with `generateschema --file schema.yml` it says: ``` UserWarning: is not compatible with schema generation warnings.warn( ``` But, it creates the schema of that viewset! On Tuesday, September 29, 2020 at 11:04:35 PM UTC

Re: action methods is not allowed to have more methods rather than their viewsets

2020-09-29 Thread Ali Yazdi
Thanks for your answer. I try using `(mixins.RetrieveModelMixin,mixins.ListModelMixin, GenericViewSet)` without setting `http_method_names = ['get']` and my action works fine for `post` method. Thank you Carl. On Tuesday, September 29, 2020 at 9:47:59 PM UTC+3:30 carl@gmail.com wrote: > I

Re: action methods is not allowed to have more methods rather than their viewsets

2020-09-29 Thread Carl Nobile
If you set `http_method_names = ['get']` and the POST is on the same endpoint it won't allow a POST. You might want to add 'post' to that variable. I, myself don't use ViewSets. I tend to use generic Views. In your case the ListCreateAPIView generic view in this case. You can find it at https://www

action methods is not allowed to have more methods rather than their viewsets

2020-09-29 Thread Ali Yazdi
1. I have a `viewsets.ModelViewSet` that has `http_method_names = ['get']` 2. and its action method needs to have `methods=['get', 'post']` 3. But `post` method is not allowed for its action 4. I don't is it normal behavior to have this scenario or not? -- You received this message because you a