[Zope3-dev] time schema field?

2006-05-22 Thread Rocky Burt
Hi all,

I was just curious why zope.schema has fields for datetime.datetime,
datetime.date, and datetime.timedelta but no field for datetime.time.  I
have a need for such a field right now and I think it'd be useful to be
core to zope.schema rather than me create my own field.

Would anyone mind if I added this to the zope3.3 branch and trunk?  It'd
be a very small thing.

Or perhaps I'm too late (feature-freeze) to add it to the zope3.3
branch?

Regards,
Rocky



-- 
Rocky Burt
ServerZen Software -- http://www.serverzen.com
News About The Server (blog) -- http://www.serverzen.net



signature.asc
Description: This is a digitally signed message part
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] time schema field?

2006-05-22 Thread Gary Poster


On May 22, 2006, at 8:47 AM, Rocky Burt wrote:


Hi all,

I was just curious why zope.schema has fields for datetime.datetime,
datetime.date, and datetime.timedelta but no field for  
datetime.time.  I
have a need for such a field right now and I think it'd be useful  
to be

core to zope.schema rather than me create my own field.

Would anyone mind if I added this to the zope3.3 branch and trunk?   
It'd

be a very small thing.


+1 on the trunk.


Or perhaps I'm too late (feature-freeze) to add it to the zope3.3
branch?


Up to Stephan.

Gary
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



[Zope3-dev] Re: time schema field?

2006-05-22 Thread Philipp von Weitershausen
Rocky Burt wrote:
 Hi all,
 
 I was just curious why zope.schema has fields for datetime.datetime,
 datetime.date, and datetime.timedelta but no field for datetime.time.  I
 have a need for such a field right now and I think it'd be useful to be
 core to zope.schema rather than me create my own field.
 
 Would anyone mind if I added this to the zope3.3 branch and trunk?  It'd
 be a very small thing.

+1 to the trunk

 Or perhaps I'm too late (feature-freeze) to add it to the zope3.3
 branch?

-1 to 3.3 branch. Since we already have had a beta release, 3.3 should
be considered in feature-freeze.

Philipp
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



[Zope3-dev] Re: time schema field?

2006-05-22 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Philipp von Weitershausen wrote:
 Rocky Burt wrote:
 
Hi all,

I was just curious why zope.schema has fields for datetime.datetime,
datetime.date, and datetime.timedelta but no field for datetime.time.  I
have a need for such a field right now and I think it'd be useful to be
core to zope.schema rather than me create my own field.

Would anyone mind if I added this to the zope3.3 branch and trunk?  It'd
be a very small thing.
 
 
 +1 to the trunk
 
 
Or perhaps I'm too late (feature-freeze) to add it to the zope3.3
branch?
 
 
 -1 to 3.3 branch. Since we already have had a beta release, 3.3 should
 be considered in feature-freeze.

You could easily construe the omission of the 'time' field type as a
bug;  adding it is near zero-risk, as well.


Tres.
- --
===
Tres Seaver  +1 202-558-7113  [EMAIL PROTECTED]
Palladion Software   Excellence by Designhttp://palladion.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFEcdk2+gerLs4ltQ4RAu7wAJ9FIe41wF9Eyl8Mxwf1F1y9tq2bXQCdFfvk
qAQOleo+ah5XRbSYk+5V1KY=
=o5tC
-END PGP SIGNATURE-
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



[Zope3-dev] Re: time schema field?

2006-05-22 Thread Rocky Burt
On Mon, 2006-22-05 at 11:31 -0400, Tres Seaver wrote:
 Philipp von Weitershausen wrote:
  -1 to 3.3 branch. Since we already have had a beta release, 3.3 should
  be considered in feature-freeze.
 
 You could easily construe the omission of the 'time' field type as a
 bug;  adding it is near zero-risk, as well.

That is indeed how I would like to argue, alas I think its a bit of a
stretch.  Just seems so odd that there was no Time field type to begin
with yet there was a Timedelta type.

- Rocky


-- 
Rocky Burt
ServerZen Software -- http://www.serverzen.com
News About The Server (blog) -- http://www.serverzen.net



signature.asc
Description: This is a digitally signed message part
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



[Zope3-dev] Re: time schema field?

2006-05-22 Thread Rocky Burt
On Mon, 2006-22-05 at 10:17 -0230, Rocky Burt wrote:
 I was just curious why zope.schema has fields for datetime.datetime,
 datetime.date, and datetime.timedelta but no field for datetime.time.  I
 have a need for such a field right now and I think it'd be useful to be
 core to zope.schema rather than me create my own field.

Ok, I've not committed anything worth recording into any sort of
changelog for zope3 before so I've attached the patch with all my
changes that I will be committing to Zope3 svn trunk shortly if no one
objects.  Did I modify the correct changelog and in the correct fashion?

- Rocky


-- 
Rocky Burt
ServerZen Software -- http://www.serverzen.com
News About The Server (blog) -- http://www.serverzen.net

Index: src/zope/schema/__init__.py
===
--- src/zope/schema/__init__.py	(revision 68240)
+++ src/zope/schema/__init__.py	(working copy)
@@ -21,7 +21,7 @@
 from zope.schema._field import Text, TextLine, Bool, Int, Float
 from zope.schema._field import Tuple, List, Set, FrozenSet
 from zope.schema._field import Password, Dict, Datetime, Date, Timedelta
-from zope.schema._field import SourceText
+from zope.schema._field import Time, SourceText
 from zope.schema._field import Object, URI, Id, DottedName
 from zope.schema._field import InterfaceField
 from zope.schema._schema import getFields, getFieldsInOrder
Index: src/zope/schema/_field.py
===
--- src/zope/schema/_field.py	(revision 68242)
+++ src/zope/schema/_field.py	(working copy)
@@ -19,7 +19,7 @@
 __docformat__ = 'restructuredtext'
 
 import re
-from datetime import datetime, date, timedelta
+from datetime import datetime, date, timedelta, time
 from sets import Set as SetType
 
 from zope.interface import classImplements, implements
@@ -33,6 +33,7 @@
 from zope.schema.interfaces import IBool, IInt, IFloat, IDatetime, IFrozenSet
 from zope.schema.interfaces import IChoice, ITuple, IList, ISet, IDict
 from zope.schema.interfaces import IPassword, IObject, IDate, ITimedelta
+from zope.schema.interfaces import ITime
 from zope.schema.interfaces import IURI, IId, IFromUnicode
 from zope.schema.interfaces import ISource, IBaseVocabulary
 from zope.schema.interfaces import IContextSourceBinder
@@ -183,6 +184,11 @@
 __doc__ = ITimedelta.__doc__
 implements(ITimedelta)
 _type = timedelta
+
+class Time(Orderable, Field):
+__doc__ = ITime.__doc__
+implements(ITime)
+_type = time
 
 class Choice(Field):
 Choice fields can have a value found in a constant or dynamic set of
Index: src/zope/schema/interfaces.py
===
--- src/zope/schema/interfaces.py	(revision 68240)
+++ src/zope/schema/interfaces.py	(working copy)
@@ -333,6 +333,9 @@
 class ITimedelta(IMinMax, IField):
 uField containing a timedelta.
 
+class ITime(IMinMax, IField):
+uField containing a time.
+
 def _is_field(value):
 if not IField.providedBy(value):
 return False
Index: doc/CHANGES.txt
===
--- doc/CHANGES.txt	(revision 68240)
+++ doc/CHANGES.txt	(working copy)
@@ -10,6 +10,8 @@
 
 New features
 
+  - Added new Time field type to zope.schema
+
 Restructuring
 
 Bug fixes


signature.asc
Description: This is a digitally signed message part
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com