Skip to content

Commit

Permalink
add: docs stubs for entity-related methods on the client
Browse files Browse the repository at this point in the history
- also tried to make the docstrings a bit clearer
  • Loading branch information
lindsay-stevens committed Apr 17, 2024
1 parent 1715fdd commit dc36fbb
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 8 deletions.
3 changes: 3 additions & 0 deletions docs/entities.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Entities

::: pyodk._endpoints.entities.EntityService
3 changes: 3 additions & 0 deletions docs/entity_lists.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Entity Lists

::: pyodk._endpoints.entity_lists.EntityListService
4 changes: 3 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ watch:
nav:
- Overview: index.md
- Client: client.md
- .entities: entities.md
- .entity_lists: entity_lists.md
- .forms: forms.md
- .submissions: submissions.md
- .projects: projects.md
- .submissions: submissions.md
- HTTP methods: http-methods.md
- Examples: examples/README.md

Expand Down
4 changes: 3 additions & 1 deletion pyodk/_endpoints/entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ class EntityService(bases.Service):
data = client.entities.list()
```
An EntityList is a list of Entities, e.g. `list[Entity]`.
Conceptually, an Entity's parent object is an EntityList. Each EntityList may
have multiple Entities. In Python parlance, EntityLists are like classes, while
Entities are like instances.
"""

__slots__ = ("urls", "session", "default_project_id", "default_entity_list_name")
Expand Down
8 changes: 2 additions & 6 deletions pyodk/_endpoints/entity_lists.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,8 @@ class EntityListService(bases.Service):
data = client.entity_lists.list()
```
The structure this class works with is conceptually a list of lists, e.g.
```
EntityList = list[Entity]
self.list() = list[EntityList]
```
Conceptually, an EntityList's parent object is a Project. Each Project may have
multiple EntityLists.
"""

__slots__ = ("urls", "session", "default_project_id")
Expand Down

0 comments on commit dc36fbb

Please sign in to comment.