示例#1
0
 def render(self, context):
     try:
        value = self.domain.resolve(context)
        context[self.varname] = Target.get_or_create_object(value)
     except template.VariableDoesNotExist:
         pass
     return ''
示例#2
0
def mywot_scorecard(url):
    ''' Return the MyWOT Scorecard for the specified domain. '''

    ## return the mywot scorecard of the extracted domain
    target = Target.get_or_create_object(url)
    return render_to_string(
        'mywot/mywot_scorecard.html',
        { 'target':target },
    )