File tree Expand file tree Collapse file tree 2 files changed +18
-3
lines changed
Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change 6969- fixed export/import of retired nodes (sf bug 685273)
7070- remember the display template specified during edit (sf bug 701815)
7171- added example HTML tempating for vacation flag (sf bug 701722)
72+ - only look for CSV files when importing (thanks Dan Grassi)
73+ - can now unset values in CSV editing (sf bug 704788)
7274
7375
74762003-??-?? 0.5.7
Original file line number Diff line number Diff line change 1- # $Id: client.py,v 1.107 2003-03-18 00:24:35 richard Exp $
1+ # $Id: client.py,v 1.108 2003-03-19 02:50:40 richard Exp $
22
33__doc__ = """
44WWW request handler (also used in the stand-alone server).
@@ -1213,6 +1213,12 @@ def editCSVAction(self):
12131213 nodeid , values = values [0 ], values [1 :]
12141214 found [nodeid ] = 1
12151215
1216+ # see if the node exists
1217+ if cl .hasnode (nodeid ):
1218+ exists = 1
1219+ else :
1220+ exists = 0
1221+
12161222 # confirm correct weight
12171223 if len (idlessprops ) != len (values ):
12181224 self .error_message .append (
@@ -1222,16 +1228,23 @@ def editCSVAction(self):
12221228 # extract the new values
12231229 d = {}
12241230 for name , value in zip (idlessprops , values ):
1231+ prop = cl .properties [name ]
12251232 value = value .strip ()
12261233 # only add the property if it has a value
12271234 if value :
12281235 # if it's a multilink, split it
1229- if isinstance (cl . properties [ name ] , hyperdb .Multilink ):
1236+ if isinstance (prop , hyperdb .Multilink ):
12301237 value = value .split (':' )
12311238 d [name ] = value
1239+ elif exists :
1240+ # nuke the existing value
1241+ if isinstance (prop , hyperdb .Multilink ):
1242+ d [name ] = []
1243+ else :
1244+ d [name ] = None
12321245
12331246 # perform the edit
1234- if cl . hasnode ( nodeid ) :
1247+ if exists :
12351248 # edit existing
12361249 cl .set (nodeid , ** d )
12371250 else :
You can’t perform that action at this time.
0 commit comments