Re: [Zope3-Users] Re: A gentle push in the right direction needed
On Thursday 20 July 2006 00:01, Philipp von Weitershausen wrote: > Tim Penhey wrote: > > postal_address = InterfaceField( > > title=u"Postal Address" > > ) > > Use zope.schema.Object here: > > postal_address = Object( > title=u"...", > schema=IAddress > ) Ah, this is the bit I was missing. Thanks Philipp. > You can then have the this subobject's widget rendered as a subform by > the ObjectWidget. You'll have to give ObjectWidget a constructor that it > will call in case it has to create an IAddress object. Definitely something I'll be looking to do when I get to that part of the code. > > Now it is with the postal_address I hit my first snag. I really want to > > say that it is an IAddress. Am I using InterfaceField correctly here? > > Is there an option to specify the type of the interface? > > > > Also how do I specify a list of addresses? > > addresses = List( > title=u"...", > value_type=Object(schema=IAdress), > ) Simple again (once you know :-) ). Thanks, Tim ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] A gentle push in the right direction needed
On Wednesday 19 July 2006 22:03, Darryl Cousins wrote: > Hi Tim, > > My solution was to use an address container to act as the > 'addressbook'. An adapter is used to attach (using annotations) the > addressbook to any object which implements IHaveAddressInfo. An interesting idea. > Doctest: http://www.tfws.org.nz/tfws.portal.address.README.html > Code: > http://projects.treefernwebservices.co.nz/tfws.org.nz/browser/trunk/src/tfw >s/portal/address/ Thanks for the reference. Reading real life code really helps understand sometimes. Cheers, Tim ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Re: testing setup
Hi Luis, You need to run functional tests using the zope testing environment which is set up for you when the tests are run with $instance/bin/test Functional tests are defined in python file ftests.py or package ftests/ which you will create in your package. For example: ftests.py:: import unittest from zope.testing import doctest from zope.app.testing.functional import FunctionalDocFileSuite def test_suite(): return unittest.TestSuite(( FunctionalDocFileSuite( "README.txt", optionflags=doctest.ELLIPSIS | doctest.NORMALIZE_WHITESPACE), )) if __name__ == '__main__': unittest.main(defaultTest='test_suite') And then README.txt:: >>> from zope.testbrowser.testing import Browser >>> browser = Browser(’http://localhost’) >>> browser.url ’http://localhost’ >>> browser.contents ’...Z3: ...’ Have a look at: http://zope-cookbook.org/cookbook/recipe07#x1-6000 And http://www.zope.org/Wikis/DevSite/Projects/ComponentArchitecture/Zope3Book/ftests.html#x1-800043.3 And have a read of zope/testbrowser/README.txt There are other examples of tests in the source. Good luck. Regards, Darryl luis wrote: ... > ### > from zope.testbrowser.testing import Browser > > browser = Browser('http://localhost') > ### > > just to see if I can open a connection to the "test server"... but if > I try > to run that code, I get this error message: ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Re: A gentle push in the right direction needed
Tim Penhey wrote: > postal_address = InterfaceField( > title=u"Postal Address" > ) Use zope.schema.Object here: postal_address = Object( title=u"...", schema=IAddress ) You can then have the this subobject's widget rendered as a subform by the ObjectWidget. You'll have to give ObjectWidget a constructor that it will call in case it has to create an IAddress object. > Now it is with the postal_address I hit my first snag. I really want to say > that it is an IAddress. Am I using InterfaceField correctly here? Is there > an option to specify the type of the interface? > > Also how do I specify a list of addresses? addresses = List( title=u"...", value_type=Object(schema=IAdress), ) Philipp ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Re: testing setup
Hi all, thanks for the info... but I guess I'm still missing some configuration to be able to run the tests... I just created a file "t.py" in my home directory with the following contents: ### from zope.testbrowser.testing import Browser browser = Browser('http://localhost') ### just to see if I can open a connection to the "test server"... but if I try to run that code, I get this error message: - Traceback (most recent call last): [some lines skipped] factory = factoryRegistry.lookup(method, content_type, environment) File "/home/luis/src/Z/Zope3/src/zope/app/publication/requestpublicationregistry.py", line 97, in lookup raise ConfigurationError('No registered publisher found ' zope.configuration.exceptions.ConfigurationError: No registered publisher found for (GET/) -- any ideas? regards. luis Baiju M wrote: > On 7/19/06, luis <[EMAIL PROTECTED]> wrote: >> >> hello, >> >> I'm having problems trying to write some tests for my code so... >> can someone tell me (or point me to) how to setup the "infrastructure" >> required for running unit -and specially- functional tests? > > These recipes may be usefull: > > http://www.zope-cookbook.org/cookbook/recipe06 > http://www.zope-cookbook.org/cookbook/recipe07 > > Regards, > Baiju M ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] A gentle push in the right direction needed
Hi Tim, My solution was to use an address container to act as the 'addressbook'. An adapter is used to attach (using annotations) the addressbook to any object which implements IHaveAddressInfo. Doctest: http://www.tfws.org.nz/tfws.portal.address.README.html Code: http://projects.treefernwebservices.co.nz/tfws.org.nz/browser/trunk/src/tfws/portal/address/ On Wed, 2006-07-19 at 21:22 +0100, Tim Penhey wrote: ... > Now it is with the postal_address I hit my first snag. I really want > to say > that it is an IAddress. Am I using InterfaceField correctly here? Is > there > an option to specify the type of the interface? > > Also how do I specify a list of addresses? > > Thanks. > Tim ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Generations and sql
I use the Zope 2 generations machinery to manage SQL DDL for Postgres. It works pretty good. - C On Jul 19, 2006, at 2:48 PM, David Pratt wrote: I am interested in hearing from anyone who may be using generations in conjunction with relational database storages in zope3 as a means of maintaining their schemas. Does anyone have any experience with this to indicate how well this works for rdb's. Many thanks. Regards, David ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Formlib and invariants
Hi Florian, Yup. Thanks for that, much more elegant and passing in an error string displays nicely with error_views. Cheers, Darryl On Wed, 2006-07-19 at 22:18 +0200, Florian Lindner wrote: > Am Mittwoch, 19. Juli 2006 03:25 schrieb Darryl Cousins: > > Hi All, > > > > I've had a bit of a struggle getting formlib error views to play nicely > > with invariants. That is the problem I have found to trouble me is in > > the zope.formlib.form.FormBase method error_views. > > > > When I use the schema: > > > > class IMemberRegisterForm(IMemberData, IMemberDetails): > > """Schema for a member register form.""" > > > > new_password = Password( > > title=_("Choose a Password"), > > required=True) > > > > verify_password = Password( > > title=_("Verify Password"), > > required=True) > > > > @invariant > > def passwordsMatch(register): > > if register.new_password != register.verify_password: > > msg = _("Entered passwords do not match") > > error = ('verify_password', _("Passwords"), msg) > > raise Invalid(error) > > [...] > > I am not sure if I've understood you correctly, but I've solved the same > problem (raise error if passwords are not equal) this way: > > > class PasswordsAreNotEqual(ValidationError): > """The passwords are not equal.""" > interface.implements(IWidgetInputError) > > class IRegistrationForm(interface.Interface): > """For entering the data for registration.""" > > password = Password(title=u"Password", > description=u"Your password.", > required=True) > > password2 = Password(title=u"Verify Password", > required=True) > > @interface.invariant > def arePasswordsEqual(obj): > if obj.password != obj.password2: > raise PasswordsAreNotEqual > > > Hope this helps, > > Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Formlib and invariants
Am Mittwoch, 19. Juli 2006 03:25 schrieb Darryl Cousins: > Hi All, > > I've had a bit of a struggle getting formlib error views to play nicely > with invariants. That is the problem I have found to trouble me is in > the zope.formlib.form.FormBase method error_views. > > When I use the schema: > > class IMemberRegisterForm(IMemberData, IMemberDetails): > """Schema for a member register form.""" > > new_password = Password( > title=_("Choose a Password"), > required=True) > > verify_password = Password( > title=_("Verify Password"), > required=True) > > @invariant > def passwordsMatch(register): > if register.new_password != register.verify_password: > msg = _("Entered passwords do not match") > error = ('verify_password', _("Passwords"), msg) > raise Invalid(error) [...] I am not sure if I've understood you correctly, but I've solved the same problem (raise error if passwords are not equal) this way: class PasswordsAreNotEqual(ValidationError): """The passwords are not equal.""" interface.implements(IWidgetInputError) class IRegistrationForm(interface.Interface): """For entering the data for registration.""" password = Password(title=u"Password", description=u"Your password.", required=True) password2 = Password(title=u"Verify Password", required=True) @interface.invariant def arePasswordsEqual(obj): if obj.password != obj.password2: raise PasswordsAreNotEqual Hope this helps, Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] A gentle push in the right direction needed
Hi all, I have an application that is written with Struts (Java servlet and JSP) with a postgresql database which I am attempting to rewrite with zope 3. Having read over half of "Web Component Development with Zope 3" I thought it was high time to get started. However I seem to have hit my first snag. In the java app I have a customer class which has a postal address, and a list of delivery addresses. So I started with: from zope.interface import Interface from zope.schema import TextLine class IAddress(Interface): """Address details""" line1 = TextLine( title=u"Line 1", description=u"The first line of the address", required=True ) line2 = TextLine( title=u"Line 2", description=u"The second line of the address", required=False ) city = TextLine( title=u"City", description=u"The city", required=False ) county = TextLine( title=u"County", description=u"County for the address", required=False ) postcode = TextLine( title=u"Postcode", description=u"Postcode of the address", required=False ) Then... from zope.interface import Interface from zope.schema import Bool, Float, Text, TextLine, Int, InterfaceField class ICustomer(Interface): """Information about our customers""" id = Int( title=u"ID", description=u"The customer's unique id", required=True, min=1 ) name = TextLine( title=u"Name", description=u"The name of the customer", required=True ) postal_address = InterfaceField( title=u"Postal Address" ) Now it is with the postal_address I hit my first snag. I really want to say that it is an IAddress. Am I using InterfaceField correctly here? Is there an option to specify the type of the interface? Also how do I specify a list of addresses? Thanks. Tim ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Generations and sql
I am interested in hearing from anyone who may be using generations in conjunction with relational database storages in zope3 as a means of maintaining their schemas. Does anyone have any experience with this to indicate how well this works for rdb's. Many thanks. Regards, David ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Security alert: use of Through-the-Web reStructuredText
On Jul 19, 2006, at 8:47 AM, Benji York wrote: David Pratt wrote: What about the idea of maintaining a text file in the distribution specific to possible security issues. Is this worth considering for historical purposes so they do not get lost over time or implicitly understood by only a handful of people. Exactly. Any package that needs security-related things verified should have a test (doctest in a text file) describing the problem and verifying that it has been fixed. Of course, that, by itself, doesn't solve the problem. docutils may introduce a new feature in the furture that shouldn't be exposed through the web. Whenever we integrate a new version, we need to review it to make sure there aren't new security issues. This is especially true of anything that is exposed TTW. Jim -- Jim Fulton mailto:[EMAIL PROTECTED]Python Powered! CTO (540) 361-1714 http://www.python.org Zope Corporationhttp://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Security alert: use of Through-the-Web reStructuredText
On Jul 19, 2006, at 8:35 AM, David Pratt wrote: Benji York wrote: David Pratt wrote: You are probably right but just the same I'd rather see the patched version for z3 also since I am certain this will become less obvious over time if it is left the way it is. Instead of maintaining a fork of docutils, Zope 3 should (and may already, I haven't been keeping up with this issue) include tests to make sure we're using docutils appropriately. Best of both worlds: we have continued assurance we don't regress, and we don't have to maintain a fork/patches. Hi Benji. Fair enough. What about the idea of maintaining a text file in the distribution specific to possible security issues. Is this worth considering for historical purposes so they do not get lost over time or implicitly understood by only a handful of people. Many thanks. Docutils already provides such a document. It's there documenation. Whoever made reST available TTW didn't read it. Providing another document that people won't read won't help the situation. Whenever we reuse 3rd-party code or write, we need be aware of security issues. Jim -- Jim Fulton mailto:[EMAIL PROTECTED]Python Powered! CTO (540) 361-1714 http://www.python.org Zope Corporationhttp://www.zope.com http://www.zope.org ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] ImportError when calling runzope.
Thanks, I reinstalled Zope and got it working, you're right I must not have removed the previous version properly. Cheers Luke. David Pratt wrote: Hi Luke. It seems that you may have copied package-includes files from an instance of an older distribution to your newer one or perhaps your are trying to use an older zope instance for your newer zope version. The error is pointing to sendmail-meta.zcml as the source of your trouble. In this distribution you should not have a sendmail-meta.zcml or sendmail-configure but a mail-meta.zcml and mail-configure.zcml since mail is in zope.app.mail. So you can compare name what you have in your instance to what is in the distribution you downloaded and fix this accordingly or alternatively, follow the instructions for making a new zope instance. This should also give you a working zope instance. Regards, David Luke Benstead wrote: Hi, I'm new to Zope and I'm having trouble getting the instance I have created to run. I'm using Zope 3.2.0 on Windows 2000. When I call 'runzope' I get the following python traceback: Traceback (most recent call last): File "bin/runzope", line 48, in ? run() File "bin/runzope", line 44, in run main(["-C", CONFIG_FILE] + sys.argv[1:]) File "C:\Python24\Lib\site-packages\zope\app\twisted\main.py", line 74, in main service = setup(load_options(args)) File "C:\Python24\Lib\site-packages\zope\app\twisted\main.py", line 139, in setup zope.app.appsetup.config(options.site_definition, features=features) File "C:\Python24\Lib\site-packages\zope\app\appsetup\appsetup.py", line 110, in config context = xmlconfig.file(file, context=context, execute=execute) File "C:\Python24\Lib\site-packages\zope\configuration\xmlconfig.py", line 554, in file include(context, name, package) File "C:\Python24\Lib\site-packages\zope\configuration\xmlconfig.py", line 490, in include processxmlfile(f, context) File "C:\Python24\Lib\site-packages\zope\configuration\xmlconfig.py", line 345, in processxmlfile parser.parse(src) File "C:\Python24\Lib\xml\sax\expatreader.py", line 107, in parse xmlreader.IncrementalParser.parse(self, source) File "C:\Python24\Lib\xml\sax\xmlreader.py", line 123, in parse self.feed(buffer) File "C:\Python24\Lib\xml\sax\expatreader.py", line 207, in feed self._parser.Parse(data, isFinal) File "C:\Python24\Lib\xml\sax\expatreader.py", line 348, in end_element_ns self._cont_handler.endElementNS(pair, None) File "C:\Python24\Lib\site-packages\zope\configuration\xmlconfig.py", line 326, in endElementNS self.context.end() File "C:\Python24\Lib\site-packages\zope\configuration\config.py", line 544, in end self.stack.pop().finish() File "C:\Python24\Lib\site-packages\zope\configuration\config.py", line 690, in finish actions = self.handler(context, **args) File "C:\Python24\Lib\site-packages\zope\configuration\xmlconfig.py", line 490, in include processxmlfile(f, context) File "C:\Python24\Lib\site-packages\zope\configuration\xmlconfig.py", line 345, in processxmlfile parser.parse(src) File "C:\Python24\Lib\xml\sax\expatreader.py", line 107, in parse xmlreader.IncrementalParser.parse(self, source) File "C:\Python24\Lib\xml\sax\xmlreader.py", line 123, in parse self.feed(buffer) File "C:\Python24\Lib\xml\sax\expatreader.py", line 207, in feed self._parser.Parse(data, isFinal) File "C:\Python24\Lib\xml\sax\expatreader.py", line 348, in end_element_ns self._cont_handler.endElementNS(pair, None) File "C:\Python24\Lib\site-packages\zope\configuration\xmlconfig.py", line 326, in endElementNS self.context.end() File "C:\Python24\Lib\site-packages\zope\configuration\config.py", line 544, in end self.stack.pop().finish() File "C:\Python24\Lib\site-packages\zope\configuration\config.py", line 689, in finish args = toargs(context, *self.argdata) File "C:\Python24\Lib\site-packages\zope\configuration\config.py", line 1381, in toargs args[str(name)] = field.fromUnicode(s) File "C:\Python24\Lib\site-packages\zope\configuration\fields.py", line 141, in fromUnicode raise schema.ValidationError(v) zope.configuration.xmlconfig.ZopeXMLConfigurationError: File "C:\ZopeInstance\etc\site.zcml", line 3.2-3.50 ZopeXMLConfigurationError: File "C:\ZopeInstance\etc\package-includes\sendmail-meta.zcml", line 1.0-1.51 ConfigurationError: ('Invalid value for', 'package', 'ImportError: Module zope has no global sendmail') Any help in resolving this error would be appreciated, Thanks Luke Benstead. ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] ImportError when calling runzope.
Hi Luke. It seems that you may have copied package-includes files from an instance of an older distribution to your newer one or perhaps your are trying to use an older zope instance for your newer zope version. The error is pointing to sendmail-meta.zcml as the source of your trouble. In this distribution you should not have a sendmail-meta.zcml or sendmail-configure but a mail-meta.zcml and mail-configure.zcml since mail is in zope.app.mail. So you can compare name what you have in your instance to what is in the distribution you downloaded and fix this accordingly or alternatively, follow the instructions for making a new zope instance. This should also give you a working zope instance. Regards, David Luke Benstead wrote: Hi, I'm new to Zope and I'm having trouble getting the instance I have created to run. I'm using Zope 3.2.0 on Windows 2000. When I call 'runzope' I get the following python traceback: Traceback (most recent call last): File "bin/runzope", line 48, in ? run() File "bin/runzope", line 44, in run main(["-C", CONFIG_FILE] + sys.argv[1:]) File "C:\Python24\Lib\site-packages\zope\app\twisted\main.py", line 74, in main service = setup(load_options(args)) File "C:\Python24\Lib\site-packages\zope\app\twisted\main.py", line 139, in setup zope.app.appsetup.config(options.site_definition, features=features) File "C:\Python24\Lib\site-packages\zope\app\appsetup\appsetup.py", line 110, in config context = xmlconfig.file(file, context=context, execute=execute) File "C:\Python24\Lib\site-packages\zope\configuration\xmlconfig.py", line 554, in file include(context, name, package) File "C:\Python24\Lib\site-packages\zope\configuration\xmlconfig.py", line 490, in include processxmlfile(f, context) File "C:\Python24\Lib\site-packages\zope\configuration\xmlconfig.py", line 345, in processxmlfile parser.parse(src) File "C:\Python24\Lib\xml\sax\expatreader.py", line 107, in parse xmlreader.IncrementalParser.parse(self, source) File "C:\Python24\Lib\xml\sax\xmlreader.py", line 123, in parse self.feed(buffer) File "C:\Python24\Lib\xml\sax\expatreader.py", line 207, in feed self._parser.Parse(data, isFinal) File "C:\Python24\Lib\xml\sax\expatreader.py", line 348, in end_element_ns self._cont_handler.endElementNS(pair, None) File "C:\Python24\Lib\site-packages\zope\configuration\xmlconfig.py", line 326, in endElementNS self.context.end() File "C:\Python24\Lib\site-packages\zope\configuration\config.py", line 544, in end self.stack.pop().finish() File "C:\Python24\Lib\site-packages\zope\configuration\config.py", line 690, in finish actions = self.handler(context, **args) File "C:\Python24\Lib\site-packages\zope\configuration\xmlconfig.py", line 490, in include processxmlfile(f, context) File "C:\Python24\Lib\site-packages\zope\configuration\xmlconfig.py", line 345, in processxmlfile parser.parse(src) File "C:\Python24\Lib\xml\sax\expatreader.py", line 107, in parse xmlreader.IncrementalParser.parse(self, source) File "C:\Python24\Lib\xml\sax\xmlreader.py", line 123, in parse self.feed(buffer) File "C:\Python24\Lib\xml\sax\expatreader.py", line 207, in feed self._parser.Parse(data, isFinal) File "C:\Python24\Lib\xml\sax\expatreader.py", line 348, in end_element_ns self._cont_handler.endElementNS(pair, None) File "C:\Python24\Lib\site-packages\zope\configuration\xmlconfig.py", line 326, in endElementNS self.context.end() File "C:\Python24\Lib\site-packages\zope\configuration\config.py", line 544, in end self.stack.pop().finish() File "C:\Python24\Lib\site-packages\zope\configuration\config.py", line 689, in finish args = toargs(context, *self.argdata) File "C:\Python24\Lib\site-packages\zope\configuration\config.py", line 1381, in toargs args[str(name)] = field.fromUnicode(s) File "C:\Python24\Lib\site-packages\zope\configuration\fields.py", line 141, in fromUnicode raise schema.ValidationError(v) zope.configuration.xmlconfig.ZopeXMLConfigurationError: File "C:\ZopeInstance\etc\site.zcml", line 3.2-3.50 ZopeXMLConfigurationError: File "C:\ZopeInstance\etc\package-includes\sendmail-meta.zcml", line 1.0-1.51 ConfigurationError: ('Invalid value for', 'package', 'ImportError: Module zope has no global sendmail') Any help in resolving this error would be appreciated, Thanks Luke Benstead. ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Security alert: use of Through-the-Web reStructuredText
Benji York wrote: David Pratt wrote: What about the idea of maintaining a text file in the distribution specific to possible security issues. Is this worth considering for historical purposes so they do not get lost over time or implicitly understood by only a handful of people. Exactly. Any package that needs security-related things verified should have a test (doctest in a text file) describing the problem and verifying that it has been fixed. I don't think we want a single file to hold them though, tests (including these) should normally live near the package that they test. Ok this all makes perfect sense. The doctest is the right place for this for sure. Just took me a while to see that everthing was already there to deal with this as consistently as all other parts of zope3. It's all good :-) Regards, David ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Security alert: use of Through-the-Web reStructuredText
David Pratt wrote: What about the idea of maintaining a text file in the distribution specific to possible security issues. Is this worth considering for historical purposes so they do not get lost over time or implicitly understood by only a handful of people. Exactly. Any package that needs security-related things verified should have a test (doctest in a text file) describing the problem and verifying that it has been fixed. I don't think we want a single file to hold them though, tests (including these) should normally live near the package that they test. -- Benji York Senior Software Engineer Zope Corporation ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Security alert: use of Through-the-Web reStructuredText
Benji York wrote: David Pratt wrote: You are probably right but just the same I'd rather see the patched version for z3 also since I am certain this will become less obvious over time if it is left the way it is. Instead of maintaining a fork of docutils, Zope 3 should (and may already, I haven't been keeping up with this issue) include tests to make sure we're using docutils appropriately. Best of both worlds: we have continued assurance we don't regress, and we don't have to maintain a fork/patches. Hi Benji. Fair enough. What about the idea of maintaining a text file in the distribution specific to possible security issues. Is this worth considering for historical purposes so they do not get lost over time or implicitly understood by only a handful of people. Many thanks. Regards, David ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Security alert: use of Through-the-Web reStructuredText
David Pratt wrote: You are probably right but just the same I'd rather see the patched version for z3 also since I am certain this will become less obvious over time if it is left the way it is. Instead of maintaining a fork of docutils, Zope 3 should (and may already, I haven't been keeping up with this issue) include tests to make sure we're using docutils appropriately. Best of both worlds: we have continued assurance we don't regress, and we don't have to maintain a fork/patches. -- Benji York Senior Software Engineer Zope Corporation ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Security alert: use of Through-the-Web reStructuredText
Jim Fulton wrote: On Jul 18, 2006, at 2:55 PM, David Pratt wrote: Hi Jim. I was noticing a 0.4.0-zope in distutils I don't know what you mean by this. that looks patched with NotImplementedErrors for the offending code in docutils.parsers.rst.directives.misc. Can you when this will land in the Zope3 trunk? Hi Jim. Yes, I mean docutils, sorry. If you mean patching the docutils, then as far as I'm concerned, it will never land in the Zope 3 trunk. The right solution to this problem is to write applications that use docutils correctly, not to patch docutils. You are probably right but just the same I'd rather see the patched version for z3 also since I am certain this will become less obvious over time if it is left the way it is. Alternatively, perhaps a text file for these security issues could be included in the distribution so it is not forgotten with any recommendations for a programmer to avoid known security issues. Regards, David ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] zodb data recovery
- Original Message - From: "Pete Taylor" <[EMAIL PROTECTED]> To: "Jonathan" <[EMAIL PROTECTED]> Cc: Sent: Tuesday, July 18, 2006 11:20 PM Subject: Re: [Zope3-Users] zodb data recovery Jonathan, Thanks for the input... is there somewhere you can point me that I can read about how to do that myself? Thanks! If you are looking for info on how to use mount points look in the zope.conf file in your zope installation which should be in the ...zope/etc directory. Google for 'zope mount point' and you will find lots of info as well. Jonathan On 7/18/06, Jonathan <[EMAIL PROTECTED]> wrote: - Original Message - From: "Pete Taylor" <[EMAIL PROTECTED]> To: Sent: Tuesday, July 18, 2006 7:07 PM Subject: [Zope3-Users] zodb data recovery > Thinking about the ZODB and data recovery... > > Let's say I have two or three sites all running off the same Data.fs > (through ZEO or otherwise). Doing nightly backups, being good > sysadmins, etc. Now I get a call from a user who says "I don't know > what happened to the content, but it was there three days ago, i > swear!" > > So I look through my backups, load a Data.fs up in my python shell, > and start digging around, and sure enough, there's the data. > > How do I get that data "back" so to speak? I don't want to restore > the whole ZODB, that would blow away my other sites data, and any data > that any other user of that same site had created. I know that zope3 > doesn't provide any "dump data from this context on down" kind of > utils, but I was wondering what the standard way to do this was? I'm > sure this problem has been run into ;) > > I haven't run into this yet, but I'm in the midst of building a > site-with-many-subsites scenario, and I worry about these kinds of > things. Certainly the "Undo" functionality is great, but it has > limits... and in many ways, it's not the immediate "oh, oops, i > deleted that" kind of data destruction I'm worried about, though > that's there. It's more the a-few-weeks-later kind of issue that I'm > worried about. > > I'd considered opening up a connection to both Data.fs ZODB's, > establishing the correct context in both, and then repopulating all of > the data that way. But anything that keys on ObjectEvent (or any > other design specific event) thrown during these object creations > would fail. And unless we explicitly check for annotations and such, > I don't know if those would picked up just by moving all content > objects from a particular location. > > Has anyone else solved this problem, or have suggestions toward > solving it? I don't mind writing the scripts to repopulate data from > a restored zodb should that be necessary, but I don't really think > that's the right way to go, or at least not on it's own. > > Any thoughts would be extremely welcome! If you have set up the 'virtual' web sites so that they have their own folder 'tree-structure' eg. root - virtualWebSite1folder - virtualWebSite1subfolder... - virtualWebSite2folder - virtualWebSite2subfolder... - virtualWebSite3Folder - virtualWebSite3subfolder... you can export/import a single folder instead of the entire Data.fs. Another solution is to set up a mount point (ie. a separate xxx.fs file) for each folder. hth Jonathan -- "All guilt is relative, loyalty counts, and never let your conscience be your guide." - Lucas Buck, American Gothic ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] ImportError when calling runzope.
Hi, I'm new to Zope and I'm having trouble getting the instance I have created to run. I'm using Zope 3.2.0 on Windows 2000. When I call 'runzope' I get the following python traceback: Traceback (most recent call last): File "bin/runzope", line 48, in ? run() File "bin/runzope", line 44, in run main(["-C", CONFIG_FILE] + sys.argv[1:]) File "C:\Python24\Lib\site-packages\zope\app\twisted\main.py", line 74, in main service = setup(load_options(args)) File "C:\Python24\Lib\site-packages\zope\app\twisted\main.py", line 139, in setup zope.app.appsetup.config(options.site_definition, features=features) File "C:\Python24\Lib\site-packages\zope\app\appsetup\appsetup.py", line 110, in config context = xmlconfig.file(file, context=context, execute=execute) File "C:\Python24\Lib\site-packages\zope\configuration\xmlconfig.py", line 554, in file include(context, name, package) File "C:\Python24\Lib\site-packages\zope\configuration\xmlconfig.py", line 490, in include processxmlfile(f, context) File "C:\Python24\Lib\site-packages\zope\configuration\xmlconfig.py", line 345, in processxmlfile parser.parse(src) File "C:\Python24\Lib\xml\sax\expatreader.py", line 107, in parse xmlreader.IncrementalParser.parse(self, source) File "C:\Python24\Lib\xml\sax\xmlreader.py", line 123, in parse self.feed(buffer) File "C:\Python24\Lib\xml\sax\expatreader.py", line 207, in feed self._parser.Parse(data, isFinal) File "C:\Python24\Lib\xml\sax\expatreader.py", line 348, in end_element_ns self._cont_handler.endElementNS(pair, None) File "C:\Python24\Lib\site-packages\zope\configuration\xmlconfig.py", line 326, in endElementNS self.context.end() File "C:\Python24\Lib\site-packages\zope\configuration\config.py", line 544, in end self.stack.pop().finish() File "C:\Python24\Lib\site-packages\zope\configuration\config.py", line 690, in finish actions = self.handler(context, **args) File "C:\Python24\Lib\site-packages\zope\configuration\xmlconfig.py", line 490, in include processxmlfile(f, context) File "C:\Python24\Lib\site-packages\zope\configuration\xmlconfig.py", line 345, in processxmlfile parser.parse(src) File "C:\Python24\Lib\xml\sax\expatreader.py", line 107, in parse xmlreader.IncrementalParser.parse(self, source) File "C:\Python24\Lib\xml\sax\xmlreader.py", line 123, in parse self.feed(buffer) File "C:\Python24\Lib\xml\sax\expatreader.py", line 207, in feed self._parser.Parse(data, isFinal) File "C:\Python24\Lib\xml\sax\expatreader.py", line 348, in end_element_ns self._cont_handler.endElementNS(pair, None) File "C:\Python24\Lib\site-packages\zope\configuration\xmlconfig.py", line 326, in endElementNS self.context.end() File "C:\Python24\Lib\site-packages\zope\configuration\config.py", line 544, in end self.stack.pop().finish() File "C:\Python24\Lib\site-packages\zope\configuration\config.py", line 689, in finish args = toargs(context, *self.argdata) File "C:\Python24\Lib\site-packages\zope\configuration\config.py", line 1381, in toargs args[str(name)] = field.fromUnicode(s) File "C:\Python24\Lib\site-packages\zope\configuration\fields.py", line 141, in fromUnicode raise schema.ValidationError(v) zope.configuration.xmlconfig.ZopeXMLConfigurationError: File "C:\ZopeInstance\etc\site.zcml", line 3.2-3.50 ZopeXMLConfigurationError: File "C:\ZopeInstance\etc\package-includes\sendmail-meta.zcml", line 1.0-1.51 ConfigurationError: ('Invalid value for', 'package', 'ImportError: Module zope has no global sendmail') Any help in resolving this error would be appreciated, Thanks Luke Benstead. ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] patch for z3c.multiform
Hi, Attached is a patch to add a small function to z3c.multiform. The function is called 'hasChildrenAndAllSubFormsDisplayMode' and is useful as a condition for an action. The use case is this: There is a 'remove' button that deletes lines from a multiform form. I don't want this button to show in my form unless the container has children. I hope is useful enough to get in. Best Regards, Lorenzo Index: multiform/multiform.py === --- multiform/multiform.py (revisión: 69197) +++ multiform/multiform.py (copia de trabajo) @@ -34,6 +34,10 @@ return False return True +def hasChildrenAndAllSubFormsDisplayMode(form, action): +if len(form.context) == 0: +return False +return allSubFormsDisplayMode(form, action) class ItemAction(form.Action): ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users