piccolo_admin icon indicating copy to clipboard operation
piccolo_admin copied to clipboard

`TableConfig` name overrides

Open dantownsend opened this issue 3 years ago • 1 comments

If there's a column or a table with a terrible name, it would be nice to override it in the admin.

app = create_admin(
    TableConfig(
        TableWithRegrettableName,
        name_override="A nice table name",
        column_name_overrides={TableWithRegrettableName.regrettable_column_name: 'A nice column name'}
    )
)

dantownsend avatar Oct 27 '21 13:10 dantownsend

Adding my 2 cents to my plus 1 here: I don't think it is even necessarily "terrible" table names that drive this need. The table name might simply not reflect business terminology at the time. This seems particularly true given Piccolo's apps feature that allows us to abstract functionality in a way that future nomenclature might really be unknown.

Another aspect of using apps which affects this is that I find myself wanting to namespace my tables to avoid potential naming conflicts. I think Django does something like this by prefixing the app name to the class-based table name. Thus, you get these long names that I think are terrible for a reason, but drive a need for simpler naming reflected in the admin.

scott2b avatar May 25 '22 01:05 scott2b