From c2dfb6f2e41f0bbceef6cdb43f1e9d10d82c9482 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Sun, 3 Mar 2013 11:28:28 +0000 Subject: [PATCH] dont overwrite default itemkey properties --- pandora/item/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pandora/item/models.py b/pandora/item/models.py index bca5d0ed4..2a7cc43e4 100644 --- a/pandora/item/models.py +++ b/pandora/item/models.py @@ -1406,7 +1406,8 @@ for key in filter(lambda k: k.get('sort', False) or k['type'] in ('integer', 'ti 'time': 'integer', 'enum': 'integer', }.get(sort_type, sort_type)] - attrs[name] = model[0](**model[1]) + if name not in attrs: + attrs[name] = model[0](**model[1]) ItemSort = type('ItemSort', (models.Model,), attrs) ItemSort.fields = [f.name for f in ItemSort._meta.fields]