[Zope] Formulator - TALES problem

Derek S. Wilson dwilson at vhswest.com
Tue Sep 30 11:54:50 EDT 2003


I don't know if this will help you or not, but here's what I had to do
to get my form controls working with the date...

<dtml-var "_.DateTime().mm()">/<dtml-var "_.DateTime().dd()">/<dtml-var
"_.DateTime().year()">

...of course you can swap around the mm/dd/year as appropriate.

Thanks,
Derek Wilson

-----Original Message-----
From: Andreas Tille [mailto:tillea at rki.de] 
Sent: Tuesday, September 30, 2003 8:23 AM
To: Zope user list
Subject: [Zope] Formulator - TALES problem

Hello,

I tried to set the End Datetime for an datetime Formulator object to
the current time.  I uses TALES and started with

     python: form.DateTime()

This failed with

     Error Type: AttributeError
     Error Value: DateTime

Now I created a Python script named 'jetzt' which just does

     return DateTime()  and alternatively I tried
     return str(DateTime())

moreover I tried several different formats.  The error.log of Test
method of the Formulator object was always like:

Traceback (innermost last):
  Module ZPublisher.Publish, line 98, in publish
  Module ZPublisher.mapply, line 88, in mapply
  Module ZPublisher.Publish, line 39, in call_object
  Module Shared.DC.Scripts.Bindings, line 252, in __call__
  Module Shared.DC.Scripts.Bindings, line 283, in _bindAndExec
  Module App.special_dtml, line 174, in _exec
  Module DocumentTemplate.DT_Util, line 201, in eval
   - __traceback_info__: render
  Module <string>, line 0, in ?
  Module Products.Formulator.Field, line 177, in render
  Module Products.Formulator.Field, line 155, in _render_helper
  Module Products.Formulator.Widget, line 671, in render
  Module Products.Formulator.Field, line 191, in render_sub_field
  Module Products.Formulator.Field, line 155, in _render_helper
  Module Products.Formulator.Widget, line 425, in render
  Module Products.Formulator.Widget, line 328, in render_items
  Module Products.Formulator.Field, line 106, in get_value
  Module Products.Formulator.MethodField, line 52, in __call__
  Module Products.Formulator.StandardFields, line 148, in
override_year_items
  Module Products.Formulator.Field, line 97, in get_value
  Module Products.Formulator.TALESField, line 43, in __call__
  Module Products.PageTemplates.TALES, line 217, in evaluate
   - Expression: <PythonExpr form.jetzt()>
   - Names:
      {'default': <Products.PageTemplates.TALES.Default instance at
0x86c0cd4>,
       'field': <DateTimeField instance at 9022ce0>,
       'form': <BoundMethod instance at 9585280>,
       'loop': <SafeMapping instance at 86e82e8>,
       'nothing': None,
       'repeat': <SafeMapping instance at 86e82e8>}
  Module Products.PageTemplates.ZRPythonExpr, line 48, in __call__
   - __traceback_info__: form.jetzt()
  Module Python expression "form.jetzt()", line 2, in f
AttributeError: jetzt


Any hint which kind of value I have to return as a valid TALES?

Kind regards

          Andreas.

_______________________________________________
Zope maillist  -  Zope at zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )



More information about the Zope mailing list