1 # copyright 2004-2014 LOGILAB S.A. (Paris, FRANCE), all rights reserved. |
|
2 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr |
|
3 # |
|
4 # This file is part of yams. |
|
5 # |
|
6 # yams is free software: you can redistribute it and/or modify it under the |
|
7 # terms of the GNU Lesser General Public License as published by the Free |
|
8 # Software Foundation, either version 2.1 of the License, or (at your option) |
|
9 # any later version. |
|
10 # |
|
11 # yams is distributed in the hope that it will be useful, but WITHOUT ANY |
|
12 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR |
|
13 # A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more |
|
14 # details. |
|
15 # |
|
16 # You should have received a copy of the GNU Lesser General Public License along |
|
17 # with yams. If not, see <http://www.gnu.org/licenses/>. |
|
18 from datetime import time, date |
|
19 from yams.buildobjs import EntityType, Datetime, Date, Time |
|
20 from yams.constraints import TODAY, BoundaryConstraint |
|
21 |
|
22 class Datetest(EntityType): |
|
23 dt1 = Datetime(default=u'now') |
|
24 dt2 = Datetime(default=u'today') |
|
25 d1 = Date(default=u'today', constraints=[BoundaryConstraint('<=', TODAY())]) |
|
26 d2 = Date(default=date(2007, 12, 11)) |
|
27 t1 = Time(default=time(8, 40)) |
|
28 t2 = Time(default=time(9, 45)) |
|