diff oembed/models.py @ 1154:4da4e32b314c

Do not restrict oEmbed support to just video. This will allow us to embed stuff from SoundClound and ReverbNation.
author Brian Neal <bgneal@gmail.com>
date Tue, 27 Dec 2016 10:21:37 -0600
parents d3f6e9cb1f39
children
line wrap: on
line diff
--- a/oembed/models.py	Tue Dec 27 09:31:08 2016 -0600
+++ b/oembed/models.py	Tue Dec 27 10:21:37 2016 -0600
@@ -37,6 +37,8 @@
         (LINK, "link"),
         (RICH, "rich"),
     )
+    ALLOWED_TYPES = set(choice[1] for choice in MEDIA_TYPE_CHOICES)
+    MEDIA_TYPE_REVERSE = {choice[1]: choice[0] for choice in MEDIA_TYPE_CHOICES}
 
     url = models.URLField(max_length=255, db_index=True)
     type = models.IntegerField(choices=MEDIA_TYPE_CHOICES)