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

Fix #10 when comparing 'string' field types. #29

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
14 changes: 8 additions & 6 deletions sharepoint/lists/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,10 @@ def as_xml(self, row, value, **kwargs):
else:
field_element.append(self._as_xml(row, value, **kwargs))
return field_element

def _as_xml(self, row, value, **kwargs):
return OUT('text', unicode(value))

def __repr__(self):
return u"<%s '%s'>" % (type(self).__name__, self.name)

Expand Down Expand Up @@ -363,7 +363,7 @@ def _parse(self, value):
return {'id': int(value[0]), 'name': value[1]}
def _unparse(self, value):
return [unicode(value['id']), value.get('name', '')]

def descriptor_set(self, row, value):
if value is None:
return None
Expand All @@ -385,8 +385,10 @@ class UserMultiField(UserField):
class CalculatedField(Field):
group_multi = 2
immutable = True

types = {'float': float}

types = {'float': float,
'string': str,
'error': str}
type_names = {float: 'float',
str: 'text',
int: 'int'}
Expand All @@ -405,7 +407,7 @@ def _as_xml(self, row, value, **kwargs):
class ModerationStatusField(Field):
group_multi = 2
immutable = True

def _parse(self, value):
return moderation.moderation_statuses[int(value[0])]
def _unparse(self, value):
Expand Down