Skip to content

Commit 37d5d25

Browse files
vvgrem@gmail.comvvgrem@gmail.com
authored andcommitted
SharePoint API: TaxonomyService methods
1 parent 0009381 commit 37d5d25

File tree

15 files changed

+164
-74
lines changed

15 files changed

+164
-74
lines changed

office365/sharepoint/fields/field.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def resolve_field_type(type_id_or_name):
2424
from office365.sharepoint.fields.field_text import FieldText
2525
from office365.sharepoint.fields.field_url import FieldUrl
2626
from office365.sharepoint.fields.field_user import FieldUser
27-
from office365.sharepoint.taxonomy.taxonomyField import TaxonomyField
27+
from office365.sharepoint.taxonomy.taxonomy_field import TaxonomyField
2828
field_known_types = {
2929
FieldType.Text: FieldText,
3030
FieldType.Calculated: FieldCalculated,

office365/sharepoint/sitepages/__init__.py

Whitespace-only changes.

office365/sharepoint/taxonomy/taxonomyService.py

Lines changed: 0 additions & 15 deletions
This file was deleted.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
from office365.runtime.client_runtime_context import ClientRuntimeContext
2+
from office365.runtime.odata.odata_request import ODataRequest
3+
from office365.runtime.odata.v4_json_format import V4JsonFormat
4+
from office365.runtime.resource_path import ResourcePath
5+
from office365.sharepoint.taxonomy.term_store import TermStore
6+
7+
8+
class TaxonomyService(ClientRuntimeContext):
9+
"""Wraps all of the associated TermStore objects for an Site object."""
10+
11+
def __init__(self, context):
12+
"""
13+
14+
:param ClientContext context:
15+
"""
16+
super().__init__(context)
17+
self._pendingRequest = ODataRequest(self, V4JsonFormat("minimal"))
18+
self._service_root_url = f"{context.service_root_url()}v2.1/"
19+
20+
def pending_request(self):
21+
return self._pendingRequest
22+
23+
def service_root_url(self):
24+
return self._service_root_url
25+
26+
@property
27+
def term_store(self):
28+
return TermStore(self, ResourcePath("termStore", None))

office365/sharepoint/taxonomy/term.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from office365.runtime.client_object import ClientObject
2+
3+
4+
class Term(ClientObject):
5+
pass

office365/sharepoint/taxonomy/termGroup.py

Lines changed: 0 additions & 6 deletions
This file was deleted.

office365/sharepoint/taxonomy/termGroupCollection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from office365.runtime.client_object_collection import ClientObjectCollection
2-
from office365.sharepoint.taxonomy.termGroup import TermGroup
2+
from office365.sharepoint.taxonomy.term_group import TermGroup
33

44

55
class TermGroupCollection(ClientObjectCollection):
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
from office365.runtime.client_object_collection import ClientObjectCollection
2+
from office365.sharepoint.taxonomy.term_set import TermSet
3+
4+
5+
class TermSetCollection(ClientObjectCollection):
6+
7+
def __init__(self, context, resource_path=None):
8+
super(TermSetCollection, self).__init__(context, TermSet, resource_path)

office365/sharepoint/taxonomy/termStore.py

Lines changed: 0 additions & 40 deletions
This file was deleted.

0 commit comments

Comments
 (0)