mirror of
https://github.com/Hopiu/django-embed-video.git
synced 2026-03-26 01:30:23 +00:00
Docs for get_backend method
This commit is contained in:
parent
a1f5a392d5
commit
c22c82a86a
1 changed files with 11 additions and 3 deletions
|
|
@ -103,9 +103,17 @@ class VideoNode(Node):
|
|||
return output
|
||||
|
||||
@staticmethod
|
||||
def get_backend(backend, context=None):
|
||||
if not isinstance(backend, VideoBackend):
|
||||
backend = detect_backend(backend)
|
||||
def get_backend(backend_or_url, context=None):
|
||||
"""
|
||||
Returns instance of VideoBackend. If context is passed to the method
|
||||
and request is secure, than the is_secure mark is set to backend.
|
||||
|
||||
A string or VideoBackend instance can be passed to the method.
|
||||
"""
|
||||
|
||||
backend = backend_or_url if isinstance(backend_or_url, VideoBackend) \
|
||||
else detect_backend(backend_or_url)
|
||||
|
||||
if context and 'request' in context:
|
||||
backend.is_secure = context['request'].is_secure()
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue