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.
@@ -0,0 +1 @@
1
+ MIT License
@@ -0,0 +1,5 @@
1
+ include README.md
2
+ include LICENSE
3
+
4
+ recursive-include crudapi *.py
5
+ recursive-include crudapi/migrations *.py
@@ -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,12 @@
1
+ # CRUD API Package
2
+
3
+ Reusable Django CRUD Package
4
+
5
+ Features
6
+
7
+ - Create
8
+ - Read
9
+ - Update
10
+ - Delete
11
+ - PostgreSQL Support
12
+ - Django REST Framework
@@ -0,0 +1 @@
1
+ __version__ = "1.0.0"
@@ -0,0 +1,3 @@
1
+ from django.contrib import admin
2
+
3
+ # Register your models here.
@@ -0,0 +1,6 @@
1
+ from django.apps import AppConfig
2
+
3
+
4
+ class CrudapiConfig(AppConfig):
5
+ default_auto_field = "django.db.models.BigAutoField"
6
+ name = "crudapi"
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
@@ -0,0 +1,10 @@
1
+ from django.db import models
2
+
3
+
4
+ class Student(models.Model):
5
+ name = models.CharField(max_length=100)
6
+ age = models.IntegerField()
7
+ email = models.EmailField(unique=True)
8
+
9
+ def __str__(self):
10
+ return self.name
File without changes
@@ -0,0 +1,8 @@
1
+ from rest_framework import serializers
2
+ from .models import Student
3
+
4
+
5
+ class StudentSerializer(serializers.ModelSerializer):
6
+ class Meta:
7
+ model = Student
8
+ fields = "__all__"
File without changes
@@ -0,0 +1,3 @@
1
+ from django.test import TestCase
2
+
3
+ # Create your tests here.
@@ -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,3 @@
1
+ Django>=5.2
2
+ djangorestframework>=3.16
3
+ psycopg2-binary>=2.9
@@ -0,0 +1,3 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61", "wheel"]
3
+ build-backend = "setuptools.build_meta"
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -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
+ )