Skip to content

Commit

Permalink
First working mime widget hack.
Browse files Browse the repository at this point in the history
Fixed addFile.html, upload.html
TODO:
Fix tests, check Schema widget, make sure we canhandle the proxied 
object and don't replace the MimeData instance on contents if we 
use the Schema widget.
  • Loading branch information
projekt01 committed Jan 22, 2005
1 parent dbbc61d commit 4ee6529
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions browser/schemawidgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ def applyChanges(self, content):
print "applyChanges"
field = self.context
print "field = self.context ", self.context
print "content ", content

# create our new object value
value = field.query(content, None)
Expand All @@ -131,13 +132,29 @@ def applyChanges(self, content):
# apply sub changes, see if there *are* any changes
# TODO: ObjectModifiedEvent here would be nice
print "self ", self
print "isProxy(self) ", isProxy(self)
print "isProxy(value) ", isProxy(value)
print "isProxy(field) ", isProxy(field)
print "isProxy(content) ", isProxy(content)
print "self.names ", self.names
changes = applyWidgetsChanges(self, field.schema, target=value,
names=self.names)

# TODO: check this
# We have a Subobject allready set in the init method. Don't replace
# the subobject, just update it

# if there's changes, then store the new value on the content
if changes:
field.set(content, value)
#print "start if changes"
#if changes:
# print "field.set(content, value) "
# print " ... field ", field
# print " ... isProxy(field) ", isProxy(field)
# print " ... content ", content
# print " ... isProxy(content) ", isProxy(content)
# print " ... value ", value
# print " ... isProxy(value) ", isProxy(value)
# field.set(content, value)

return changes

Expand Down

0 comments on commit 4ee6529

Please sign in to comment.