Replies: 2 comments
-
They two can't be compatibility, if you are finding something like django-admin, try https://github.com/fastapi-admin/fastapi-admin |
Beta Was this translation helpful? Give feedback.
-
Of course they can be compatible, it's only a matter of using the same lexicon. Then if tortoiseORM coders won't do compatibility with django's models, I'll probably end up coding a tortoise.models to django.models translator, because I'd really love to use tortoiseORM without letting go of django-admin. |
Beta Was this translation helpful? Give feedback.
-
TLDR; Why wouldn't you keep your models compatible with django-admin ?
First off, great project I've been looking around for a while for an acync django-like ORM for python, so I love this ♥
Then, one of my favorite thing with django's ORM, is the auto-made administration interface.
It's easily customizable with a few lines of code, and you get a great tool to manage permissions, check change log entries, and overall explore and manage your data.
Django-admin has been an awesome time-saver in most of my projects.
Looking at your Quick tutorial, and the project description, you did a great work at keeping tortoise's models structure very similar to django's.
I mean except a few fields type's name changed (
IntegerField => IntField, ForeignKey => ForeignKeyField
), and theon_delete
mandatory parameter missing in yourForeignKeyField
, these models looks really like django's.So what directly comes to my mind is, why wouldn't you have your models be compatible with django?
It would be amazing, you'd allow your users to be able to use django-admin with the same models.
And in the other direction, devs could easily switch from django's ORM to tortoise's in their projects.
Would just need to hack a little around to replace "tortoise" by "django" or vice-versa in those imports.
Also obviously django-admin queries wouldn't be async, but who cares really ?
Or is there anything else I'm missing?
Beta Was this translation helpful? Give feedback.
All reactions