Skip to content

Commit 41acaa3

Browse files
fix #699 -- add table definition to doc string
1 parent d6f84f5 commit 41acaa3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

datajoint/schema.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,10 @@ def process_table_class(self, table_class, context, assert_declared=False):
191191
instance.declare(context)
192192
is_declared = is_declared or instance.is_declared
193193

194+
# add table definition to the doc string
195+
if isinstance(table_class.definition, str):
196+
table_class.__doc__ = (table_class.__doc__ or "") + "\n\nTable definition:\n\n" + table_class.definition
197+
194198
# fill values in Lookup tables from their contents property
195199
if isinstance(instance, Lookup) and hasattr(instance, 'contents') and is_declared:
196200
contents = list(instance.contents)

0 commit comments

Comments
 (0)