[ckan-changes] [okfn/ckan] d3eb51: [xs] allow render_snippet and render_text to pass ...

GitHub noreply at github.com
Tue Apr 24 14:54:38 UTC 2012


  Branch: refs/heads/feature-2306-resource-created
  Home:   https://github.com/okfn/ckan
  Commit: d3eb51a89a5e4546c4beb09ccd358ebfd8d720fa
      https://github.com/okfn/ckan/commit/d3eb51a89a5e4546c4beb09ccd358ebfd8d720fa
  Author: Toby <toby.junk at gmail.com>
  Date:   2012-04-24 (Tue, 24 Apr 2012)

  Changed paths:
    M ckan/lib/base.py

  Log Message:
  -----------
  [xs] allow render_snippet and render_text to pass cache_force keyword


diff --git a/ckan/lib/base.py b/ckan/lib/base.py
index dd1f03b..ffb79a7 100644
--- a/ckan/lib/base.py
+++ b/ckan/lib/base.py
@@ -53,16 +53,19 @@ def render_snippet(template_name, **kw):
     comment tags added to show the template used. NOTE: unlike other
     render functions this takes a list of keywords instead of a dict for
     the extra template variables. '''
-    output = render(template_name, extra_vars=kw)
+    # allow cache_force to be set in render function
+    cache_force = kw.pop('cache_force', None)
+    output = render(template_name, extra_vars=kw, cache_force=cache_force)
     output = '\n<!-- Snippet %s start -->\n%s\n<!-- Snippet %s end -->\n' % (
                     template_name, output, template_name)
     return literal(output)
 
-def render_text(template_name, extra_vars=None):
+def render_text(template_name, extra_vars=None, cache_force=None):
     ''' Helper function to render a genshi NewTextTemplate without
     having to pass the loader_class or method. '''
     return render(template_name,
                   extra_vars=extra_vars,
+                  cache_force=cache_force,
                   method='text',
                   loader_class=NewTextTemplate)
 


================================================================
  Commit: 8c360e49df53e0531f560392d5188d9ca9326917
      https://github.com/okfn/ckan/commit/8c360e49df53e0531f560392d5188d9ca9326917
  Author: John Glover <j at johnglover.net>
  Date:   2012-04-24 (Tue, 24 Apr 2012)

  Changed paths:
    M ckan/lib/base.py

  Log Message:
  -----------
  Merge remote-tracking branch 'origin/master' into feature-2306-resource-created


diff --git a/ckan/lib/base.py b/ckan/lib/base.py
index dd1f03b..ffb79a7 100644
--- a/ckan/lib/base.py
+++ b/ckan/lib/base.py
@@ -53,16 +53,19 @@ def render_snippet(template_name, **kw):
     comment tags added to show the template used. NOTE: unlike other
     render functions this takes a list of keywords instead of a dict for
     the extra template variables. '''
-    output = render(template_name, extra_vars=kw)
+    # allow cache_force to be set in render function
+    cache_force = kw.pop('cache_force', None)
+    output = render(template_name, extra_vars=kw, cache_force=cache_force)
     output = '\n<!-- Snippet %s start -->\n%s\n<!-- Snippet %s end -->\n' % (
                     template_name, output, template_name)
     return literal(output)
 
-def render_text(template_name, extra_vars=None):
+def render_text(template_name, extra_vars=None, cache_force=None):
     ''' Helper function to render a genshi NewTextTemplate without
     having to pass the loader_class or method. '''
     return render(template_name,
                   extra_vars=extra_vars,
+                  cache_force=cache_force,
                   method='text',
                   loader_class=NewTextTemplate)
 


================================================================
  Commit: 0dd4efaa71cd264c533688640ea42e8f819d9aaa
      https://github.com/okfn/ckan/commit/0dd4efaa71cd264c533688640ea42e8f819d9aaa
  Author: John Glover <j at johnglover.net>
  Date:   2012-04-24 (Tue, 24 Apr 2012)

  Changed paths:
    A ckan/migration/versions/055_update_user_and_activity_detail.py

  Log Message:
  -----------
  [xs][migrations] clean up: add missing migration for changes to user table (set name not null) and activiy_detail table


diff --git a/ckan/migration/versions/055_update_user_and_activity_detail.py b/ckan/migration/versions/055_update_user_and_activity_detail.py
new file mode 100644
index 0000000..5d34900
--- /dev/null
+++ b/ckan/migration/versions/055_update_user_and_activity_detail.py
@@ -0,0 +1,9 @@
+def upgrade(migrate_engine):
+    migrate_engine.execute('''
+        ALTER TABLE activity_detail
+            ALTER COLUMN activity_id DROP NOT NULL;
+
+        ALTER TABLE "user"
+            ALTER COLUMN name SET NOT NULL;
+    '''
+    )


================================================================
Compare: https://github.com/okfn/ckan/compare/13805f2...0dd4efa


More information about the ckan-changes mailing list