circuit
circuit social network code-documentation
Functions | Variables
posts.templatetags.parser Namespace Reference

Functions

def parse_post_content (content)
 
def create_hashtag_url (matchobj)
 
def create_mention_url (matchobj)
 

Variables

tuple register = template.Library()
 

Detailed Description

@package posts.templatetags.parser
Extra template functions for posts.

@author 7Pros
@copyright

Function Documentation

def posts.templatetags.parser.create_hashtag_url (   matchobj)
Receives a matched object with a hashtag in the .group(0) and returns the url from it.

@param matchobj: MatchObj - given through pattern.sub.

@return hashtag between <a></a> HTML tags
def posts.templatetags.parser.create_mention_url (   matchobj)
Receives a matched object with a mention in the .group(0) and returns the url from it.

@param matchobj: MatchObj - given through pattern.sub.

@return mention between <a></a> HTML tags
def posts.templatetags.parser.parse_post_content (   content)
It parses a string replacing hashtags and mentions with urls of those.

@param content: string - content to be parsed.

@return string - with the parsed hashtags and mentions

Variable Documentation

tuple posts.templatetags.parser.register = template.Library()