Skip to content

Using TABLE_REGISTRY to automatically add tables to admin #413

Answered by dantownsend
BrianLYS asked this question in Q&A
Discussion options

You must be logged in to vote

@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:

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])

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@BrianLYS
Comment options

Answer selected by dantownsend
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants