Skip to content

Commit 6d2f867

Browse files
committed
document automatic tablename
1 parent fcbbc17 commit 6d2f867

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

docs/api.rst

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ Models
2727
Optionally declares the bind to use. `None` refers to the default
2828
bind. For more information see :ref:`binds`.
2929

30+
.. attribute:: __tablename__
31+
32+
The name of the table in the database. This is required by SQLAlchemy;
33+
however, Flask-SQLAlchemy will set it automatically if a model has a
34+
primary key defined. If the ``__table__`` or ``__tablename__`` is set
35+
explicitly, that will be used instead.
36+
3037
.. autoclass:: BaseQuery
3138
:members: get, get_or_404, paginate, first_or_404
3239

@@ -54,7 +61,7 @@ Models
5461
Return the first result of this query or `None` if the result
5562
doesn’t contain any rows. This results in an execution of the
5663
underlying query.
57-
64+
5865
Sessions
5966
````````
6067

0 commit comments

Comments
 (0)