From f7bfd6daed4c6eaed3008d1f350ef1c4f8adcc79 Mon Sep 17 00:00:00 2001 From: Skia Date: Tue, 8 Dec 2015 09:46:40 +0100 Subject: [PATCH] Add getattribute to PageRev for getting owner_group&co --- core/models.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/core/models.py b/core/models.py index d4bd1bce..801d8a80 100644 --- a/core/models.py +++ b/core/models.py @@ -315,6 +315,16 @@ class PageRev(models.Model): def __str__(self): return str(self.__dict__) + def __getattribute__(self, attr): + if attr == "owner_group": + return self.page.owner_group + elif attr == "edit_group": + return self.page.edit_group + elif attr == "view_group": + return self.page.view_group + else: + return object.__getattribute__(self, attr) + def save(self, *args, **kwargs): super(PageRev, self).save(*args, **kwargs) # Don't forget to unlock, otherwise, people will have to wait for the page's timeout