This seems to work

class EditForm(form.EditForm):
  form_fields = form.Fields(ISchema)

  def __init__(self, context, request):
    self.context, self.request = context, request

  @form.action('Edit')
  def handle_edit_action(self, action, data):
    if data['image'] != None:
      self.context.image = data['image']
    # continue adding values to context for other fields


Cheers,

Mats 
    

On Wed, 24 May 2006 22:46:37 +0100, Graham Stratton wrote
> I'm using formlib to create an edit form for a schema which contains 
> a bytes field (an image).  When the form is submitted, I don't want 
> the image to be removed if no new image is uploaded.  I can't see a 
> simple way to achieve this, but I'm hoping I'm missing something.
> 
> Many thanks,
> 
> Graham
> _______________________________________________
> Zope3-users mailing list
> Zope3-users@zope.org
> http://mail.zope.org/mailman/listinfo/zope3-users

_______________________________________________
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users

Reply via email to