django_builder icon indicating copy to clipboard operation
django_builder copied to clipboard

Support for python-module style models

Open delneg opened this issue 7 years ago • 5 comments

Currently, there is only 'upload models.py file' button, but my app has models split into different .py files under models module. Can we get support for that, too?

delneg avatar Dec 07 '18 09:12 delneg

Thats interesting, Yes it would be great if there was a upload models folder which grabbed the models from all files in the a folder. As a workaround does it work when you load the files individually? ( i know that will be a pain if you have lots)

Also would you be expecting any future feature to keep your models split in separate files?

mmcardle avatar Dec 07 '18 10:12 mmcardle

Thats interesting, Yes it would be great if there was a upload models folder which grabbed the models from all files in the a folder. As a workaround does it work when you load the files individually? ( i know that will be a pain if you have lots)

Also would you be expecting any future feature to keep your models split in separate files?

I tried loading files individually, but the result is a mess... Abstract & through models get mixed all the others, there's stuff like that in tests due to multiple abstract inheritance "employee": create_employee().pk, "employee": create_employee().pk, "employee": create_employee().pk, I will be trying to do models one-by-one, correcting all the fields in the interface (still faster than writing all those serializers by hand)

delneg avatar Dec 07 '18 10:12 delneg

P.s. my app has 34 models at the moment, not counting ones from third-party apps & django.contrib models

delneg avatar Dec 07 '18 10:12 delneg

Yes that is more complex than the upload parser can handle currently, abstract and through models are not supported yet. I hope you can still get some use from the site as it is currently :)

I will take a look at how much work it is to add those features.

mmcardle avatar Dec 07 '18 10:12 mmcardle

If you need any help, you can contact me via Telegram in my profile. Also will try to look into this project to add the aforementioned functionality

delneg avatar Dec 07 '18 10:12 delneg