Skip to content

Commit d3997c7

Browse files
committed
fix: autodoc warnings and formatting
1 parent 96eba29 commit d3997c7

File tree

3 files changed

+32
-27
lines changed

3 files changed

+32
-27
lines changed

docs/api.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ SQLAlchemyInterface
1111

1212
ORMField
1313
--------------------
14-
.. autoclass:: graphene_sqlalchemy.fields.ORMField
14+
.. autoclass:: graphene_sqlalchemy.types.ORMField
1515

1616
SQLAlchemyConnectionField
1717
-------------------------
18-
.. autoclass:: graphene_sqlalchemy.SQLAlchemyConnectionField
18+
.. autoclass:: graphene_sqlalchemy.SQLAlchemyConnectionField

docs/tips.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Tips
55
Querying
66
--------
77
.. _querying:
8+
89
In order to make querying against the database work, there are two alternatives:
910

1011
- Set the db session when you do the execution:

graphene_sqlalchemy/types.py

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -408,13 +408,15 @@ class SQLAlchemyObjectType(SQLAlchemyBase, ObjectType):
408408
409409
Usage:
410410
411-
class MyModel(Base):
412-
id = Column(Integer(), primary_key=True)
413-
name = Column(String())
411+
.. code-block:: python
414412
415-
class MyType(SQLAlchemyObjectType):
416-
class Meta:
417-
model = MyModel
413+
class MyModel(Base):
414+
id = Column(Integer(), primary_key=True)
415+
name = Column(String())
416+
417+
class MyType(SQLAlchemyObjectType):
418+
class Meta:
419+
model = MyModel
418420
"""
419421

420422
@classmethod
@@ -450,30 +452,32 @@ class SQLAlchemyInterface(SQLAlchemyBase, Interface):
450452
451453
Usage (using joined table inheritance):
452454
453-
class MyBaseModel(Base):
454-
id = Column(Integer(), primary_key=True)
455-
type = Column(String())
456-
name = Column(String())
455+
.. code-block:: python
457456
458-
__mapper_args__ = {
459-
"polymorphic_on": type,
460-
}
457+
class MyBaseModel(Base):
458+
id = Column(Integer(), primary_key=True)
459+
type = Column(String())
460+
name = Column(String())
461461
462-
class MyChildModel(Base):
463-
date = Column(Date())
462+
__mapper_args__ = {
463+
"polymorphic_on": type,
464+
}
464465
465-
__mapper_args__ = {
466-
"polymorphic_identity": "child",
467-
}
466+
class MyChildModel(Base):
467+
date = Column(Date())
468468
469-
class MyBaseType(SQLAlchemyInterface):
470-
class Meta:
471-
model = MyBaseModel
469+
__mapper_args__ = {
470+
"polymorphic_identity": "child",
471+
}
472472
473-
class MyChildType(SQLAlchemyObjectType):
474-
class Meta:
475-
model = MyChildModel
476-
interfaces = (MyBaseType,)
473+
class MyBaseType(SQLAlchemyInterface):
474+
class Meta:
475+
model = MyBaseModel
476+
477+
class MyChildType(SQLAlchemyObjectType):
478+
class Meta:
479+
model = MyChildModel
480+
interfaces = (MyBaseType,)
477481
"""
478482

479483
@classmethod

0 commit comments

Comments
 (0)