Use Z SQL methon in projects
Dear list, I'm quite new to zope and I have to develop a Newsletter system as a project for my university. All works pretty good so far, I'm using ZPT with embedded Z SQL methods to create my page dynamically....the code looks like this: ... <b>Newsletters</b><br> <table cellpadding="5" cellspacing="0" border="1" width="250"> <tr tal:repeat="newsletters here/getNewsletters"> <td align="left"><font size="2"> <input type="checkbox" name="newsletter" tal:attributes="value newsletters/id"> <p tal:replace="newsletters/newsletter_name">NewsletterName</p> </td> </tr> </table> ... I did all the things so far inside the Zope ZMI to see how things work together, but now I'd like to create a "real" project and I already got most of the things working, like calling the page templates from within python. The problem I have now is that I don't know how to manage to export my Z SQL method getNewsletters to my product folder and register it to Zope from within python when my product gets installed, so that the template can call this method like before...I don't want the users of my product to manually create this Z SQL method when they install the newsletter system. Is it possible at all or do I have to start all over again? any help would be appreciated thanks a lot reet
R33t wrote:
I'm quite new to zope and I have to develop a Newsletter system as a project for my university.
Then head over to zope@Zope.org, this list is for development OF, not WITH Zope...
All works pretty good so far, I'm using ZPT with embedded Z SQL methods to create my page dynamically....the code looks like this:
Learn to use ZODB, it rocks ;-)
I did all the things so far inside the Zope ZMI to see how things work together, but now I'd like to create a "real" project and I already got most of the things working, like calling the page templates from within python.
An app like yours probabyl doesn't need a file system product. A collection of ZSQl methods, Python Scripts and ZPT in a folder should do just fine :-)
The problem I have now is that I don't know how to manage to export my Z SQL method getNewsletters to my product folder and register it to Zope from within python when my product gets installed,
CMF has FSZSQLMethods for this, Idon't think you really want to go there... cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk
Hi R33t, On Sat, 2004-03-27 at 14:35, R33t wrote:
[...] The problem I have now is that I don't know how to manage to export my Z SQL method getNewsletters to my product folder and register it to Zope from within python when my product gets installed, so that the template can call this method like before...I don't want the users of my product to manually create this Z SQL method when they install the newsletter system. Is it possible at all or do I have to start all over again?
I don't know about exporting your ZSQLMethods for the filesystem. As for importing them, take a look at the SQL authentication and property sources for exUserFolder. They populate folderlike objects with ZSQLMethods upon initialization. http://sf.net/projects/exuserfolder Cheers, Leo -- Ideas don't stay in some minds very long because they don't like solitary confinement.
R33t wrote at 2004-3-27 17:35 +0000:
... I did all the things so far inside the Zope ZMI to see how things work together, but now I'd like to create a "real" project and I already got most of the things working, like calling the page templates from within python. The problem I have now is that I don't know how to manage to export my Z SQL method getNewsletters to my product folder and register it to Zope from within python when my product gets installed, so that the template can call this method like before
Create your Z SQL Methods as class attributes in your product class. You can then access them like all other attributes of your instances. You are not able to use the standard "manage_addZSQLMEthod". Use instead: from Products.ZSQLMethods.SQL import SQL class MyClass(...): ... mySQLMethod = SQL(id, title, connection_id, arguments, template) -- Dieter
participants (4)
-
Chris Withers -
Dieter Maurer -
Leonardo Rochael Almeida -
R33t