def detect_full_text(tweet):
if 'retweeted_status' in tweet.*_json*:
analysis_tweet = tweet._json['retweeted_status']['full_text']
else:
analysis_tweet = tweet.full_text
return (analysis_tweet)
{%用于分析%%}
<tr>
<td>
{{ detect_full_text(analyze) }}
</td>
<td>
{{ analyze.created_at }}
</td>
<td>
{{ analyze.favorite_count }}
</td>
<td>
{{ analyze.retweet_count }}
</td>
</tr>
{% endfor %}
我想从html页面中的view.py调用python函数