logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

Archetypes BaseContent.py,1.15,1.16 BaseObject.py,1.51,1.52: msg#00084

Subject: Archetypes BaseContent.py,1.15,1.16 BaseObject.py,1.51,1.52
Update of /cvsroot/archetypes/Archetypes
In directory sc8-pr-cvs1:/tmp/cvs-serv23938/Archetypes

Modified Files:
        BaseContent.py BaseObject.py 
Log Message:
More fixes for RichWidget

Index: BaseContent.py
===================================================================
RCS file: /cvsroot/archetypes/Archetypes/BaseContent.py,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- BaseContent.py      29 Sep 2003 14:27:27 -0000      1.15
+++ BaseContent.py      29 Sep 2003 17:32:16 -0000      1.16
@@ -118,12 +118,12 @@
     """ override BaseContent to have I18N title and description,
     plus I18N related actions
     """
-    
+
     schema = BaseContent.schema + I18NMixin.schema
-    
+
     def __init__(self, *args, **kwargs):
         BaseContent.__init__(self, *args, **kwargs)
         I18NMixin.__init__(self)
 
 InitializeClass(I18NBaseContent)
-    
+

Index: BaseObject.py
===================================================================
RCS file: /cvsroot/archetypes/Archetypes/BaseObject.py,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -d -r1.51 -r1.52
--- BaseObject.py       22 Sep 2003 16:44:36 -0000      1.51
+++ BaseObject.py       29 Sep 2003 17:32:17 -0000      1.52
@@ -354,7 +354,8 @@
         form_keys = form.keys()
 
         for field in fields:
-            if field.getName() in form_keys or "%s_file" % field.getName() in 
form_keys:
+            if field.getName() in form_keys or \
+                   "%s_file" % field.getName() in form_keys:
                 text_format = None
                 isFile = 0
                 value = None
@@ -364,8 +365,10 @@
                    field.allowable_content_types:
                     #was a mimetype specified
                     text_format = form.get("%s_text_format" % field.getName())
+
                 # or a file?
                 fileobj = form.get('%s_file' % field.getName())
+
                 if fileobj:
                     filename = getattr(fileobj, 'filename', '')
                     if filename != '':
@@ -377,12 +380,15 @@
 
                 #Set things by calling the mutator
                 if value is None: continue
-                mutator = getattr(self, field.mutator)
+                mutator = field.getMutator(self)
                 __traceback_info__ = (self, field, mutator)
                 kwargs = {}
 
                 if text_format and not isFile:
                     mutator(value, mimetype=text_format, **kwargs)
+                elif self.isBinary(field.getName()) and not isFile:
+                    # file field with content, no new content uploaded
+                    pass
                 else:
                     mutator(value, **kwargs)
 




-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf


<Prev in Thread] Current Thread [Next in Thread>