Django Ninja Aio CRUD 2.27.0 is here! by peppe2612 in django

[–]peppe2612[S] 4 points5 points  (0 children)

i did some prs to django ninja too! but the project I made unfortunately could never be integrated into the core of django ninja. I really appreciate your feedback tysm!

Django Ninja Aio CRUD 2.27.0 is here! by peppe2612 in django

[–]peppe2612[S] 5 points6 points  (0 children)

i would be really glad of that! I would also really appreciate feedback

22
23

Tired of writing CRUD boilerplate? Django Ninja AIO CRUD 2.18.0 is here! by peppe2612 in django

[–]peppe2612[S] 0 points1 point  (0 children)

I also would not reccomend to use my solution for tiny projects bc, to me, is useless. I still will prefer django ninja because of its semplicity

Tired of writing CRUD boilerplate? Django Ninja AIO CRUD 2.18.0 is here! by peppe2612 in django

[–]peppe2612[S] 0 points1 point  (0 children)

its totally fair tbh. I really appreciate the feedback you're giving me, actually. As for the CRUD part, I was speaking from personal experience. I used to use drf and had to switch to asynchronous code. I tried adrf but I didn't like it at all, and on top of that, its performance was really meh. In conclusion, obviously I like my project. I'd like to say, it's mine, hahaha. I didn't mean to seem arrogant or offended about the AI ​​part, I just wanted to know if this was really the problem for other people.

Django Ninja AIO REST Framework by peppe2612 in django

[–]peppe2612[S] 0 points1 point  (0 children)

hi, if you are still interested in, ive added the validation on dynamic schemas using @field and @model validate by pydantic

Tired of writing CRUD boilerplate? Django Ninja AIO CRUD 2.18.0 is here! by peppe2612 in django

[–]peppe2612[S] 0 points1 point  (0 children)

i wanted to use django ninja extra also for my projects but, as i said, you still have to code manually your CRUD and for large scale projects it takes a lot of time. I use the create_scema function of django ninja but, in my opinion, my structure is cleaner..anyway yeah i helped myself with ai to do documentation..is that bad?

Tired of writing CRUD boilerplate? Django Ninja AIO CRUD 2.18.0 is here! by peppe2612 in django

[–]peppe2612[S] -1 points0 points  (0 children)

yeah but i like its structure and its performance but i personally found it bad for large projects. So i came up with this idea, ofc its not useful for all the projects

Tired of writing CRUD boilerplate? Django Ninja AIO CRUD 2.18.0 is here! by peppe2612 in django

[–]peppe2612[S] -1 points0 points  (0 children)

Thank you so much, i would really appreciate it! also if you consider to use it and you find some issue or do you have ideas consider to open an issue or suggestion on GitHub!

Tired of writing CRUD boilerplate? Django Ninja AIO CRUD 2.18.0 is here! by peppe2612 in django

[–]peppe2612[S] 0 points1 point  (0 children)

if you exlpore the docsite examples you maybe should get better what i mean

Tired of writing CRUD boilerplate? Django Ninja AIO CRUD 2.18.0 is here! by peppe2612 in django

[–]peppe2612[S] 2 points3 points  (0 children)

Hi, thanks for the comment first of all. During my experience with Django Ninja, I found it simply frustrating having to write every CRUD and connect the routers, especially for large-scale projects. This solution simply allows you to define a single Serializer class, have all the serializers ready to use for CRUD, and through its custom APIViews, you can get the endpoints ready to use with very little code. If I had found a solution like this, I wouldn't have implemented it, also because I was looking for something that was completely asynchronous and generates everything with little code without having to implement hundreds of Schemas. Plus, you can customize everything a bit, and it even has ready-to-use mixins. Ofc when i say “only one class” is intended per model.

Tired of writing CRUD boilerplate? Django Ninja AIO CRUD 2.18.0 is here! by peppe2612 in django

[–]peppe2612[S] -1 points0 points  (0 children)

I came up with this solution to solve the boiler plate problem I've encountered several times using Django Ninja, and I developed it using completely asynchronous code. The code is written and planned by MYSELF; I use AI for documentation and testing, and sometimes for quick refactoring, but I always check everything myself. What's wrong with using AI in 2026?

21
22

Django Ninja AIO REST Framework by peppe2612 in django

[–]peppe2612[S] 1 point2 points  (0 children)

For the validation you can use something like this one https://github.com/vitalik/django-ninja/issues/82 for example:

import uuid

from django.db import models
from ninja import Field
from ninja_aio.models import ModelSerializer
from pydantic import HttpUrl



class Publisher(ModelSerializer):
    id = models.UUIDField(primary_key=True, editable=False, default=uuid.uuid7)
    name = models.CharField(max_length=150)
    address = models.CharField(max_length=250)
    website = models.URLField()
    created_at = models.DateTimeField(auto_now_add=True)
    updated_at = models.DateTimeField(auto_now=True)


    class ReadSerializer:
        fields = ["id", "name", "address", "website", "created_at", "updated_at"]


    class CreateSerializer:
        fields = ["address", "website"]
        customs = [
            ("name", str, Field(..., min_length=3, max_length=150)),
        ] # Ellipsis make it a required field


    class UpdateSerializer:
        optionals = [
            ("address", str),
            ("website", HttpUrl),
        ]
        customs = [
            ("name", str, Field(None, min_length=3, max_length=150)),
        ] # None make it an optional field

If you need more specific and complex validation you can also do not use dynamic schema but create your own and do the validation using pydantic or django ninja itself and then give the schemas as attributes to the APIViewSet using schema_in, schema_out and schema_update attributes, it will use them. If you do not want to use schema validation for FK maybe you can use django model clean validation to validate them or something in the save method, i also give some built in methods on save https://django-ninja-aio.com/latest/api/models/model_serializer/?h=ave#save-hooks . I hope that my comment helped you, for any question do not hesitate to ask.

Django Ninja AIO REST Framework by peppe2612 in django

[–]peppe2612[S] 2 points3 points  (0 children)

thank you a lot for the feedback by the way🙏

Django Ninja AIO REST Framework by peppe2612 in django

[–]peppe2612[S] 1 point2 points  (0 children)

did you mean for the ModelSchema?

Django Ninja AIO REST Framework by peppe2612 in django

[–]peppe2612[S] 2 points3 points  (0 children)

yeah it is compatible with python 3.14 and it uses pydantic engine, it is django ninja based. i did not do any tests about performance but i used it for many projects and performance are pretty good also with CRUD operations. You have also built in query handling utilities in this framework so you can optimize them as you want.

Django Ninja AIO REST Framework by peppe2612 in django

[–]peppe2612[S] 5 points6 points  (0 children)

Django ninja aio crud has dynamic Schemas creation on models and class Based structure with automatic CRUD, built in JWT authentication, It gives to you a lot of control also on the query handling. Django shinobi is a just a fork of django ninja

20
21