[SOLVED]Custom and syntax problem in ZPT ?

5 Messages Forum Options Options
Permalink
tcr
[SOLVED]Custom and syntax problem in ZPT ?
Reply Threaded More
Print post
Permalink
(This post was updated on )
[EDIT] > solved : look my last post...

Hi all,

I have created a zpt to display only  the 15 lastest PloneArticles published but only into a specific folder.

Let's say :
In zmi plone site is named : 'plone-site'
Target folder is  : 'target-folder'

Well in catalog request when I put the path (hardcoded) that's works fine

<body tal:define="chemin_dossier string:$(container/id)/info-du-jour;
                  results python:request.get('articles',
                   here.portal_catalog.searchResults(path='plone-site/target-folder',
                                                     portal_type='PloneArticle',
                                                     review_state='published',
                                                     sort_on='Date',
                                                     sort_order='reverse')[:15]);">

bu when I put a tal variable...

<body tal:define="chemin_dossier string:$(container/id)/info-du-jour;
                  results python:request.get('articles',
                   here.portal_catalog.searchResults(path=chemin_dossier,
                                                     portal_type='PloneArticle',
                                                     review_state='published',
                                                     sort_on='Date',
                                                     sort_order='reverse')[:15]);">

I get error :

  Module Products.ZCatalog.ZCatalog, line 690, in searchResults
  Module Products.ZCatalog.Catalog, line 733, in searchResults
  Module Products.ZCatalog.Catalog, line 476, in search
  Module Products.ExtendedPathIndex.ExtendedPathIndex, line 375, in _apply_index
  Module Products.ExtendedPathIndex.ExtendedPathIndex, line 217, in search
ValueError: invalid literal for int(): n


I suspect a syntax error... I'm right? (how pass tal variable into python request in ZPT?)

or why I get this error and how correct it

Thank you,

Thierry,
Andreas Jung-5
Re: Custom and syntax problem in ZPT ?
Reply Threaded More
Print post
Permalink


--On 3. Juli 2008 03:44:27 -0700 tcr <t.ceretto@...> wrote:

>
ts.ExtendedPathIndex.ExtendedPathIndex, line 375, in
> _apply_index
>   Module Products.ExtendedPathIndex.ExtendedPathIndex, line 217, in search
> ValueError: invalid literal for int(): n
>

> or why I get this error and how correct it
>


You take the debugger and figure out what 'n' is (the traceback above tells
you where to debug).

-aj

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Plone-Users mailing list
Plone-Users@...
https://lists.sourceforge.net/lists/listinfo/plone-users

attachment0 (201 bytes) Download Attachment
tcr
Re: Custom and syntax problem in ZPT ?
Reply Threaded More
Print post
Permalink
Yes, but I don't know what is this 'n', on my ZPT I don't have this 'n' (text or variable or integer)

Thanks

Andreas Jung-5 wrote:

--On 3. Juli 2008 03:44:27 -0700 tcr <t.ceretto@chu-nancy.fr> wrote:

>
ts.ExtendedPathIndex.ExtendedPathIndex, line 375, in
> _apply_index
>   Module Products.ExtendedPathIndex.ExtendedPathIndex, line 217, in search
> ValueError: invalid literal for int(): n
>

> or why I get this error and how correct it
>


You take the debugger and figure out what 'n' is (the traceback above tells
you where to debug).

-aj
 
-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Plone-Users mailing list
Plone-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plone-users
Andreas Jung-5
Re: Custom and syntax problem in ZPT ?
Reply Threaded More
Print post
Permalink
You have to learn to read tracebacks. It tells you that the error
occurs in line 217 of ExtendPathIndex.py. So you'll likely find offending
"int(n)" statement there. Take the debugger and figure out the value of 'n'.
This gives you an indication about your problem..please don't complain that
you can not deal with the debugger..that's a good exercise :-)

Andreas

--On 3. Juli 2008 04:02:04 -0700 tcr <t.ceretto@...> wrote:

>
> Yes, but I don't know what is this 'n', on my ZPT I don't have this 'n'
> (text or variable or integer)
>
>
> Andreas Jung-5 wrote:
>>
>>
>>
>> --On 3. Juli 2008 03:44:27 -0700 tcr <t.ceretto@...> wrote:
>>
>>>
>> ts.ExtendedPathIndex.ExtendedPathIndex, line 375, in
>>> _apply_index
>>>   Module Products.ExtendedPathIndex.ExtendedPathIndex, line 217, in
>>> search
>>> ValueError: invalid literal for int(): n
>>>
>>
>>> or why I get this error and how correct it
>>>
>>
>>
>> You take the debugger and figure out what 'n' is (the traceback above
>> tells
>> you where to debug).
>>
>> -aj
>>
>> -------------------------------------------------------------------------
>> Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
>> Studies have shown that voting for your favorite open source project,
>> along with a healthy diet, reduces your potential for chronic lameness
>> and boredom. Vote Now at http://www.sourceforge.net/community/cca08
>> _______________________________________________
>> Plone-Users mailing list
>> Plone-Users@...
>> https://lists.sourceforge.net/lists/listinfo/plone-users
>>
>>
>
> --
> View this message in context:
> http://www.nabble.com/Custom-and-syntax-problem-in-ZPT---tp18256535s6742p
> 18256795.html Sent from the General Questions mailing list archive at
> Nabble.com.
>
>
> -------------------------------------------------------------------------
> Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
> Studies have shown that voting for your favorite open source project,
> along with a healthy diet, reduces your potential for chronic lameness
> and boredom. Vote Now at http://www.sourceforge.net/community/cca08
> _______________________________________________
> Plone-Users mailing list
> Plone-Users@...
> https://lists.sourceforge.net/lists/listinfo/plone-users


--
ZOPYX Ltd. & Co. KG - Charlottenstr. 37/1 - 72070 Tübingen - Germany
Web: www.zopyx.com - Email: info@... - Phone +49 - 7071 - 793376
Registergericht: Amtsgericht Stuttgart, Handelsregister A 381535
Geschäftsführer/Gesellschafter: ZOPYX Limited, Birmingham, UK
------------------------------------------------------------------------
E-Publishing, Python, Zope & Plone development, Consulting


-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Plone-Users mailing list
Plone-Users@...
https://lists.sourceforge.net/lists/listinfo/plone-users

attachment0 (201 bytes) Download Attachment
tcr
Re: solved > Custom and syntax problem in ZPT ?
Reply Threaded More
Print post
Permalink
I found the problem!

In fact on my ZPT I had a JS code between <script> tag, in comments of this code there is this special caracter © (copyright) and, I don't know why, it's this caracter that causes an error when tal TAL variable is use.

I have removed this special caracter and that's work!

But to make a good job, I have put the JS code in js library and I have declared in the portal JS registry.

Precision :  The special caracter in comments of JS code (library) don't occur error ...

Regards

Andreas Jung-5 wrote:
You have to learn to read tracebacks. It tells you that the error
occurs in line 217 of ExtendPathIndex.py. So you'll likely find offending
"int(n)" statement there. Take the debugger and figure out the value of 'n'.
This gives you an indication about your problem..please don't complain that
you can not deal with the debugger..that's a good exercise :-)

Andreas

--On 3. Juli 2008 04:02:04 -0700 tcr <t.ceretto@chu-nancy.fr> wrote:

>
> Yes, but I don't know what is this 'n', on my ZPT I don't have this 'n'
> (text or variable or integer)
>
>
> Andreas Jung-5 wrote:
>>
>>
>>
>> --On 3. Juli 2008 03:44:27 -0700 tcr <t.ceretto@chu-nancy.fr> wrote:
>>
>>>
>> ts.ExtendedPathIndex.ExtendedPathIndex, line 375, in
>>> _apply_index
>>>   Module Products.ExtendedPathIndex.ExtendedPathIndex, line 217, in
>>> search
>>> ValueError: invalid literal for int(): n
>>>
>>
>>> or why I get this error and how correct it
>>>
>>
>>
>> You take the debugger and figure out what 'n' is (the traceback above
>> tells
>> you where to debug).
>>
>> -aj
>>
>> -------------------------------------------------------------------------
>> Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
>> Studies have shown that voting for your favorite open source project,
>> along with a healthy diet, reduces your potential for chronic lameness
>> and boredom. Vote Now at http://www.sourceforge.net/community/cca08
>> _______________________________________________
>> Plone-Users mailing list
>> Plone-Users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/plone-users
>>
>>
>
> --
> View this message in context:
> http://www.nabble.com/Custom-and-syntax-problem-in-ZPT---tp18256535s6742p
> 18256795.html Sent from the General Questions mailing list archive at
> Nabble.com.
>
>
> -------------------------------------------------------------------------
> Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
> Studies have shown that voting for your favorite open source project,
> along with a healthy diet, reduces your potential for chronic lameness
> and boredom. Vote Now at http://www.sourceforge.net/community/cca08
> _______________________________________________
> Plone-Users mailing list
> Plone-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/plone-users



--
ZOPYX Ltd. & Co. KG - Charlottenstr. 37/1 - 72070 Tübingen - Germany
Web: www.zopyx.com - Email: info@zopyx.com - Phone +49 - 7071 - 793376
Registergericht: Amtsgericht Stuttgart, Handelsregister A 381535
Geschäftsführer/Gesellschafter: ZOPYX Limited, Birmingham, UK
------------------------------------------------------------------------
E-Publishing, Python, Zope & Plone development, Consulting

 
-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Plone-Users mailing list
Plone-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plone-users