Django:动态模型

2024-04-27 08:09:08 发布

您现在位置:Python中文网/ 问答频道 /正文

项目简介:这是一个创建广告的网站。在管理页面中,我们可以创建一个新的类别(数据库中的模型),并为这个类别创建N个不同的类型字段。然后我们可以在这个类别中创建帖子。 我读到django变种是这个任务的强大应用程序,但是我找不到很多示例(只有这个:https://github.com/integricho/mutant-sample-app)。但此示例无法添加字段:

Request URL:    http://localhost:8000/tables/38/fields/create/?field_type=29
Django Version: 1.6.5
Exception Type: TypeError
Exception Value:    
__init__() takes at least 2 arguments (2 given)
Exception Location: /Library/Python/2.7/site-packages/mutant/forms.py in __init__, line 60

我试图使用“Django动态模型”(https://code.djangoproject.com/wiki/DynamicModels),但它们也不起作用:

^{pr2}$

在哪里可以看到更多的示例/文档? 还是我做错了什么?在


Tags: 项目djangohttps模型com数据库示例类型