Philipp von Weitershausen wrote:
I presume, this is what you want:

  class Recipe(Persistent):

    def __init__(self):
        self.creation_date = datetime.datetime.now()
Thanks for the reply.

That's the idea, but it works only if I don't add creation_field to the add view:

   <addform
       label="Add Foo"
       name="AddFoo.html"
       schema="sandbox.interfaces.IFoo"
       content_factory="sandbox.foo.Foo"
       fields="title"
       permission="zope.ManageContent"
       />


When fields="title", the creation_date attribute is set upon creation and available for later editing.

When fields="title creation_date", the creation date is proposed as empty in the add form. I'd like it to be already set when the add form is called.


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

Reply via email to