• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 38. Developing New TALES Express... > Step 1: Implementing the SQL Express...

Step 1: Implementing the SQL Expression

The SQL expression is almost identical to the string expression, except that instead of returning a string from the __call__() method, you evaluate the computed string as a SQL statement and return the result. This means that you can safely use the StringExpr class as a base for your expression.

All the other code samples for this book are located in the book package, whereas the SQL expression became so popular that it was added to the Zope trunk (although it is not distributed with Zope X3.0). Therefore, you need to create a package called sqlexpr in zope.app. Inside it, you need to create a module called sqlexpr.py and add the following code to it:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint