django-small-view-set 0.2.0__tar.gz → 0.2.1__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.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
 
@@ -8,22 +8,29 @@ This guide provides a simple example to get started with the library.
8
8
 
9
9
  ### Example Usage
10
10
 
11
- Here’s how you can define a basic API endpoint with one collection route and one detail route:
11
+ Here’s how to define a basic view set:
12
+
13
+ In settings.py
14
+ ```python
15
+ # Register SmallViewSetConfig in settings
16
+ from small_view_set SmallViewSetConfig
17
+
18
+ SMALL_VIEW_SET_CONFIG = SmallViewSetConfig()
19
+ ```
20
+
12
21
 
13
22
  ```python
14
23
  import asyncio
15
24
  from django.http import JsonResponse
16
25
  from django.urls import path
17
- from small_view_set.small_view_set import SmallViewSet
18
- from small_view_set.decorators import endpoint, endpoint_disabled
19
- from small_view_set.config import SmallViewSetConfig
26
+ from small_view_set import SmallViewSet, endpoint, endpoint_disabled
20
27
 
21
28
  class BarViewSet(SmallViewSet):
22
29
 
23
30
  def urlpatterns(self):
24
31
  return [
25
32
  path('api/bars/', self.default_router, name='bars_collection'),
26
- path('api/bars/items/', self.items, name='bars_items'),
33
+ path('api/bars/items/', self.items, name='bars_items'),
27
34
  path('api/bars/<int:pk>/', self.default_router, name='bars_detail'),
28
35
  ]
29
36
 
@@ -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.0"
7
+ version = "0.2.1"
8
8
  description = "A lightweight Django ViewSet alternative with minimal abstraction."
9
9
  readme = "README.md"
10
10
  authors = ["Nate Brooks"]
@@ -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(