Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /sahajrajmalla_greatapi /greatapi /utils /urls.py
| from __future__ import annotations | |
| import inspect | |
| from typing import Any | |
| from greatapi.db.database import Base | |
| # TODO: Substitute Any with AdminSite class type | |
| def get_route_app(class_name: Any) -> str: | |
| module_path = inspect.getmodule(class_name).__name__ # type: ignore | |
| split_by_dot = module_path.split('.') | |
| return split_by_dot[-2] | |
| def get_route_dict(REGISTERED_ADMINS: list[Any]) -> dict[str, dict[str, Base]]: | |
| registered_admins: dict[str, dict[str, Base]] = {} | |
| for admin_class in REGISTERED_ADMINS: | |
| app_name = get_route_app(admin_class) | |
| route_url = admin_class.__tablename__.lower() | |
| if app_name in registered_admins.keys(): | |
| registered_admins[app_name].update({route_url: admin_class}) | |
| else: | |
| registered_admins[app_name] = {route_url: admin_class} | |
| return registered_admins | |
Xet Storage Details
- Size:
- 864 Bytes
- Xet hash:
- 50974296b6b31d25300db4340b372b679e8a6d54ceeb4263c098d9b35b674e6c
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.