Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Make admin a bit more usable

  • Loading branch information...
commit 423478315ff2a8eb53b3ffe2f14c2d2c80f713c5 1 parent 714266e
Patrick Altman paltman authored
Showing with 7 additions and 1 deletion.
  1. +1 −1  anafero/admin.py
  2. +6 −0 anafero/models.py
2  anafero/admin.py
View
@@ -4,7 +4,7 @@
admin.site.register(Referral,
- list_display = ["user", "code", "redirect_to", "target_content_type", "target_object_id"],
+ list_display = ["user", "code", "label", "redirect_to", "target_content_type", "target_object_id"],
readonly_fields = ["code", "created_at"],
list_filter = ["target_content_type", "created_at"],
search_fields = ["user", "code"]
6 anafero/models.py
View
@@ -42,6 +42,12 @@ class Referral(models.Model):
created_at = models.DateTimeField(default=datetime.datetime.now)
+ def __unicode__(self):
+ if self.user:
+ return u"%s (%s)" % (self.user, self.code)
+ else:
+ return self.code
+
@classmethod
def for_request(cls, request):
cookie = request.COOKIES.get("anafero-referral")
Please sign in to comment.
Something went wrong with that request. Please try again.