Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F11876
diff.txt
Public
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
•
bzimport
Nov 22 2014, 2:09 AM
2014-11-22 02:09:58 (UTC+0)
Size
1 KB
Referenced Files
None
Subscribers
None
diff.txt
View Options
Index: wikipedia.py
===================================================================
--- wikipedia.py (Revision 11710)
+++ wikipedia.py (Arbeitskopie)
@@ -4281,7 +4281,15 @@
return response.code, response.msg, data
def editclaim(self, WDproperty, value, data_type=None, raw_value=False, refs=None,
- comment=None, token=None, sysop=False, botflag=True):
+ comment=None, token=None, sysop=False, botflag=True, force_add=False):
+ """Adds or edits a claim.
+
+ If the item has the given claim already, the value of the claim is changed. If not, the claim is added. References are always added.
+
+ @param WDproperty: the property to add
+ @param value: the value to add
+ @param force_add: do not change the existing value but add additional value
+ """
if isinstance(WDproperty, int):
propertyID = WDproperty
elif isinstance(WDproperty, basestring):
@@ -4334,7 +4342,7 @@
for claim in claims:
if claim['m'][1] == propertyID:
theclaim = claim
- if theclaim:
+ if theclaim and not force_add:
params = {
'action': 'wbsetclaimvalue',
'claim': theclaim['g'],
File Metadata
Details
Attached
Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
11334
Default Alt Text
diff.txt (1 KB)
Attached To
Mode
T56542: Add multiple values for a claim
Attached
Detach File
Event Timeline
Log In to Comment