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. |
Answered by
dantownsend
Sep 22, 2024
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]) |
1 reply
Answer selected by
dantownsend
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@BrianLYS Yes, using
TABLE_REGISTRYshould work OK.The only downside is it literally pulls in every table (including things like
Migrationwhich you might not want, but it's not a huge deal).Another solution, if using Piccolo Apps, is to do something like: