diff --git a/houdini/data/penguin.py b/houdini/data/penguin.py index b673ec7..2cf25f0 100644 --- a/houdini/data/penguin.py +++ b/houdini/data/penguin.py @@ -1,3 +1,5 @@ +from datetime import datetime + from houdini.data import db from houdini.data.permission import PermissionCrumbsCollection @@ -103,6 +105,10 @@ class Penguin(db.Model): def safe_nickname(self, language_bitmask): return self.nickname if self.approval & language_bitmask else "P" + str(self.id) + @property + def age(self): + return (datetime.now() - self.registration_date).days + @property def approval(self): return int('{}{}0{}{}{}{}'.format(self.approval_ru * 1, self.approval_de * 1, self.approval_es * 1,