Closed sbenthall closed 4 years ago
document_type()
takes a DocumentTypeURI
- the following should work:
dt = DataTracker(cache_dir=Path("cache"))
group = dt.group_from_acronym('mmusic')
drafts = dt.documents(group = group,
doctype = dt.document_type(DocumentTypeURI("/api/v1/name/doctypename/draft")))
I'm wondering if document_type()
and similar methods should be updated to take either a URI or a slug?
dt.document_type(uri=…)
or
dt.document_type(slug="draft")
This would make the implementation of the library a little messy, but might simplify code that uses it somewhat.
Ah, thank you, that works @lumisota
@csperkins what about dt.doctype_from_slug
@sbenthall that's the other option, yeah. If we're going to be consistent with the naming, it would be document_type_from_slug()
.
This errors with: