MCPcopy Create free account
hub / github.com/dot-agent/nextpy / setup_admin_dash

Method setup_admin_dash

nextpy/app.py:529–550  ·  view source on GitHub ↗

Setup the admin dash.

(self)

Source from the content-addressed store, hash-verified

527 )
528
529 def setup_admin_dash(self):
530 """Setup the admin dash."""
531 # Get the admin dash.
532 admin_dash = self.admin_dash
533
534 if admin_dash and admin_dash.models:
535 # Build the admin dashboard
536 admin = (
537 admin_dash.admin
538 if admin_dash.admin
539 else Admin(
540 engine=Model.get_db_engine(),
541 title="Nextpy Admin Dashboard",
542 logo_url="https://nextpy.org/Nextpy.svg",
543 )
544 )
545
546 for model in admin_dash.models:
547 view = admin_dash.view_overrides.get(model, ModelView)
548 admin.add_view(view(model))
549
550 admin.mount_to(self.api)
551
552 def get_frontend_packages(self, imports: Dict[str, set[ReactImportVar]]):
553 """Gets the frontend packages to be installed and filters out the unnecessary ones.

Callers 1

__init__Method · 0.95

Calls 2

get_db_engineMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected