Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add parameter to select list view. #5 #31

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion sharepoint/lists/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def moderation(self):
self._moderation = moderation.Moderation(self)
return self._moderation

def get_rows(self, folder=''):
def get_rows(self, folder='', view=''):
rows = []
attribs = collections.defaultdict(dict)
field_groups, lookup_count = [[]], 0
Expand All @@ -166,7 +166,9 @@ def get_rows(self, folder=''):
view_fields = E.ViewFields(*(E.FieldRef(Name=field.name) for field in field_group))
#query_options = E.QueryOptions(E.ViewAttributes(Scope="Recursive"))
query_options = E.QueryOptions(E.Folder(folder))
# Uses parameters from https://msdn.microsoft.com/en-us/library/lists.lists.getlistitems(v=office.12).aspx
xml = SP.GetListItems(SP.listName(self.id),
SP.viewName(view),
SP.rowLimit("100000"),
SP.viewFields(view_fields),
SP.queryOptions(query_options))
Expand Down
2 changes: 1 addition & 1 deletion sharepoint/lists/attachments.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def add(self, filename, content):
raise NotImplementedError

def open(self, url):
return self.opener.open(url)
return self.opener.open(url.replace(' ', '%20'))

class SharePointAttachment(object):
def __init__(self, attachments, url):
Expand Down