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
people = User.objects.filter(is_superuser=0)
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 = Profile.objects.order_by("points").reverse()
return {'people': people}
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
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,
<li>Username: {{profile.user.username}}</li>
<li>Username: {{user.username}}</li>
==============
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
{% for tag in want.tags %}<a href="{% url wants_by_tag tag %}">{{ tag }}</a>{% endfor %}
{% for want in wants %}
{% if want.body_html %}
<div id="want">
{{ want.body_html|truncatewords_html:"50"|safe }}
{% endif %}
<a href="{% url individual_want want.id %}">Read the full request</a>
<p>Tags: {% for tag in want.tags %}{{ tag }}{% endfor %}</p>
{{ want.mentee}} - {{ want.pub_date|date:"F j, Y" }} -