datajoint-python
datajoint-python copied to clipboard
Feature Request: Overwrite comment when foreign keys used with proj()
Consider the following table definition:
@schema
class ProjectorColor(dj.Lookup):
definition = """
# color options for projector channels
color_id : tinyint # color id
---
color : varchar(32) # color name
"""
@schema
class ProjectorConfig(dj.Lookup):
definition = """
# projector configuration
projector_config : tinyint # projector config
---
-> ProjectorColor.proj(channel_1="color_id") # channel 1 means 1st color channel. Usually red
-> ProjectorColor.proj(channel_2="color_id") # channel 2 means 2nd color channel. Usually green
-> ProjectorColor.proj(channel_3="color_id") # channel 3 means 3rd color channel. Usually blue
refresh_rate : float # refresh rate in Hz
"""
In this scenario, because channel_1,2, and 3 were renamed from the primary key color_id
from the table ProjectorConfig
, when you prompt ProjectorConfig.heading
, the following happens:
# projector configuration
projector_config : tinyint # projector config
---
channel_1 : tinyint # color id
channel_2 : tinyint # color id
channel_3 : tinyint # color id
refresh_rate : float # refresh rate in Hz
I think it is more useful to show the comments used in the ProjectorConfig
for each color channel, not a generic comment used in ProjectorColor
.
It would make sense to override the comment for any dependency, even with no proj
.