Permalink
Browse files

Adding related_name to invitation allotment model.

  • Loading branch information...
1 parent d88e9d5 commit 8792fb2d27f468df4878ae59264b51901966f05e @nathanborror committed Jul 31, 2010
@@ -54,7 +54,7 @@ def get_absolute_url(self):
class InvitationAllotment(models.Model):
""" InvitationAllotment model """
- user = models.OneToOneField(User)
+ user = models.OneToOneField(User, related_name='invitation_allotment')
amount = models.IntegerField(default=INVITATION_ALLOTMENT)
site = models.ForeignKey(Site, default=settings.SITE_ID)
created = models.DateTimeField(auto_now_add=True)
@@ -11,5 +11,5 @@
{% block content %}
- <p>Your invitation has been sent. You have <strong>{{ user.invitationallotment.amount }} invitation{{ user.invitationallotment.amount|pluralize }}</strong> remaining.</p>
+ <p>Your invitation has been sent. You have <strong>{{ user.invitation_allotment.amount }} invitation{{ user.invitation_allotment.amount|pluralize }}</strong> remaining.</p>
{% endblock %}
@@ -28,7 +28,7 @@ def invitation_create(request, template_name='invitations/invitation_form.html',
InvitationForm object
"""
try:
- allotment = request.user.invitationallotment
+ allotment = request.user.invitation_allotment
if allotment.amount == 0:
return invitation_error(request)
except InvitationAllotment.DoesNotExist:

0 comments on commit 8792fb2

Please sign in to comment.