[Zope3-Users] z3c.json and datetime objects

2008-01-31 Thread Yuan HOng
The z3c.json write implementation uses str to convert any unrecognized
data types json. But json only recogonizes basic data types, and
strings must be enclosed in quotation marks, so the data
representation given by z3c.json is often invalid. For example:

   import zope.component
   from z3c.json import interfaces
   from z3c.json import testing
   testing.setUpJSONConverter()
   jsonWriter = zope.component.getUtility(interfaces.IJSONWriter)
   from datetime import date
   input = {u'date': date.today()}
   jsonWrite.write(input)
  u'{date:2008-01-31}'

This string would be evaluate by most javascript implementations to
give the result of {date: 1976}, since 2008-01-31 is not quoted and is
regarded as an expression by javascript eval function.

I think there is a bug in the minjson.py, which uses str function to
convert an unrecognized type to json string but without quoting the
return value:

   
# if we are not baseobj, convert to it
try:
obj = str(obj)
except Exception, exc:
raise WriteException, 'Cannot write object (%s: %s)' %
(exc.__class__, exc)
self.stream.write(obj)

Shouldn't the code read better as?

# if we are not baseobj, convert to it
try:
obj = str(obj)
except Exception, exc:
raise WriteException, 'Cannot write object (%s: %s)' %
(exc.__class__, exc)
self.stream.write('')
self.stream.write(obj)
self.stream.write('')

-- 
Hong Yuan

大管家网上建材超市
装修装潢建材一站式购物
http://www.homemaster.cn
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] wiki refactoring

2008-01-31 Thread Roy Mathew
Hi all,

I have reworked the FAQ by:

  o splitting the page into smaller bits.
  o fixing the wording of the question headers
  o correcting a few typos.

Please review the changes at: http://wiki.zope.org/zope3/FAQReworked 
and let me know if the new pages look reasonable. I have kept the older
FAQ around - if I don't hear from anyone in the next couple of days,
I'll assume that it's ok to replace the old with the new.

Thanks.
Roy.

Stephan Richter writes:
  On Monday 10 December 2007, Roy Mathew wrote:
   Now that the zope3 wiki has grown from an afterthought, to a
   signifcantly useful body of knowledge, I'd like to make the following
   proposal:
  
    o split the wiki into smaller bits.
    o rework the introduction slightly.
    o fix the question headers
    o start writing small HOWTOs (like the grok mini-HOWTOs).
  
   I am happy to help with any and all of the above. What do you think?
  
  I think that the people that recently worked on the Wiki did a fine job. I 
  just browsed through it the past two days and the story is nice. There are a 
  few things that I would have done differently, but it is not major.,
  
  Since you mentioned in a follow-up E-mail that you meant the FAQ, I had a 
  quick look. I have to agree, it is huge. That's great! :-) But that also 
  means we have to provide a new approach for presentation. I agree with all 
  your points. I think the most important part would be to split the FAQ into 
  themed sections, such as UI Development, Organization, Development 
  Process, etc.
  
  Regards,
  Stephan
  -- 
  Stephan Richter
  Web Software Design, Development and Training
  Google me. Zope Stephan Richter___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] wiki refactoring

2008-01-31 Thread Stephan Richter
On Thursday 31 January 2008, Roy Mathew wrote:
 I have reworked the FAQ by:

   o splitting the page into smaller bits.
   o fixing the wording of the question headers
   o correcting a few typos.

Cool, I think it would be good to write a descriptive summary below each 
section in the overview, so people know a little bit more what the section is 
about.

 Please review the changes at: http://wiki.zope.org/zope3/FAQReworked
 and let me know if the new pages look reasonable. I have kept the older
 FAQ around - if I don't hear from anyone in the next couple of days,
 I'll assume that it's ok to replace the old with the new

I think this is a good assumption. :-)

Regards,
Stephan
-- 
Stephan Richter
Web Software Design, Development and Training
Google me. Zope Stephan Richter
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] wiki refactoring

2008-01-31 Thread Baiju M

- Roy Mathew [EMAIL PROTECTED] wrote:
 Hi all,
 
 I have reworked the FAQ by:
 
   o splitting the page into smaller bits.
   o fixing the wording of the question headers
   o correcting a few typos.
 
 Please review the changes at: http://wiki.zope.org/zope3/FAQReworked 
 and let me know if the new pages look reasonable. I have kept the
 older
 FAQ around - if I don't hear from anyone in the next couple of days,
 I'll assume that it's ok to replace the old with the new.

Great work !

+1 for replacing old FAQ with new one.

Regards,
Baiju M

___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] Zope 3.4.0 candidate 1 Released

2008-01-31 Thread Stephan Richter
January 31, 2008 - The Zope 3 development team announces the Zope
3.4.0c1 release.

This release is the first release candidate for Zope 3.4.0. It was preceeded
by an early beta 2 release back in November, 2007.

Zope 3.4 introduces support for binary large objects in the ZODB, and provides
a new postprocessing hook for publishing results. Many of the packages also
provide small feature improvements that are too numerous to list at this
point.


Packages and Eggs
-

Since the first Zope 3.4 alpha and beta releases, we have finished the
transition to a completely egg-based system. This largely means that most Zope
3 developers do not use the classic Zope 3 tar ball release anymore. However,
for your convenience, the Zope 3 developers will provide the classic Zope 3
tar ball releases for at least the 3.4 series and probably for 3.5 as well.

So how are Zope 3 applications built using only eggs?

The Known Good Set (KGS)


The known good set -- or in short KGS -- is a package index that derives from
the official Python Package Index (PyPI) and thus contains all available
packages in the Python world. But for a controlled set of packages, only
certain versions that are known to work together are available. The list of
controlled packages and their versions for Zope 3.4 can be found at the index
page [1]_.

The index can be used in several ways -- described here for `buildout`-based
projects. The easiest method is to specify the index option in your
``buildout.cfg`` file::

  [buildout]
  index = http://download.zope.org/zope3.4
  ...

You can also nail the versions by downloading the versions [2]_ and insert
them as follows:

  [buildout]
  versions = versions
  ...

  [versions]
  zope.interface = 3.4.0
  ...


``zopeproject`` Project Builder
~~~

Philipp von Weitershausen has developed a package called `zopeproject` to
quickly setup the boilerplate for any Zope 3 based project. Ample
documentation is provided at the `zopeproject` home page [3]_. `zopeproject`
uses Paste or ZDaemon to create a working server. Here are the necessary
commands to get a project started::

  $ easy_install zopeproject
  $ zopeproject HelloWorld
  $ cd HelloWorld
  $ bin/helloworld-ctl foreground


Demo Packages
~

At this point, there is no demo package demonstrating a simple Zope 3
application setup. (I hope one gets developed before Zope 3.4.0 final.)
However, the ``z3c.formdemo`` package can be used as a fairly minimal
setup. To get started with it, do the following::

  $ svn co svn://svn.zope.org/repos/main/z3c.formdemo/tags/1.5.1 formdemo
  $ cd formdemo
  $ python bootstrap.py
  $ ./bin/buildout -v
  $ ./bin/demo fg


.. [1] http://download.zope.org/zope3.4/controlled-packages.cfg

.. [2] http://download.zope.org/zope3.4/versions.cfg

.. [3] http://pypi.python.org/pypi/zopeproject


What is Zope 3?
---

Zope 3 is a web application server that continues to build on the heritage of
Zope.  It was rewritten from scratch based on the latest software design
patterns and the experiences of Zope 2.

The component architecture is the very core of Zope 3 that allows developers 
to
create flexible and powerful web applications.


Compatibility with Zope 2
--

Zope 3 is not upwards compatible with Zope 2. This means you cannot run Zope 2
applications in Zope 3.

We continue to work on the transition from Zope 2 to Zope 3 by making Zope 2
use more and more of the Zope 3 infrastructure. This means that new code
written in Zope 2 can benefit from Zope 3 technology. Also, with care, code
can be written that works in both Zope 3 and Zope 2.  This allows a Zope 2
application to slowly evolve towards Zope 3.  Unchanged Zope 2 applications
are never expected to work in Zope 3, however.


Downloads
-

- Zope 3.4 Egg Index:
http://download.zope.org/zope3.4

- Zope 3.4 Controlled Packages:
http://download.zope.org/zope3.4/controlled-packages.cfg

- Zope 3.4 Latest Versions:
http://download.zope.org/zope3.4/versions.cfg

- The classic Zope 3 source release can be downloaded from:
http://zope.org/Products/Zope3

Installation instructions for both Windows and Un*x/Linux are now available in
the top level `README.txt` file of the distribution. The binary installer is
recommended for Windows.

Zope 3.4 requires Python 2.4.4 to run. You must also have zlib installed on
your system.


Resources
-

- Zope 3 Development Web Site:
http://wiki.zope.org/zope3

- Zope 3 Developers Mailing List:
http://mail.zope.org/mailman/listinfo/zope-dev

Retired: http://mail.zope.org/mailman/listinfo/zope3-dev

- Zope 3 Users Mailing List:
http://mail.zope.org/mailman/listinfo/zope3-users

- Bug tracker at launchpad:
https://launchpad.net/zope3

- IRC Channel:
#zope3-dev at irc.freenode.net


Acknowledgments
---

Much thanks to everyone who contributed to this release. Since all