-
-
Notifications
You must be signed in to change notification settings - Fork 345
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#861: fix FieldCollection.add method for choice field type
- Loading branch information
Showing
4 changed files
with
23 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
""" | ||
Demonstrates how to create lookup field | ||
""" | ||
from office365.sharepoint.client_context import ClientContext | ||
from tests import create_unique_name, test_client_credentials, test_team_site_url | ||
|
||
client = ClientContext(test_team_site_url).with_credentials(test_client_credentials) | ||
lib = client.web.default_document_library() | ||
|
||
field_name = create_unique_name("ChoiceField") | ||
|
||
choices = ["Not Started", "In Progress", "Completed", "Deferred"] | ||
field = lib.fields.add_choice_field(title=field_name, values=choices).execute_query() | ||
|
||
field.delete_object().execute_query() # clean up |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
from office365.sharepoint.fields.field import Field | ||
from office365.sharepoint.fields.multi_choice import FieldMultiChoice | ||
|
||
|
||
class FieldChoice(Field): | ||
class FieldChoice(FieldMultiChoice): | ||
"""Represents a choice field control.""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters