feincms的表格内容类型:将粘贴单元格从电子表格复制到管理员,使其在网站上显示为html表格
feincms-simpletable的Python项目详细描述
feincms_simpletable是一个feincms插件,它为 桌子。只需将数据从Calc或Office电子表格复制粘贴到 管理中的SimpleTableContent,它将被自动转换 在您的网站上以HTML格式呈现
当前限制:不支持合并单元格
快速启动
将“feincms_simpletable”添加到已安装的应用程序设置中,如下所示:
INSTALLED_APPS = ( ... 'feincms_simpletable', )
如果要将其用作feincms内容类型,请注册simpletablecontent 对于您的页面模型(或任何其他基派生模型),如下所示:
from feincms_simpletable.models import SimpleTableContent # ... Page.create_content_type(SimpleTableContent) # tables will be rendered as # templates/content/feincms_simpletable/default.html
(可选)如果您希望 使用不同模板渲染表:
from feincms_simpletable.models import SimpleTableContent # ... Page.create_content_type(SimpleTableContent, TYPE_CHOICES=( ('default', 'default template'), ('other', 'some other template'), # ... (other types) ) ) # tables will be rendered as either of these, depending on admin choice: # templates/content/feincms_simpletable/default.html # templates/content/feincms_simpletable/other.html # ...
迁移模型
如果要向现有模型中添加简单字段,请简单 子类:
class Product(Base, SimpleTable): # ...
用法
- 在管理中向任何feincms页面添加simpletablecontent,然后添加数据 将其从Calc或Excel电子表格复制到内容字段中
- 从simpletable继承的模型与其他任何模型一样都是可编辑的。 Django型号