This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% for tag in want.tags %}<a href="{% url wants_by_tag tag %}">{{ tag }}</a>{% endfor %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
============== | |
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<li>Username: {{user.username}}</li> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<li>Username: {{profile.user.username}}</li> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
people = Profile.objects.order_by("points").reverse() | |
return {'people': people} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% for person in people %} | |
<li><a href="{% url user-profile person.user.username %}">{{ person.points }}pt - {{ person.user.username }}</a></li> | |
{% endfor %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
people = User.objects.filter(is_superuser=0) | |
return {'people': people} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% for person in people %} | |
{% with profile as person.get_profile %} | |
{{ person.username }} has - {{ profile.points }} - points. | |
{% endwith %} | |
{% endfor %} |