Skip to content

Instantly share code, notes, and snippets.

View emilepetrone's full-sized avatar
🏠
Working from home

Emile Petrone emilepetrone

🏠
Working from home
View GitHub Profile
{% for tag in want.tags %}<a href="{% url wants_by_tag tag %}">{{ tag }}</a>{% endfor %}
==============
Django Tagging
==============
A generic tagging application for `Django`_ projects, which allows
association of a number of tags with any Django model instance and makes
retrieval of tags simple.
.. _`Django`: http://www.djangoproject.com
<li>Username: {{user.username}}</li>
<li>Username: {{profile.user.username}}</li>
def userprofile(request, template_name="account/userprofile.html", username=''):
if username=='root':
raise Http404
user = get_object_or_404(User, username=username)
profile = user.get_profile()
data = {
"user":user,
def userprofile(request, template_name="account/userprofile.html", username=''):
if username=='root':
raise Http404
user = get_object_or_404(User, username=username)
profile = user.get_profile()
data = {
"profile":profile
people = Profile.objects.order_by("points").reverse()
return {'people': people}
{% for person in people %}
<li><a href="{% url user-profile person.user.username %}">{{ person.points }}pt - {{ person.user.username }}</a></li>
{% endfor %}
people = User.objects.filter(is_superuser=0)
return {'people': people}
{% for person in people %}
{% with profile as person.get_profile %}
{{ person.username }} has - {{ profile.points }} - points.
{% endwith %}
{% endfor %}