From b64c8e897939075bc0ac6f16da934c764a7154bc Mon Sep 17 00:00:00 2001 From: Keegan McAllister Date: Wed, 5 Dec 2012 16:23:45 -0500 Subject: [PATCH] Add notes about StreamColor schema (imported from commit 2ca71d63a208be1555866235a2dc631f21a0d181) --- zephyr/models.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/zephyr/models.py b/zephyr/models.py index 409131438b..875adab7de 100644 --- a/zephyr/models.py +++ b/zephyr/models.py @@ -760,6 +760,13 @@ class DefaultStream(models.Model): class Meta: unique_together = ("realm", "stream") +# FIXME: The foreign key relationship here is backwards. +# +# We can't easily get a list of streams and their associated colors (if any) in +# a single query. See zephyr.views.gather_subscriptions for an example. +# +# We should change things around so that is possible. Probably this should +# just be a column on Subscription. class StreamColor(models.Model): subscription = models.ForeignKey(Subscription) color = models.CharField(max_length=10)