server/test/data-schema2sql/schema/schema.py
changeset 10443 2d3834df64ab
parent 10199 218c28bff695
child 10907 9ae707db5265
equal deleted inserted replaced
10442:b2d2099dfae8 10443:2d3834df64ab
    15 #
    15 #
    16 # You should have received a copy of the GNU Lesser General Public License along
    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/>.
    17 # with yams. If not, see <http://www.gnu.org/licenses/>.
    18 from yams.buildobjs import (EntityType, RelationDefinition, RelationType,
    18 from yams.buildobjs import (EntityType, RelationDefinition, RelationType,
    19                             SubjectRelation, String, Int, Float, Date, Boolean)
    19                             SubjectRelation, String, Int, Float, Date, Boolean)
       
    20 from yams.constraints import Attribute, BoundaryConstraint
    20 
    21 
    21 class Affaire(EntityType):
    22 class Affaire(EntityType):
    22     sujet = String(maxsize=128)
    23     sujet = String(maxsize=128)
    23     ref = String(maxsize=12)
    24     ref = String(maxsize=12)
    24 
    25 
    62 
    63 
    63 class Societe(EntityType):
    64 class Societe(EntityType):
    64     nom  = String(maxsize=64, fulltextindexed=True)
    65     nom  = String(maxsize=64, fulltextindexed=True)
    65     web = String(maxsize=128)
    66     web = String(maxsize=128)
    66     tel  = Int()
    67     tel  = Int()
    67     fax  = Int()
    68     fax  = Int(constraints=[BoundaryConstraint('<=', Attribute('tel'))])
    68     rncs = String(maxsize=32)
    69     rncs = String(maxsize=32)
    69     ad1  = String(maxsize=128)
    70     ad1  = String(maxsize=128)
    70     ad2  = String(maxsize=128)
    71     ad2  = String(maxsize=128)
    71     ad3  = String(maxsize=128)
    72     ad3  = String(maxsize=128)
    72     cp   = String(maxsize=12)
    73     cp   = String(maxsize=12)