From 92aa0f99c3d6cdbff06202e524adc117e3502baf Mon Sep 17 00:00:00 2001 From: Tom Hunger Date: Tue, 10 Mar 2015 10:48:48 +0000 Subject: [PATCH] Add note that 'friends_printers' is suboptimal and won't scale. --- sirius/models/user.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sirius/models/user.py b/sirius/models/user.py index 1cd9f16..7e8140e 100644 --- a/sirius/models/user.py +++ b/sirius/models/user.py @@ -107,6 +107,8 @@ class User(db.Model): """ :returns: List of printers this user can print on. """ + # TODO(tom): Querying the full database is O(N) and will not + # scale. Replace the model with a N:M relationship. sn = self.twitter_oauth.screen_name reverse_friend_ids = [ x.user_id for x in TwitterOAuth.query.all() -- 2.47.3