[Zope3-checkins] CVS: Zope3/lib/python/Zope/Schema - IField.py:1.6 _Field.py:1.4 __init__.py:1.3
Jim Fulton
jim@zope.com
Fri, 4 Oct 2002 14:24:56 -0400
Update of /cvs-repository/Zope3/lib/python/Zope/Schema
In directory cvs.zope.org:/tmp/cvs-serv21160
Modified Files:
IField.py _Field.py __init__.py
Log Message:
Added a datetime field based on the new standard date-time type.
=== Zope3/lib/python/Zope/Schema/IField.py 1.5 => 1.6 ===
--- Zope3/lib/python/Zope/Schema/IField.py:1.5 Thu Oct 3 15:44:26 2002
+++ Zope3/lib/python/Zope/Schema/IField.py Fri Oct 4 14:24:55 2002
@@ -169,6 +169,9 @@
class IFloat(IEnumeratable, IOrderable):
u"""Describes the footprint of a Float variable."""
+
+class IDatetime(IEnumeratable, IOrderable):
+ u"""Describes the footprint of a datetime variable."""
def _fields(values):
for value in values:
=== Zope3/lib/python/Zope/Schema/_Field.py 1.3 => 1.4 ===
--- Zope3/lib/python/Zope/Schema/_Field.py:1.3 Wed Sep 11 18:06:41 2002
+++ Zope3/lib/python/Zope/Schema/_Field.py Fri Oct 4 14:24:55 2002
@@ -26,6 +26,7 @@
from _bootstrapFields import Field, Container, Iteratable, Orderable, Sized
from _bootstrapFields import Enumeratable, Text, Bool, Int
from FieldProperty import FieldProperty
+from datetime import datetime
# Fix up bootstrap field types
Field.title = FieldProperty(IField.IField['title'])
@@ -60,6 +61,11 @@
__implements__ = IField.IFloat
_type = float
+class Datetime(Enumeratable, Orderable):
+ __doc__ = IField.IDatetime.__doc__
+ __implements__ = IField.IDatetime
+ _type = datetime
+
def _validate_sequence(value_types, value, errors=None):
if errors is None:
errors = []
@@ -142,3 +148,4 @@
finally:
errors = None
+
=== Zope3/lib/python/Zope/Schema/__init__.py 1.2 => 1.3 ===
--- Zope3/lib/python/Zope/Schema/__init__.py:1.2 Sat Sep 7 12:18:51 2002
+++ Zope3/lib/python/Zope/Schema/__init__.py Fri Oct 4 14:24:55 2002
@@ -15,5 +15,8 @@
$Id$
"""
-from _Field import Field, Bytes, Text, Bool, Int, Float, Tuple, List, Dict
+
+from _Field import Field, Container, Iteratable, Orderable, Sized, Enumeratable
+from _Field import Sequence
+from _Field import Bytes, Text, Bool, Int, Float, Tuple, List, Dict, Datetime
from _Schema import validateMapping, validateMappingAll, getFields