
from django import template
from Instanssi.ext_blog.models import BlogEntry

register = template.Library()

@register.inclusion_tag('ext_blog/blog_messages.html')
def render_blog(event_id):
    entries = BlogEntry.objects.filter(event_id=int(event_id), public=True)
    return {'entries': entries}

@register.inclusion_tag('ext_blog/blog_rss_tag.html')
def render_blog_rss_tag(event_id):
    return {'event_id': event_id}

from django import template
from Instanssi.ext_blog.models import BlogEntry

register = template.Library()

@register.inclusion_tag('ext_blog/blog_messages.html')
def render_blog(event_id):
    entries = BlogEntry.objects.filter(event_id=int(event_id), public=True)
    return {'entries': entries}

@register.inclusion_tag('ext_blog/blog_rss_tag.html')
def render_blog_rss_tag(event_id):
    return {'event_id': event_id}

@register.simple_tag
def blog_rss_url(event_id):
    return 'http://instanssi.org/blog/'+str(event_id)+'/rss/'


Tag for getting a valid RSS feed url for event.
ext_blog: Tag for getting a valid RSS feed url for event.

  
  from django import template
  from Instanssi.ext_blog.models import BlogEntry
  
  register = template.Library()
  
  @register.inclusion_tag('ext_blog/blog_messages.html')
  def render_blog(event_id):
      entries = BlogEntry.objects.filter(event_id=int(event_id), public=True)
      return {'entries': entries}
  
  @register.inclusion_tag('ext_blog/blog_rss_tag.html')
  def render_blog_rss_tag(event_id):
      return {'event_id': event_id}
+ 
+ @register.simple_tag
+ def blog_rss_url(event_id):
+     return 'http://instanssi.org/blog/'+str(event_id)+'/rss/'
+ 
+ 
Tag for getting a valid RSS feed url for event.
## Code Before:

from django import template
from Instanssi.ext_blog.models import BlogEntry

register = template.Library()

@register.inclusion_tag('ext_blog/blog_messages.html')
def render_blog(event_id):
    entries = BlogEntry.objects.filter(event_id=int(event_id), public=True)
    return {'entries': entries}

@register.inclusion_tag('ext_blog/blog_rss_tag.html')
def render_blog_rss_tag(event_id):
    return {'event_id': event_id}
## Instruction:
Tag for getting a valid RSS feed url for event.
## Code After:

from django import template
from Instanssi.ext_blog.models import BlogEntry

register = template.Library()

@register.inclusion_tag('ext_blog/blog_messages.html')
def render_blog(event_id):
    entries = BlogEntry.objects.filter(event_id=int(event_id), public=True)
    return {'entries': entries}

@register.inclusion_tag('ext_blog/blog_rss_tag.html')
def render_blog_rss_tag(event_id):
    return {'event_id': event_id}

@register.simple_tag
def blog_rss_url(event_id):
    return 'http://instanssi.org/blog/'+str(event_id)+'/rss/'

