if res:
return Profile(self.backend, res.id, res)
+ def get_profile_with_data(self, public_id, when=None):
+ res = self.db.get("WITH profiles AS (SELECT fireinfo_profiles_with_data_at(%s) AS id) \
+ SELECT * FROM profiles JOIN fireinfo_profiles ON profiles.id = fireinfo_profiles.id \
+ WHERE public_id = %s ORDER BY time_updated DESC LIMIT 1", when, public_id)
+
+ if res:
+ return Profile(self.backend, res.id, res)
+
def get_profiles(self, public_id):
res = self.db.query("SELECT * FROM fireinfo_profiles \
WHERE public_id = %s ORDER BY time_created DESC", public_id)