[SCM] live-studio branch, master, updated. be51da814fb12d25dce46a7f078a46f5c89bd777

Chris Lamb lamby at debian.org
Fri Jul 30 02:52:32 UTC 2010


The following commit has been merged in the master branch:
commit 40215ee32eea0895f4885ec04a870cc8eaf481fe
Author: Chris Lamb <lamby at debian.org>
Date:   Wed Jul 28 16:19:41 2010 -0400

    Add a stub template tag for media.
    
    Signed-off-by: Chris Lamb <lamby at debian.org>

diff --git a/config/settings/defaults/apps.py b/config/settings/defaults/apps.py
index 94932af..75d515b 100644
--- a/config/settings/defaults/apps.py
+++ b/config/settings/defaults/apps.py
@@ -7,6 +7,7 @@ INSTALLED_APPS = [
 
     'live_studio_www.auth',
     'live_studio_www.static',
+    'live_studio_www.templatetags',
 ]
 
 try:
diff --git a/live_studio_www/templatetags/__init__.py b/live_studio_www/templatetags/__init__.py
new file mode 100644
index 0000000..1f22112
--- /dev/null
+++ b/live_studio_www/templatetags/__init__.py
@@ -0,0 +1,7 @@
+from django.template import add_to_builtins
+
+from .library import register
+
+import media
+
+add_to_builtins('live_studio_www.templatetags')
diff --git a/live_studio_www/templatetags/library.py b/live_studio_www/templatetags/library.py
new file mode 100644
index 0000000..1095855
--- /dev/null
+++ b/live_studio_www/templatetags/library.py
@@ -0,0 +1,4 @@
+from django import template
+
+# shared among the various separate files in this module
+register = template.Library()
diff --git a/live_studio_www/templatetags/media.py b/live_studio_www/templatetags/media.py
new file mode 100644
index 0000000..33b130f
--- /dev/null
+++ b/live_studio_www/templatetags/media.py
@@ -0,0 +1,6 @@
+from .library import register
+
+ at register.simple_tag
+def static(suffix):
+    # This will eventually based on a settings variable
+    return "/media/%s" % suffix
diff --git a/live_studio_www/auth/models.py b/live_studio_www/templatetags/models.py
similarity index 100%
copy from live_studio_www/auth/models.py
copy to live_studio_www/templatetags/models.py

-- 
live-studio



More information about the debian-live-changes mailing list