django-small-view-set 0.1.0__py3-none-any.whl → 0.1.2__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.
- django_small_view_set-0.1.2.dist-info/METADATA +33 -0
- {django_small_view_set-0.1.0.dist-info → django_small_view_set-0.1.2.dist-info}/RECORD +5 -5
- small_view_set/README.md +4 -7
- django_small_view_set-0.1.0.dist-info/METADATA +0 -49
- {django_small_view_set-0.1.0.dist-info → django_small_view_set-0.1.2.dist-info}/LICENSE +0 -0
- {django_small_view_set-0.1.0.dist-info → django_small_view_set-0.1.2.dist-info}/WHEEL +0 -0
@@ -0,0 +1,33 @@
|
|
1
|
+
Metadata-Version: 2.1
|
2
|
+
Name: django-small-view-set
|
3
|
+
Version: 0.1.2
|
4
|
+
Summary: A lightweight Django ViewSet alternative with minimal abstraction.
|
5
|
+
Home-page: https://github.com/nateonguitar/django-small-view-set
|
6
|
+
License: MIT
|
7
|
+
Keywords: django,viewset
|
8
|
+
Author: Nate Brooks
|
9
|
+
Requires-Python: >=3.8
|
10
|
+
Classifier: License :: OSI Approved :: MIT License
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
12
|
+
Classifier: Programming Language :: Python :: 3.8
|
13
|
+
Classifier: Programming Language :: Python :: 3.9
|
14
|
+
Classifier: Programming Language :: Python :: 3.10
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
16
|
+
Requires-Dist: django (>=3.2)
|
17
|
+
Project-URL: Repository, https://github.com/nateonguitar/django-small-view-set
|
18
|
+
Description-Content-Type: text/markdown
|
19
|
+
|
20
|
+
# Django Small View Set
|
21
|
+
|
22
|
+
A lightweight Django ViewSet alternative with minimal abstraction. This library provides a simple and transparent way to define API endpoints without relying on complex abstractions.
|
23
|
+
|
24
|
+
## Documentation
|
25
|
+
|
26
|
+
- [Getting Started](./README_SIMPLE.md): A bare-bones example to get the fundamentals.
|
27
|
+
- [Register URLs](./README_REGISTER_URLS.md): How to register viewset urls.
|
28
|
+
- [Custom Endpoints](./README_CUSTOM_ENDPOINT.md): Learn how to define custom endpoints alongside the default router.
|
29
|
+
- [Handling Endpoint Exceptions](./README_HANDLE_ENDPOINT_EXCEPTIONS.md): Understand how to write your own decorators for exception handling.
|
30
|
+
- [Custom Protections](./README_CUSTOM_PROTECTIONS.md): Learn how to subclass `SmallViewSet` to add custom protections like logged-in checks.
|
31
|
+
- [DRF Compatibility](./README_DRF_COMPATIBILITY.md): Learn how to use some of Django Rest Framework's tools, like Serializers.
|
32
|
+
- [Reason](./README_REASON.md): Reasoning behind this package.
|
33
|
+
|
@@ -1,9 +1,9 @@
|
|
1
|
-
small_view_set/README.md,sha256=
|
1
|
+
small_view_set/README.md,sha256=AVHm5FrLxNzFKt9-PGvx0vkAcfMEO9ZtFoCG__lQp-s,993
|
2
2
|
small_view_set/__init__.py,sha256=FoYcTj03W41-w0jC1EOv1_VD4iBxO_03fIr_plSKnp8,441
|
3
3
|
small_view_set/decorators.py,sha256=OSwGz5SfTw7hUjOcPNmCmUl8mLqaHOMXaLcqg9JBHXo,6750
|
4
4
|
small_view_set/exceptions.py,sha256=8CAnzvNZFlqjez8z66jLo-4P3Tlj5Y5MioDPmrb9wQg,948
|
5
5
|
small_view_set/small_view_set.py,sha256=THDeJp1PmodaWzFUUnowpDmhH8w1El4p97jvQnjyU4k,5192
|
6
|
-
django_small_view_set-0.1.
|
7
|
-
django_small_view_set-0.1.
|
8
|
-
django_small_view_set-0.1.
|
9
|
-
django_small_view_set-0.1.
|
6
|
+
django_small_view_set-0.1.2.dist-info/LICENSE,sha256=M4ZuHeiGHHuewaZyqz7tol4E6E2GMz7fF1ywNoXD1tA,1069
|
7
|
+
django_small_view_set-0.1.2.dist-info/METADATA,sha256=YYwYTVNT_Dy9QrDg1EjtEUbKcuNYBXhEtkLLO3bV3f0,1722
|
8
|
+
django_small_view_set-0.1.2.dist-info/WHEEL,sha256=d2fvjOD7sXsVzChCqf0Ty0JbHKBaLYwDbGQDwQTnJ50,88
|
9
|
+
django_small_view_set-0.1.2.dist-info/RECORD,,
|
small_view_set/README.md
CHANGED
@@ -1,17 +1,14 @@
|
|
1
1
|
# Steps for Releasing to PyPI
|
2
2
|
|
3
|
-
1. **
|
3
|
+
1. **Environment variables**
|
4
|
+
Copy the .env.example file to .env and set the real token from pypi
|
5
|
+
|
6
|
+
2. **Build the Docker Image**:
|
4
7
|
```bash
|
5
8
|
docker compose build --no-cache
|
6
9
|
docker compose up -d
|
7
10
|
```
|
8
11
|
|
9
|
-
2. **Configure PyPI Credentials**:
|
10
|
-
- Set up your PyPI token inside the Docker container:
|
11
|
-
```bash
|
12
|
-
docker compose run django-small-view-set-builder sh -c 'poetry config pypi-token.pypi $POETRY_PUBLISH_TOKEN'
|
13
|
-
```
|
14
|
-
|
15
12
|
3. **Install Dependencies**:
|
16
13
|
- Install dependencies inside the container after mounting the directory:
|
17
14
|
```bash
|
@@ -1,49 +0,0 @@
|
|
1
|
-
Metadata-Version: 2.1
|
2
|
-
Name: django-small-view-set
|
3
|
-
Version: 0.1.0
|
4
|
-
Summary: A lightweight Django ViewSet alternative with minimal abstraction.
|
5
|
-
Home-page: https://github.com/yourusername/django-small-view-set
|
6
|
-
License: MIT
|
7
|
-
Keywords: django,viewset
|
8
|
-
Author: Nate Brooks
|
9
|
-
Requires-Python: >=3.8
|
10
|
-
Classifier: License :: OSI Approved :: MIT License
|
11
|
-
Classifier: Programming Language :: Python :: 3
|
12
|
-
Classifier: Programming Language :: Python :: 3.8
|
13
|
-
Classifier: Programming Language :: Python :: 3.9
|
14
|
-
Classifier: Programming Language :: Python :: 3.10
|
15
|
-
Classifier: Programming Language :: Python :: 3.11
|
16
|
-
Requires-Dist: django (>=3.2)
|
17
|
-
Project-URL: Repository, https://github.com/yourusername/django-small-view-set
|
18
|
-
Description-Content-Type: text/markdown
|
19
|
-
|
20
|
-
# Django Small View Set
|
21
|
-
|
22
|
-
A lightweight Django ViewSet alternative with minimal abstraction. This library provides a simple and transparent way to define API endpoints without relying on complex abstractions.
|
23
|
-
|
24
|
-
## Documentation
|
25
|
-
|
26
|
-
- [Getting Started](./README_SIMPLE.md): A bare-bones example to get the fundamentals.
|
27
|
-
- [Register URLs](./README_REGISTER_URLS): How to register viewset urls.
|
28
|
-
- [Custom Endpoints](./README_CUSTOM_ENDPOINT.md): Learn how to define custom endpoints alongside the default router.
|
29
|
-
- [Handling Endpoint Exceptions](./README_HANDLE_ENDPOINT_EXCEPTIONS.md): Understand how to write your own decorators for exception handling.
|
30
|
-
- [Custom Protections](./README_CUSTOM_PROTECTIONS.md): Learn how to subclass `SmallViewSet` to add custom protections like logged-in checks.
|
31
|
-
- [DRF Compatibility](./README_DRF_COMPATIBILITY.md): Learn how to use some of Django Rest Framework's tools, like Serializers.
|
32
|
-
|
33
|
-
## Reasoning behind this library:
|
34
|
-
|
35
|
-
A note from the library creator:
|
36
|
-
|
37
|
-
I feel like a justification to not "just use DRF" is in order.
|
38
|
-
|
39
|
-
After working in Django Rest Framework for years, I liked how nice it was for getting an API up and running really quickly, but I hated how often I would get stuck debugging some abstracted thing in a serializer, or a viewset, then spend too much time implementing some niche (and usually hacky feeling) fix.
|
40
|
-
|
41
|
-
Sadly, there are a lot of these pain points in DRF, and a lack of separation-of-concerns. For instance, I always disliked how serializers don't just serialize, they do operations like saving and updating, often resulting in business logic in serializers. That is not serialization. When using mixins on DRF viewsets, often customization methods are required, like which permissions to use for each endpoint, which serializer to use, add a custom "perform_create" method to help serializers save, etc. and it makes it difficult to do reverse lookups to endpoints. It also meant POSTing to reverse('foo-list') would happen, which really should be posting to the "foo-collection" or something else. It's nitpicky yes, but these nitpicks are all over.
|
42
|
-
|
43
|
-
So I wrote this. No black box anything. Surprisingly (because it was not the goal), I reduced the number of lines of code in every single one of my viewsets because I didn't need to register so many mixins, set up complex decorators, or define so many helper methods.
|
44
|
-
|
45
|
-
I still like some tools DRF provides, like throttles and serializers (when only used as validators or model => json conversions), those are still completely compatible and honestly amazing. I'm glad DRF exists, I've gotten a TON of use out of it over the years.
|
46
|
-
|
47
|
-
I also really liked my Spring Boot experience (and other frameworks, but Spring Boot was recent) where the pattern is to throw exceptions and a global exception handler will convert the errors to json responses, allowing a developer to bail on an endpoint at any time, no matter how deep in business logic they may be.
|
48
|
-
|
49
|
-
With this ViewSet and pattern, your call stack will never be far away from the real issue, letting you debug in peace.
|
File without changes
|
File without changes
|