更好的 ArrayField 管理小部件? [英] Better ArrayField admin widget?

查看:17
本文介绍了更好的 ArrayField 管理小部件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法让 ArrayField 的管理小部件允许添加和删除对象?似乎默认情况下,它只显示一个文本字段,并使用逗号分隔其值.

Is there any way to make ArrayField's admin widget allow adding and deleting objects? It seems that by default, it is instead displayed just a text field, and uses comma separation for its values.

除了不方便之外,如果数组的基本字段是 Char/TextField,则 AFAICT 不允许在数组中的任何文本中包含逗号.

Besides being inconvenient, AFAICT in the case the base field of the array is a Char/TextField, this doesn't allow any way of including commas in any of the texts in the array.

推荐答案

对于 OP 或其他任何人来说,在这些有用的部分之间,你应该很高兴:

For OP, or anyone out there looking, between these helpful bits you should be good to go:

  • 1. Extending SelectMultiple or CheckboxSelectMultiple widget to parse arrayfield and
  • 2. Creating or extending admin form to display the arrayfield using the widget above

这篇关于更好的 ArrayField 管理小部件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆