Пример #1
0
 def add_item(self, list_item_creation_information):
     """The recommended way to add a list item is to send a POST request to the ListItemCollection resource endpoint,
      as shown in ListItemCollection request examples."""
     item = ListItem(self.context, None, list_item_creation_information)
     qry = ClientQuery(self.url + "/items", ActionType.CreateEntry, item.convert_to_payload())
     self.context.add_query(qry, item)
     return item
Пример #2
0
 def add_item(self, list_item_creation_information):
     """The recommended way to add a list item is to send a POST request to the ListItemCollection resource endpoint,
      as shown in ListItemCollection request examples."""
     item = ListItem(self.context, None, list_item_creation_information)
     item._parent_collection = self
     qry = ClientQuery(self.resourceUrl + "/items", HttpMethod.Post, item)
     self.context.add_query(qry, item)
     return item
Пример #3
0
 def add_item(self, list_item_creation_information):
     """The recommended way to add a list item is to send a POST request to the ListItemCollection resource endpoint,
      as shown in ListItemCollection request examples.
      :type list_item_creation_information: ListItemCreationInformation"""
     item = ListItem(self.context, None, list_item_creation_information)
     self.items.add_child(item)
     item.ensure_type_name(self)
     qry = ServiceOperationQuery(self, "items", None, item, None, item)
     self.context.add_query(qry)
     return item
 def listItemAllFields(self):
     """Gets a value that specifies the list item field values for the list item corresponding to the file."""
     if self.is_property_available('ListItemAllFields'):
         return self.properties['ListItemAllFields']
     else:
         return ListItem(
             self.context,
             ResourcePath("listItemAllFields", self.resourcePath))
 def list_item_all_fields(self):
     """Specifies the list item field (2) values for the list item corresponding to the folder."""
     if self.is_property_available('ListItemAllFields'):
         return self.properties["ListItemAllFields"]
     else:
         return ListItem(
             self.context,
             ResourcePath("ListItemAllFields", self.resource_path))
Пример #6
0
 def get_item_by_id(self, item_id):
     """Returns the list item with the specified list item identifier.
     :type item_id: int
     """
     return ListItem(
         self.context,
         ResourcePathServiceOperation("getItemById", [item_id],
                                      self.resourcePath))
 def add_item(self, list_item_creation_information):
     """The recommended way to add a list item is to send a POST request to the ListItemCollection resource endpoint,
      as shown in ListItemCollection request examples."""
     item = ListItem(self.context, None, list_item_creation_information)
     if self._items is None:
         self._items = ListItemCollection(
             self.context, ResourcePath("items", self.resourcePath))
     self._items.add_child(item)
     qry = ServiceOperationQuery(self, "items", None, item, None, item)
     self.context.add_query(qry)
     return item
Пример #8
0
 def get_list_item(self, list_name, item_id):
     return ListItem(
         self, ResourcePathServiceOperation(self, None, list_name,
                                            [item_id]))
Пример #9
0
 def get_item_by_id(self, item_id):
     """Returns the list item with the specified list item identifier."""
     return ListItem(
         self.context,
         ResourcePathServiceOperation(self.context, self.resource_path,
                                      "getitembyid", [item_id]))
Пример #10
0
 def get_item_by_id(self, item_id):
     """Returns the list item with the specified list item identifier."""
     list_item = ListItem(self.context,
                          ClientQuery.service_operation_query(self, ActionType.GetMethod, "getitembyid", [item_id]))
     return list_item