Skip to content

Commit

Permalink
improve docs for LazyTableReference
Browse files Browse the repository at this point in the history
  • Loading branch information
dantownsend committed Jun 27, 2024
1 parent f1fbcc3 commit a363cbf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 3 additions & 2 deletions docs/src/piccolo/schema/m2m.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@ We create it in Piccolo like this:
.. note::
We use ``LazyTableReference`` because when Python evaluates ``Band`` and
``Genre``, the ``GenreToBand`` class doesn't exist yet.
We use :class:`LazyTableReference <piccolo.columns.reference.LazyTableReference>`
because when Python evaluates ``Band`` and ``Genre``, the ``GenreToBand``
class doesn't exist yet.

By using ``M2M`` it unlocks some powerful and convenient features.

Expand Down
3 changes: 3 additions & 0 deletions piccolo/columns/reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ class LazyTableReference:
If specified, the ``Table`` subclass is imported from this path.
For example, ``'my_app.tables'``.
.. hint::
If the table is in the same file, you can pass in ``__name__``.
"""

table_class_name: str
Expand Down

0 comments on commit a363cbf

Please sign in to comment.