Skip to content

Commit c93a521

Browse files
committed
added docs for array indexes
1 parent 904f91c commit c93a521

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

docs/src/piccolo/schema/column_types.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,3 +215,9 @@ Arrays of data can be stored, which can be useful when you want store lots of
215215
values without using foreign keys.
216216

217217
.. autoclass:: Array
218+
219+
=============================
220+
Accessing individual elements
221+
=============================
222+
223+
.. automethod:: Array.__getitem__

piccolo/columns/column_types.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1411,7 +1411,9 @@ def __getitem__(self, value: int) -> Array:
14111411
14121412
.. code-block:: python
14131413
1414-
Ticket.select(Ticket.seat_numbers[1]).run_sync
1414+
>>> Ticket.select(Ticket.seat_numbers[0]).first().run_sync
1415+
{'seat_numbers': 325}
1416+
14151417
14161418
"""
14171419
if isinstance(value, int):

0 commit comments

Comments
 (0)