英文:
How can i make models in django with form input
问题
我想创建一个后端服务网站,为此我正在使用django,并希望使用表单输入来创建django模型,如果用户在我的前端创建一个表格,我想在数据库中创建一个表格或模型,我该如何做呢?
你好,栈友们,
我想创建一个后端服务网站,为此我正在使用django,并希望使用表单输入来创建django模型,如果用户在我的前端创建一个表格,我想在数据库中创建一个表格或模型,我该如何做呢?
英文:
I Want to make a backend service website, for that I am working in django and want to make django models but with form input,
if a user create a table in my frontend I want to create a table or model in data base how can i do it?
Hello stackies ,
I Want to make a backend service website, for that I am working in django and want to make django models but with form input,
if a user create a table in my frontend I want to create a table or model in data base how can i do it?
答案1
得分: 0
不,您不能动态创建模型,因为这将需要进行迁移来应用更改。我建议您将客户信息存储在结构化的JSON中,然后可以将其存储在例如PostgreSQL字段中。或者您可以切换到文档型数据库,如MongoDB。
英文:
No, you cannot create models dynamically because this would require migrations to apply the changes.
I'd recommend that you store your customer information in a structured JSON, that you can store in a PostgreSQL field, for example. Or you can jump to a document-based database, such as MongoDB.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论