django-small-view-set 0.2.0__py3-none-any.whl → 0.2.1__py3-none-any.whl

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.0
3
+ Version: 0.2.1
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
@@ -28,22 +28,29 @@ This guide provides a simple example to get started with the library.
28
28
 
29
29
  ### Example Usage
30
30
 
31
- Here’s how you can define a basic API endpoint with one collection route and one detail route:
31
+ Here’s how to define a basic view set:
32
+
33
+ In settings.py
34
+ ```python
35
+ # Register SmallViewSetConfig in settings
36
+ from small_view_set SmallViewSetConfig
37
+
38
+ SMALL_VIEW_SET_CONFIG = SmallViewSetConfig()
39
+ ```
40
+
32
41
 
33
42
  ```python
34
43
  import asyncio
35
44
  from django.http import JsonResponse
36
45
  from django.urls import path
37
- from small_view_set.small_view_set import SmallViewSet
38
- from small_view_set.decorators import endpoint, endpoint_disabled
39
- from small_view_set.config import SmallViewSetConfig
46
+ from small_view_set import SmallViewSet, endpoint, endpoint_disabled
40
47
 
41
48
  class BarViewSet(SmallViewSet):
42
49
 
43
50
  def urlpatterns(self):
44
51
  return [
45
52
  path('api/bars/', self.default_router, name='bars_collection'),
46
- path('api/bars/items/', self.items, name='bars_items'),
53
+ path('api/bars/items/', self.items, name='bars_items'),
47
54
  path('api/bars/<int:pk>/', self.default_router, name='bars_detail'),
48
55
  ]
49
56
 
@@ -1,11 +1,11 @@
1
1
  small_view_set/README.md,sha256=oovLoOhBsg5wK8AwGe9iyuWXStHUo9x4fsrlb-oxHt4,1061
2
2
  small_view_set/__init__.py,sha256=lJ09qERCFrf4WAY6mRFyFsEG1R3ErpWqblIKi4TVggI,625
3
- small_view_set/config.py,sha256=GyF69JONC9t0xt1Xhcc4iVEJXx_i_22_2ufxLvNmubs,1460
4
- small_view_set/decorators.py,sha256=sWnv0629TA1IVWD-5VRDBlpCIc8J5gBK_tA0aQm6BAc,3214
3
+ small_view_set/config.py,sha256=nGu840qa6zYyXoQa1EO7xIlWh3dFPd0oYwN-2Qmj7Ws,1446
4
+ small_view_set/decorators.py,sha256=0XSnTdmhvxnkLaRanoZhZq3BNiuP8JCe4vfVFWrRQkw,3200
5
5
  small_view_set/exceptions.py,sha256=5VaPS9m9syhag7p-gveG7Dep4DV3YQ7WjI1Sv5C_1N0,966
6
6
  small_view_set/helpers.py,sha256=EKx71YLS-5cN-JrMJXYR39O15qf4O6TDiaQsal7BVwY,5117
7
7
  small_view_set/small_view_set.py,sha256=wvNY1s3DRe2pLLLxz_91MCruEDl3iScOtDa8Y8L4siQ,5566
8
- django_small_view_set-0.2.0.dist-info/LICENSE,sha256=M4ZuHeiGHHuewaZyqz7tol4E6E2GMz7fF1ywNoXD1tA,1069
9
- django_small_view_set-0.2.0.dist-info/METADATA,sha256=W2Vr6uGFpO3_6eZXarG1EIMjLJLvOj0OVQJhYeUwNm0,3601
10
- django_small_view_set-0.2.0.dist-info/WHEEL,sha256=d2fvjOD7sXsVzChCqf0Ty0JbHKBaLYwDbGQDwQTnJ50,88
11
- django_small_view_set-0.2.0.dist-info/RECORD,,
8
+ django_small_view_set-0.2.1.dist-info/LICENSE,sha256=M4ZuHeiGHHuewaZyqz7tol4E6E2GMz7fF1ywNoXD1tA,1069
9
+ django_small_view_set-0.2.1.dist-info/METADATA,sha256=UHgGDqDGiv6zTLzedn_jUtnCmCQigAgDViAhZ-hRIzQ,3607
10
+ django_small_view_set-0.2.1.dist-info/WHEEL,sha256=d2fvjOD7sXsVzChCqf0Ty0JbHKBaLYwDbGQDwQTnJ50,88
11
+ django_small_view_set-0.2.1.dist-info/RECORD,,
small_view_set/config.py CHANGED
@@ -1,6 +1,6 @@
1
1
  from typing import Callable
2
2
  from urllib.request import Request
3
- from small_view_set.helpers import default_exception_handler, default_options_and_head_handler
3
+ from .helpers import default_exception_handler, default_options_and_head_handler
4
4
 
5
5
 
6
6
  class SmallViewSetConfig:
@@ -1,7 +1,7 @@
1
1
  import inspect
2
2
  from django.conf import settings
3
3
 
4
- from small_view_set.config import SmallViewSetConfig
4
+ from .config import SmallViewSetConfig
5
5
  from .exceptions import EndpointDisabledException
6
6
 
7
7
  def endpoint(