From 7b354052803cb0d25c0f0961616a64043a19bb42 Mon Sep 17 00:00:00 2001 From: Neil Williams Date: Thu, 2 May 2013 20:20:42 -0700 Subject: [PATCH] Add author_slow property to Message. --- r2/r2/models/link.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/r2/r2/models/link.py b/r2/r2/models/link.py index 0ba6394da..97eca3149 100755 --- a/r2/r2/models/link.py +++ b/r2/r2/models/link.py @@ -1431,6 +1431,13 @@ class Message(Thing, Printable): if self.sr_id: return Subreddit._byID(self.sr_id) + @property + def author_slow(self): + """Returns the message's author.""" + # The author is often already on the wrapped message as .author + # If available, that should be used instead of calling this + return Account._byID(self.author_id, data=True, return_dict=False) + @staticmethod def wrapped_cache_key(wrapped, style): s = Printable.wrapped_cache_key(wrapped, style)