7 ms·
This seems really cool, but I'm having some trouble coming up with a use case for this. Why would I want to translate my django model to a dictionary?
by DanielN 14y ago
This seems really cool, but I'm having some trouble coming up with a use case for this. Why would I want to translate my django model to a dictionary?
- fatiherikli 14y agoI will use it for generating database schema of uploaded django models. It's my use case. Because sandboxing in python is too hard, I can not execute uploaded python script.
- __alexs 14y agoCan you explain some more? That sounds like what the ORM Models already do.
- deleted 14y ago[deleted]
- mattdeboard 14y agomanage.py sqlall ?
- deleted 14y ago[deleted]
- lmz 14y agodoesn't that import the modules i.e. execute them?
- natrius 14y agoThis project is a Python module. It has to be executed at some point. Presumably, you'd generate the SQL locally by running manage.py sqlall, then get the SQL to your database in the appropriate manner. That's the same process the eventual product of this module would require.
- shabble 14y agoThat assumes your end goal is actually using the provided models in your application. It sounds like this is using them as pure data only. I can think of a couple of reasons why you might want that, maybe if you wanted to create a relationship graph like django-extensions 'graph_models'[1], or build some sort of introspective API scaffold generator or something. [1] https://github.com/django-extensions/django-extensions/blob/master/docs/graph_models.rst https://github.com/django-extensions/django-extensions/blob/...