django-small-view-set 0.2.5__tar.gz → 0.2.6__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: django-small-view-set
3
- Version: 0.2.5
3
+ Version: 0.2.6
4
4
  Summary: A lightweight Django ViewSet alternative with minimal abstraction.
5
5
  Home-page: https://github.com/nateonguitar/django-small-view-set
6
6
  License: MIT
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
4
4
 
5
5
  [tool.poetry]
6
6
  name = "django-small-view-set"
7
- version = "0.2.5"
7
+ version = "0.2.6"
8
8
  description = "A lightweight Django ViewSet alternative with minimal abstraction."
9
9
  readme = "README.md"
10
10
  authors = ["Nate Brooks"]
@@ -10,6 +10,7 @@ def endpoint(
10
10
  func_name = func.__name__
11
11
  def sync_wrapper(viewset, *args, **kwargs):
12
12
  request = args[0]
13
+ args = args[1:]
13
14
  try:
14
15
  config: SmallViewSetConfig = getattr(settings, 'SMALL_VIEW_SET_CONFIG', SmallViewSetConfig())
15
16
  pre_response = config.options_and_head_handler(request, allowed_methods)
@@ -17,14 +18,15 @@ def endpoint(
17
18
  return pre_response
18
19
  pk = kwargs.pop('pk', None)
19
20
  if pk is None:
20
- return func(viewset, request=request)
21
+ return func(viewset, request=request, *args, **kwargs)
21
22
  else:
22
- return func(viewset, request=request, pk=pk)
23
+ return func(viewset, request=request, pk=pk, *args, **kwargs)
23
24
  except Exception as e:
24
25
  return config.exception_handler(request, func_name, e)
25
26
 
26
27
  async def async_wrapper(viewset, *args, **kwargs):
27
28
  request = args[0]
29
+ args = args[1:]
28
30
  try:
29
31
  config: SmallViewSetConfig = getattr(settings, 'SMALL_VIEW_SET_CONFIG', SmallViewSetConfig())
30
32
  pre_response = config.options_and_head_handler(request, allowed_methods)
@@ -32,9 +34,9 @@ def endpoint(
32
34
  return pre_response
33
35
  pk = kwargs.pop('pk', None)
34
36
  if pk is None:
35
- return await func(viewset, request=request)
37
+ return await func(viewset, request=request, *args, **kwargs)
36
38
  else:
37
- return await func(viewset, request=request, pk=pk)
39
+ return await func(viewset, request=request, pk=pk, *args, **kwargs)
38
40
  except Exception as e:
39
41
  return config.exception_handler(request, func_name, e)
40
42