Skip to content

Instantly share code, notes, and snippets.

@Ell
Created April 13, 2011 19:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Ell/918183 to your computer and use it in GitHub Desktop.
Save Ell/918183 to your computer and use it in GitHub Desktop.
if request.method == 'GET':
id = request.GET['id']
tagging = Images.objects.get(id=id)
tags = Tag.objects.usage_for_model(tagging, counts=True)
usageNum = [{"tag": tagfreq.name, "count": tagfreq.count} for tagfreq in tags]
dump = simplejson.dumps(usageNum)
message = dump
$("#tagcloud").tagCloud(tags);
var tags = $.getJSON('/tags/',
{
id: {{ image.id }},
},
function(data) {
console.log(data);
tags = data;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment