Browse files

Make admin a bit more usable

  • Loading branch information...
1 parent 714266e commit 423478315ff2a8eb53b3ffe2f14c2d2c80f713c5 @paltman paltman committed Aug 14, 2012
Showing with 7 additions and 1 deletion.
  1. +1 −1 anafero/admin.py
  2. +6 −0 anafero/models.py
View
2 anafero/admin.py
@@ -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"]
View
6 anafero/models.py
@@ -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")

0 comments on commit 4234783

Please sign in to comment.