Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Breakpoints in expression / template code in Plone

Tags:

plone

If you have a situation where a TAL expression doesn't work (example below):

context.restrictedTraverse('@@contenthistory').fullHistory()[0]['comments']

What options there exist to debug this situation. Namely, can one put breakpoints to

  • TAL templates

  • TAL expression

  • Any expressions (e.g. portal_actions)

like image 596
Mikko Ohtamaa Avatar asked Aug 29 '26 23:08

Mikko Ohtamaa


1 Answers

If you are using Chameleon (you should!) you can use this:

<?python import pdb; pdb.set_trace() ?>

The stuff you normally look for is accessible in 'econtext':

econtext['context']
econtext['request']
like image 139
zupo Avatar answered Sep 03 '26 20:09

zupo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!