Using TABLE_REGISTRY to automatically add tables to admin #413
-
Recently the amount of tables that i have to add to the admin has started to get pretty large and I realised that I can use Is there ever a reason to not do this because I realise that the docs don't talk about doing this. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
@BrianLYS Yes, using The only downside is it literally pulls in every table (including things like Another solution, if using Piccolo Apps, is to do something like: from my_app.piccolo_app import APP_CONFIG as APP_CONFIG_1
from my_other_app.piccolo_app import APP_CONFIG as APP_CONFIG_2
create_admin(tables=[*APP_CONFIG_1, *APP_CONFIG_2]) |
Beta Was this translation helpful? Give feedback.
@BrianLYS Yes, using
TABLE_REGISTRY
should work OK.The only downside is it literally pulls in every table (including things like
Migration
which you might not want, but it's not a huge deal).Another solution, if using Piccolo Apps, is to do something like: