0👍
Inherit Meta explicitly and separately from the Resource, as it’s a separately-defined class:
class CommonMeta:
abstract = True
authentication = SessionAuthentication()
authorization= Authorization()
allowed_methods = ('get', 'post', 'put', 'delete', 'patch')
class MyResource(ModelResource):
...
class Meta(CommonMeta):
# Inherits CommonMeta's properties.
# Note: abstract will become False automatically.
queryset = MyModel.objects.all()
resource_name = 'my_model'
- [Django]-'dict' object has no attribute friend
- [Django]-Object could not be found in database for SearchResult django haystack
- [Django]-I deleted a css static file but my website still reads it?
Source:stackexchange.com