The dashboard provides a clean and user-friendly interface for fields of type list (e.g., list:string, list:integer). Users can enter comma-separated values, which are displayed as individual capsules and added to the existing lists. However, this UI breaks when a list field contains null—for example, if no default value is provided and no explicit value has been assigned either.
In fact, if
even one list field contains a null value, the UI for
all list fields on the editing page fails, even if those fields contain valid, non-null data.
To reproduce the issue, use the following example:
db.define_table('test2',
Field('name'),
Field('interests', 'list:string'),
Field('locations', 'list:string', default=[]))
Then insert a row with:
db.test2.insert(name="Alex")
Now, go to the dashboard and click on the row ID to open the editing page. The list-based UI will not function properly for interests or locations. That is because the value of interests is null for the newly added row.
Note: You can prevent this issue by explicitly setting default=[] for all list fields when defining the table.
-ali