Add notes about StreamColor schema

(imported from commit 2ca71d63a208be1555866235a2dc631f21a0d181)
This commit is contained in:
Keegan McAllister
2012-12-05 16:23:45 -05:00
parent 6776fd389f
commit b64c8e8979

View File

@@ -760,6 +760,13 @@ class DefaultStream(models.Model):
class Meta: class Meta:
unique_together = ("realm", "stream") 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): class StreamColor(models.Model):
subscription = models.ForeignKey(Subscription) subscription = models.ForeignKey(Subscription)
color = models.CharField(max_length=10) color = models.CharField(max_length=10)