djangoo-crudapi 1.0.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.
- djangoo_crudapi-1.0.1/LICENSE +1 -0
- djangoo_crudapi-1.0.1/MANIFEST.in +5 -0
- djangoo_crudapi-1.0.1/PKG-INFO +39 -0
- djangoo_crudapi-1.0.1/README.md +12 -0
- djangoo_crudapi-1.0.1/crudapi/__init__.py +1 -0
- djangoo_crudapi-1.0.1/crudapi/admin.py +3 -0
- djangoo_crudapi-1.0.1/crudapi/apps.py +6 -0
- djangoo_crudapi-1.0.1/crudapi/exceptions.py +0 -0
- djangoo_crudapi-1.0.1/crudapi/migrations/0001_initial.py +23 -0
- djangoo_crudapi-1.0.1/crudapi/migrations/__init__.py +0 -0
- djangoo_crudapi-1.0.1/crudapi/models.py +10 -0
- djangoo_crudapi-1.0.1/crudapi/permissions.py +0 -0
- djangoo_crudapi-1.0.1/crudapi/serializers.py +8 -0
- djangoo_crudapi-1.0.1/crudapi/services.py +0 -0
- djangoo_crudapi-1.0.1/crudapi/tests.py +3 -0
- djangoo_crudapi-1.0.1/crudapi/urls.py +16 -0
- djangoo_crudapi-1.0.1/crudapi/utils.py +0 -0
- djangoo_crudapi-1.0.1/crudapi/validators.py +0 -0
- djangoo_crudapi-1.0.1/crudapi/views.py +78 -0
- djangoo_crudapi-1.0.1/djangoo_crudapi.egg-info/PKG-INFO +39 -0
- djangoo_crudapi-1.0.1/djangoo_crudapi.egg-info/SOURCES.txt +25 -0
- djangoo_crudapi-1.0.1/djangoo_crudapi.egg-info/dependency_links.txt +1 -0
- djangoo_crudapi-1.0.1/djangoo_crudapi.egg-info/requires.txt +3 -0
- djangoo_crudapi-1.0.1/djangoo_crudapi.egg-info/top_level.txt +1 -0
- djangoo_crudapi-1.0.1/pyproject.toml +3 -0
- djangoo_crudapi-1.0.1/setup.cfg +4 -0
- djangoo_crudapi-1.0.1/setup.py +28 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
MIT License
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: djangoo-crudapi
|
|
3
|
+
Version: 1.0.1
|
|
4
|
+
Summary: Reusable Django CRUD API Package
|
|
5
|
+
Home-page: https://github.com/shameelputhukkidi-rgb/djangoo-crudapi
|
|
6
|
+
Author: Mohammed Shameel
|
|
7
|
+
Author-email: YOUR_EMAIL@gmail.com
|
|
8
|
+
Classifier: Framework :: Django
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Requires-Python: >=3.10
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
License-File: LICENSE
|
|
14
|
+
Requires-Dist: Django>=5.2
|
|
15
|
+
Requires-Dist: djangorestframework>=3.16
|
|
16
|
+
Requires-Dist: psycopg2-binary>=2.9
|
|
17
|
+
Dynamic: author
|
|
18
|
+
Dynamic: author-email
|
|
19
|
+
Dynamic: classifier
|
|
20
|
+
Dynamic: description
|
|
21
|
+
Dynamic: description-content-type
|
|
22
|
+
Dynamic: home-page
|
|
23
|
+
Dynamic: license-file
|
|
24
|
+
Dynamic: requires-dist
|
|
25
|
+
Dynamic: requires-python
|
|
26
|
+
Dynamic: summary
|
|
27
|
+
|
|
28
|
+
# CRUD API Package
|
|
29
|
+
|
|
30
|
+
Reusable Django CRUD Package
|
|
31
|
+
|
|
32
|
+
Features
|
|
33
|
+
|
|
34
|
+
- Create
|
|
35
|
+
- Read
|
|
36
|
+
- Update
|
|
37
|
+
- Delete
|
|
38
|
+
- PostgreSQL Support
|
|
39
|
+
- Django REST Framework
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "1.0.0"
|
|
File without changes
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Generated by Django 6.0.7 on 2026-07-10 07:05
|
|
2
|
+
|
|
3
|
+
from django.db import migrations, models
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class Migration(migrations.Migration):
|
|
7
|
+
|
|
8
|
+
initial = True
|
|
9
|
+
|
|
10
|
+
dependencies = [
|
|
11
|
+
]
|
|
12
|
+
|
|
13
|
+
operations = [
|
|
14
|
+
migrations.CreateModel(
|
|
15
|
+
name='Student',
|
|
16
|
+
fields=[
|
|
17
|
+
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
18
|
+
('name', models.CharField(max_length=100)),
|
|
19
|
+
('age', models.IntegerField()),
|
|
20
|
+
('email', models.EmailField(max_length=254, unique=True)),
|
|
21
|
+
],
|
|
22
|
+
),
|
|
23
|
+
]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
from django.urls import path
|
|
2
|
+
from .views import StudentListCreateAPIView, StudentDetailAPIView
|
|
3
|
+
|
|
4
|
+
urlpatterns = [
|
|
5
|
+
path(
|
|
6
|
+
"students/",
|
|
7
|
+
StudentListCreateAPIView.as_view(),
|
|
8
|
+
name="student-list-create",
|
|
9
|
+
),
|
|
10
|
+
|
|
11
|
+
path(
|
|
12
|
+
"students/<int:pk>/",
|
|
13
|
+
StudentDetailAPIView.as_view(),
|
|
14
|
+
name="student-detail",
|
|
15
|
+
),
|
|
16
|
+
]
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
from rest_framework.views import APIView
|
|
2
|
+
from rest_framework.response import Response
|
|
3
|
+
from rest_framework import status
|
|
4
|
+
|
|
5
|
+
from .models import Student
|
|
6
|
+
from .serializers import StudentSerializer
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class StudentListCreateAPIView(APIView):
|
|
10
|
+
|
|
11
|
+
def get(self, request):
|
|
12
|
+
students = Student.objects.all()
|
|
13
|
+
serializer = StudentSerializer(students, many=True)
|
|
14
|
+
return Response(serializer.data)
|
|
15
|
+
|
|
16
|
+
def post(self, request):
|
|
17
|
+
serializer = StudentSerializer(data=request.data)
|
|
18
|
+
|
|
19
|
+
if serializer.is_valid():
|
|
20
|
+
serializer.save()
|
|
21
|
+
return Response(serializer.data, status=status.HTTP_201_CREATED)
|
|
22
|
+
|
|
23
|
+
return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
|
|
24
|
+
|
|
25
|
+
class StudentDetailAPIView(APIView):
|
|
26
|
+
|
|
27
|
+
def get_object(self, pk):
|
|
28
|
+
try:
|
|
29
|
+
return Student.objects.get(pk=pk)
|
|
30
|
+
except Student.DoesNotExist:
|
|
31
|
+
return None
|
|
32
|
+
|
|
33
|
+
def get(self, request, pk):
|
|
34
|
+
student = self.get_object(pk)
|
|
35
|
+
|
|
36
|
+
if student is None:
|
|
37
|
+
return Response(
|
|
38
|
+
{"error": "Student not found"},
|
|
39
|
+
status=status.HTTP_404_NOT_FOUND
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
serializer = StudentSerializer(student)
|
|
43
|
+
return Response(serializer.data)
|
|
44
|
+
|
|
45
|
+
def put(self, request, pk):
|
|
46
|
+
|
|
47
|
+
student = self.get_object(pk)
|
|
48
|
+
|
|
49
|
+
if student is None:
|
|
50
|
+
return Response(
|
|
51
|
+
{"error": "Student not found"},
|
|
52
|
+
status=status.HTTP_404_NOT_FOUND
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
serializer = StudentSerializer(student, data=request.data)
|
|
56
|
+
|
|
57
|
+
if serializer.is_valid():
|
|
58
|
+
serializer.save()
|
|
59
|
+
return Response(serializer.data)
|
|
60
|
+
|
|
61
|
+
return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
|
|
62
|
+
|
|
63
|
+
def delete(self, request, pk):
|
|
64
|
+
|
|
65
|
+
student = self.get_object(pk)
|
|
66
|
+
|
|
67
|
+
if student is None:
|
|
68
|
+
return Response(
|
|
69
|
+
{"error": "Student not found"},
|
|
70
|
+
status=status.HTTP_404_NOT_FOUND
|
|
71
|
+
)
|
|
72
|
+
|
|
73
|
+
student.delete()
|
|
74
|
+
|
|
75
|
+
return Response(
|
|
76
|
+
{"message": "Student deleted successfully"},
|
|
77
|
+
status=status.HTTP_204_NO_CONTENT
|
|
78
|
+
)
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: djangoo-crudapi
|
|
3
|
+
Version: 1.0.1
|
|
4
|
+
Summary: Reusable Django CRUD API Package
|
|
5
|
+
Home-page: https://github.com/shameelputhukkidi-rgb/djangoo-crudapi
|
|
6
|
+
Author: Mohammed Shameel
|
|
7
|
+
Author-email: YOUR_EMAIL@gmail.com
|
|
8
|
+
Classifier: Framework :: Django
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Requires-Python: >=3.10
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
License-File: LICENSE
|
|
14
|
+
Requires-Dist: Django>=5.2
|
|
15
|
+
Requires-Dist: djangorestframework>=3.16
|
|
16
|
+
Requires-Dist: psycopg2-binary>=2.9
|
|
17
|
+
Dynamic: author
|
|
18
|
+
Dynamic: author-email
|
|
19
|
+
Dynamic: classifier
|
|
20
|
+
Dynamic: description
|
|
21
|
+
Dynamic: description-content-type
|
|
22
|
+
Dynamic: home-page
|
|
23
|
+
Dynamic: license-file
|
|
24
|
+
Dynamic: requires-dist
|
|
25
|
+
Dynamic: requires-python
|
|
26
|
+
Dynamic: summary
|
|
27
|
+
|
|
28
|
+
# CRUD API Package
|
|
29
|
+
|
|
30
|
+
Reusable Django CRUD Package
|
|
31
|
+
|
|
32
|
+
Features
|
|
33
|
+
|
|
34
|
+
- Create
|
|
35
|
+
- Read
|
|
36
|
+
- Update
|
|
37
|
+
- Delete
|
|
38
|
+
- PostgreSQL Support
|
|
39
|
+
- Django REST Framework
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
MANIFEST.in
|
|
3
|
+
README.md
|
|
4
|
+
pyproject.toml
|
|
5
|
+
setup.py
|
|
6
|
+
crudapi/__init__.py
|
|
7
|
+
crudapi/admin.py
|
|
8
|
+
crudapi/apps.py
|
|
9
|
+
crudapi/exceptions.py
|
|
10
|
+
crudapi/models.py
|
|
11
|
+
crudapi/permissions.py
|
|
12
|
+
crudapi/serializers.py
|
|
13
|
+
crudapi/services.py
|
|
14
|
+
crudapi/tests.py
|
|
15
|
+
crudapi/urls.py
|
|
16
|
+
crudapi/utils.py
|
|
17
|
+
crudapi/validators.py
|
|
18
|
+
crudapi/views.py
|
|
19
|
+
crudapi/migrations/0001_initial.py
|
|
20
|
+
crudapi/migrations/__init__.py
|
|
21
|
+
djangoo_crudapi.egg-info/PKG-INFO
|
|
22
|
+
djangoo_crudapi.egg-info/SOURCES.txt
|
|
23
|
+
djangoo_crudapi.egg-info/dependency_links.txt
|
|
24
|
+
djangoo_crudapi.egg-info/requires.txt
|
|
25
|
+
djangoo_crudapi.egg-info/top_level.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
crudapi
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
from setuptools import setup, find_packages
|
|
2
|
+
|
|
3
|
+
with open("README.md", "r", encoding="utf-8") as f:
|
|
4
|
+
long_description = f.read()
|
|
5
|
+
|
|
6
|
+
setup(
|
|
7
|
+
name="djangoo-crudapi",
|
|
8
|
+
version="1.0.1",
|
|
9
|
+
author="Mohammed Shameel",
|
|
10
|
+
author_email="YOUR_EMAIL@gmail.com",
|
|
11
|
+
url="https://github.com/shameelputhukkidi-rgb/djangoo-crudapi",
|
|
12
|
+
description="Reusable Django CRUD API Package",
|
|
13
|
+
long_description=long_description,
|
|
14
|
+
long_description_content_type="text/markdown",
|
|
15
|
+
packages=find_packages(include=["crudapi", "crudapi.*"]),
|
|
16
|
+
include_package_data=True,
|
|
17
|
+
install_requires=[
|
|
18
|
+
"Django>=5.2",
|
|
19
|
+
"djangorestframework>=3.16",
|
|
20
|
+
"psycopg2-binary>=2.9",
|
|
21
|
+
],
|
|
22
|
+
classifiers=[
|
|
23
|
+
"Framework :: Django",
|
|
24
|
+
"Programming Language :: Python :: 3",
|
|
25
|
+
"Operating System :: OS Independent",
|
|
26
|
+
],
|
|
27
|
+
python_requires=">=3.10",
|
|
28
|
+
)
|