[zope] [Zope] using capitalize in dtml-var in sqlmethods

Phil Harris phil.harris@zope.co.uk
Fri, 06 Jun 2003 16:36:10 +0100


sqlvar automatically puts quotes around the thing it renders, var doesn't 
you have to wrap that yourself.

On Fri, 06 Jun 2003 17:00:54 +0200, Marie Robichon <robichon@esrf.fr> 
wrote:

> Hi everyone,
>
> I would like to capitalize an entry of a form before it goes into my db 
> thus:
>
> INSERT INTO blengprojects (responsible, beamline, project_title, 
> project_description, status,installdate_month, 
> installdate_year,installdate, updated) values
> (<dtml-sqlvar responsible type="string">,
> <dtml-sqlvar beamline type="string">,
> <dtml-var project_title capitalize>,
> <dtml-var project_description capitalize>,
> <dtml-sqlvar status type="string" optional>
> <dtml-sqlvar status_other type="string" optional>,
> <dtml-sqlvar installdate_month type="int" optional>,
> <dtml-sqlvar installdate_year type="int" optional>,
> <dtml-if installdate_month>
> '<dtml-sqlvar installdate_year type="int" optional>/<dtml-sqlvar 
> installdate_month type="int" optional>/01',
> <dtml-else>null,
> </dtml-if>
> <dtml-sqlvar updated type="string">
> )
>
> why does this give me  the following????
>
> Error, _mysql_exceptions.OperationalError: (1054, "Unknown column 'Upper' 
> in 'field list'")
>
> SQL used:
> INSERT INTO blengprojects (responsible, beamline, project_title, 
> project_description, status,installdate_month, 
> installdate_year,installdate, updated) values
> ('robichon',
> 'id44',
> Upper,
> Upper,
> ''
> '',
> null,
> null,
> null,
> '2003/05/01'
> )
>
> TIA
>
>
>
> Marie Robichon
>
> Web Task Force
> European Synchrotron Radiation Facility
> BP 220
> 38043 Grenoble Cedex
> France
>
> http://www.esrf.fr
>
> Tel: (33) 04 76 88 21 86
> Fax: (33) 04 76 88 24 27
>
>
> _______________________________________________
> Zope maillist  -  Zope@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 )
>
>



-- 
Phil Harris