Skip to content

Commit ab4236b

Browse files
committed
doc: document how to get defined ES
Thank you, @kovnat <[email protected]>! Closes #10
1 parent a280798 commit ab4236b

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

USAGE.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,25 @@ entity sets are pointing to existing elements.
198198
The most often problem that we had to deal with was an invalid ValueList annotion
199199
pointing to a non-existing property.
200200

201+
To enable verification of service definition, the client instance of the class
202+
`Service` publishes the property `schema` which returns an instance of the
203+
class `Schema` from the module [pyodata.v2.model](pyodata/v2/model.py) and it
204+
contains parsed `$metadata`.
205+
206+
### List of the defined EntitySets
207+
208+
If you need to iterate over all EntitySets:
209+
210+
```python
211+
for es in service.schema.entity_sets:
212+
print(es.name)
213+
```
214+
215+
or if you just need the list of EntitySet names:
216+
217+
```python
218+
entity_set_names = [es.name for es in service.schema.entity_sets]
219+
```
201220

202221
### Property has this label
203222

0 commit comments

Comments
 (0)