Generate the version string to be used in static URLs. ``settings`` is the `Application.settings` dictionary and ``path`` is the relative location of the requested asset on the filesystem. The returned value should be a string, or ``None`` if no version could be dete
(cls, settings: Dict[str, Any], path: str)
| 2999 | |
| 3000 | @classmethod |
| 3001 | def get_version(cls, settings: Dict[str, Any], path: str) -> Optional[str]: |
| 3002 | """Generate the version string to be used in static URLs. |
| 3003 | |
| 3004 | ``settings`` is the `Application.settings` dictionary and ``path`` |
| 3005 | is the relative location of the requested asset on the filesystem. |
| 3006 | The returned value should be a string, or ``None`` if no version |
| 3007 | could be determined. |
| 3008 | |
| 3009 | .. versionchanged:: 3.1 |
| 3010 | This method was previously recommended for subclasses to override; |
| 3011 | `get_content_version` is now preferred as it allows the base |
| 3012 | class to handle caching of the result. |
| 3013 | """ |
| 3014 | abs_path = cls.get_absolute_path(settings["static_path"], path) |
| 3015 | return cls._get_cached_version(abs_path) |
| 3016 | |
| 3017 | @classmethod |
| 3018 | def _get_cached_version(cls, abs_path: str) -> Optional[str]: |
no test coverage detected