From bcd328a10150f3b0ebb6bff891b46d1286e6542c Mon Sep 17 00:00:00 2001 From: Brandon Taylor Date: Mon, 3 Nov 2014 11:19:59 -0500 Subject: [PATCH] Added child to str representation of self-referential model. --- python3_sample_project/app/models.py | 2 ++ .../database/python3-test-project.sqlite3 | Bin 81920 -> 81920 bytes 2 files changed, 2 insertions(+) diff --git a/python3_sample_project/app/models.py b/python3_sample_project/app/models.py index ad0b902..72c1874 100644 --- a/python3_sample_project/app/models.py +++ b/python3_sample_project/app/models.py @@ -149,4 +149,6 @@ class SelfReferentialCategory(SimpleModel, Sortable): child = SortableForeignKey('self', blank=True, null=True) def __str__(self): + if self.child: + return '{} - {}'.format(self.child, self.title) return self.title diff --git a/python3_sample_project/database/python3-test-project.sqlite3 b/python3_sample_project/database/python3-test-project.sqlite3 index c086f9dcede1eeb8bfd24bb962327a297c0934aa..550f9187d00b7f971b4fc5c6c8b61d9ac97b8349 100644 GIT binary patch delta 239 zcmZo@U~On%ogmG-nSp^J0Em5on0caxIpgMy2@9HSc!6A222lovNsMQh*_fL_OonQ9 zR^LWe$J{K#3ABg=n3#z- z_4%=JG2dZeWmaZj_F&Fs-p)LUS$VS{k03LP3bQZc^mA5>3Y*=#^;q~|=9!urS{fQ| bZtibczzMS0A7sd8L6!H++y5IgGV%Zb2?{OJ