Esempio n. 1
0
class CWAttribute(EntityType):
    """define a final relation: link a final relation type from a non final
    entity to a final entity type.

    used to build the instance schema
    """
    __permissions__ = PUB_SYSTEM_ENTITY_PERMS
    relation_type = SubjectRelation('CWRType', cardinality='1*',
                                    constraints=[RQLConstraint('O final TRUE')],
                                    composite='object')
    from_entity = SubjectRelation('CWEType', cardinality='1*',
                                  constraints=[RQLConstraint('O final FALSE')],
                                  composite='object')
    to_entity = SubjectRelation('CWEType', cardinality='1*',
                                constraints=[RQLConstraint('O final TRUE')],
                                composite='object')
    constrained_by = SubjectRelation('CWConstraint', cardinality='*1', composite='subject')

    cardinality = String(maxsize=2, internationalizable=True,
                         vocabulary=[_('?1'), _('11')],
                         description=_('subject/object cardinality'))
    ordernum = Int(description=('control subject entity\'s relations order'), default=0)

    formula = String(maxsize=2048)
    indexed = Boolean(description=_('create an index for quick search on this attribute'))
    fulltextindexed = Boolean(description=_('index this attribute\'s value in the plain text index'))
    internationalizable = Boolean(description=_('is this attribute\'s value translatable'))
    defaultval = Bytes(description=_('default value as gziped pickled python object'))
    extra_props = Bytes(description=_('additional type specific properties'))

    description = RichString(internationalizable=True,
                             description=_('semantic description of this attribute'))
Esempio n. 2
0
class GenomicMeasure(EntityType):
    """ A genomic measure """
    type = String(maxsize=256, required=True, indexed=True)
    format = String(maxsize=128, indexed=True)
    chip_serialnum = Int()
    completed = Boolean(indexed=True)
    chromset = String(maxsize=64)
    valid = Boolean(indexed=True)
    identifier = String(maxsize=128, fulltextindexed=True)
    label = String(maxsize=64)
Esempio n. 3
0
class Transaction(EntityType):
    date = Date()
    type_achat = String(maxsize=2) # a virer ?
    pagination = String(maxsize=255, fulltextindexed=True)
    date_ordre = Date()
    date_recette = Date()
    remarques = RichString(fulltextindexed=True, default_format='text/rest')
    intervenants = SubjectRelation('Intervenant', composite='subject', cardinality='*1')
    destinataires = SubjectRelation('Destinataire', composite='subject', cardinality='*1')
    travaux = SubjectRelation('Travail', composite='subject', cardinality='**')
    vendeurs = SubjectRelation('Vendeur', composite='subject', cardinality='*1')
    prix_partage = Boolean(required=True, default=False)
    base_paradox = Boolean(default=False, description='vient de la base Paradox')
Esempio n. 4
0
class Compte(EntityType):
    type_compte = String(maxsize=255, required=True)
    inventaire = String(maxsize=255, required=True, fulltextindexed=True)
    debut = Date()
    fin = Date()
    change_str = String(maxsize=255, fulltextindexed=True) # XXX drop me?
    receveur = SubjectRelation('Personne', cardinality='**')
    base_paradox = Boolean(default=False,
                           description='vient de la base Paradox')
    historic = Boolean(default=True,
                       description=u"vrai si le compte est historique, "
                       "faux s'il s'agit d'un compte technique utilise "
                       "par exemple pour la gestion des changes")
Esempio n. 5
0
class CWRType(EntityType):
    """define a relation type, used to build the instance schema"""
    __permissions__ = PUB_SYSTEM_ENTITY_PERMS
    name = String(required=True, indexed=True, internationalizable=True,
                  unique=True, maxsize=64)
    description = RichString(internationalizable=True,
                             description=_('semantic description of this relation type'))
    symmetric = Boolean(description=_('is this relation equivalent in both direction ?'))
    inlined = Boolean(description=_('is this relation physically inlined? you should know what you\'re doing if you are changing this!'))
    fulltext_container = String(description=_('if full text content of subject/object entity '
                                              'should be added to other side entity (the container).'),
                                vocabulary=('', _('subject'), _('object')),
                                maxsize=8, default=None)
    final = Boolean(description=_('automatic'))
Esempio n. 6
0
class AchatFabrication(EntityType):
    date_achat = Date()
    quantite = Int()
    quantite_plusieurs = Boolean(default=False, required=True, description='True if quantite is "plusieurs"')
    parure = SubjectRelation('Parure', cardinality='1*', inlined=True)
    avec_mat = SubjectRelation('FabriqueAvecMat', cardinality='*1')
    remarques = RichString(fulltextindexed=True, default_format='text/rest')
Esempio n. 7
0
class Person(EntityType):
    __unique_together__ = [('nom', 'prenom')]
    nom = String(maxsize=64, fulltextindexed=True, required=True)
    prenom = String(maxsize=64, fulltextindexed=True)
    sexe = String(maxsize=1, default='M')
    promo = String(vocabulary=('bon', 'pasbon'))
    titre = String(maxsize=128, fulltextindexed=True)
    adel = String(maxsize=128)
    ass = String(maxsize=128)
    web = String(maxsize=128)
    tel = Int(__permissions__={
        'read': (),
        'add': ('managers', ),
        'update': ('managers', )
    })
    fax = Int()
    datenaiss = Date()
    test = Boolean()
    salary = Float()
    travaille = SubjectRelation('Societe',
                                __permissions__={
                                    'read': (),
                                    'add': (),
                                    'delete': ('managers', ),
                                })

    evaluee = SubjectRelation('Note')
Esempio n. 8
0
class Personne(EntityType):
    nom = String(fulltextindexed=True, required=True, maxsize=64)
    prenom = String(fulltextindexed=True, maxsize=64)
    sexe = String(maxsize=1,
                  default='M',
                  __permissions__={
                      'read': (
                          'managers',
                          'users',
                          'guests',
                      ),
                      'add': ('managers', 'users'),
                      'update': ('managers', )
                  })
    promo = String(vocabulary=('bon', 'pasbon'))
    titre = String(fulltextindexed=True, maxsize=128)
    ass = String(maxsize=128)
    web = String(maxsize=128)
    tel = Int()
    fax = Int()
    datenaiss = Datetime()
    tzdatenaiss = TZDatetime()
    test = Boolean()
    description = String()
    salary = Float()
    travaille = SubjectRelation('Societe')
Esempio n. 9
0
class Personne(EntityType):
    __permissions__ = {
        'read':   ('managers', 'users'), # 'guests' was removed
        'add':    ('managers', 'users'),
        'update': ('managers', 'owners'),
        'delete': ('managers', 'owners')
    }
    __unique_together__ = [('nom', 'prenom', 'datenaiss')]
    nom    = String(fulltextindexed=True, required=True, maxsize=64)
    prenom = String(fulltextindexed=True, maxsize=64)
    civility   = String(maxsize=1, default='M', fulltextindexed=True)
    promo  = String(vocabulary=('bon','pasbon', 'pasbondutout'))
    titre  = String(fulltextindexed=True, maxsize=128)
    adel   = String(maxsize=128)
    ass    = String(maxsize=128)
    web    = String(maxsize=128)
    tel    = Int()
    fax    = Int()
    datenaiss = Datetime()
    test   = Boolean()

    travaille = SubjectRelation('Societe')
    concerne = SubjectRelation('Affaire')
    concerne2 = SubjectRelation(('Affaire', 'Note'), cardinality='1*')
    connait = SubjectRelation('Personne', symmetric=True)
Esempio n. 10
0
class Personne(EntityType):
    __permissions__ = {
        'read': ('managers', 'users', 'guests'),  # 'guests' will be removed
        'add': ('managers', 'users'),
        'update': ('managers', 'owners'),
        'delete': ('managers', 'owners')
    }
    __unique_together__ = [('nom', 'prenom', 'inline2')]
    nom = String(fulltextindexed=True, required=True, maxsize=64)
    prenom = String(fulltextindexed=True, maxsize=64)
    sexe = String(maxsize=1, default='M', fulltextindexed=True)
    promo = String(vocabulary=('bon', 'pasbon'))
    titre = String(fulltextindexed=True, maxsize=128)
    adel = String(maxsize=128)
    ass = String(maxsize=128)
    web = String(maxsize=128)
    tel = Int()
    fax = Int()
    datenaiss = Datetime()
    tzdatenaiss = TZDatetime()
    test = Boolean(
        __permissions__={
            'read': ('managers', 'users', 'guests'),
            'add': ('managers', ),
            'update': ('managers', ),
        })
    description = String()
    firstname = String(fulltextindexed=True, maxsize=64)

    concerne = SubjectRelation('Affaire')
    connait = SubjectRelation('Personne')
    inline2 = SubjectRelation('Affaire', inlined=True, cardinality='?*')
Esempio n. 11
0
class ExternalFile(EntityType):
    """ An external resource file (e.g. an absolute/relative filepath).

    If not absolute_path, use the data_filepath of the study
    """
    identifier = String(required=True, maxsize=256, unique=True)
    name = String(maxsize=256)
    absolute_path = Boolean(default=True)
    filepath = String(required=True, indexed=True, maxsize=256)
Esempio n. 12
0
class CWEType(EntityType):
    """define an entity type, used to build the instance schema"""
    __permissions__ = PUB_SYSTEM_ENTITY_PERMS
    name = String(required=True, indexed=True, internationalizable=True,
                  unique=True, maxsize=64)
    description = RichString(internationalizable=True,
                             description=_('semantic description of this entity type'))
    # necessary to filter using RQL
    final = Boolean(default=False, description=_('automatic'))
Esempio n. 13
0
class MateriauxParure(EntityType):
    type_mesure = String(vocabulary=_TYPES_MESURE,
                         fulltextindexed=True)
    quantite = Float()
    unite = String(maxsize=255, fulltextindexed=True)
    provenance_mesure = String(maxsize=255, fulltextindexed=True)
    conversion=Float()
    materiaux_achete = Boolean(required=True, default=False)
    materiaux = SubjectRelation('Materiaux', cardinality='1*',  inlined=True)
    usage = String(maxsize=255, fulltextindexed=True)
Esempio n. 14
0
class AchatMateriaux(EntityType):
    date_achat = Date()
    type_mesure = String(vocabulary=_TYPES_MESURE,
                         fulltextindexed=True)
    quantite = Float()
    quantite_plusieurs = Boolean(default=False, required=True, description='True if quantite is "plusieurs"')
    unite = String(maxsize=255, fulltextindexed=True)
    provenance_mesure = String(maxsize=255, fulltextindexed=True)
    conversion = Float()
    materiaux = SubjectRelation('Materiaux', cardinality='1*', inlined=True)
    remarques = RichString(fulltextindexed=True, default_format='text/rest')
Esempio n. 15
0
class Intervenant(EntityType): # MLIntervenant
    intervenant = SubjectRelation('Personne', cardinality='1*', composite='object', inlined=True)
    indemnite = Int()
    nb_moyen_transport = Int()
    moyen_transport = String(maxsize=255, fulltextindexed=True)
    prix_transport = SubjectRelation('Prix', cardinality='??')
    nombre_valets = Int()
    prix_valet = SubjectRelation('Prix', cardinality='??')
    duree = Int() # XXX
    payeur = Boolean(default=False, required=True)
    pris = Boolean(default=False, required=True)
    commandement = Boolean(default=False, required=True)
    relation_de = Boolean(default=False, required=True)
    donne_par = Boolean()
    par_la_main = Boolean()
    present = Boolean()
    delivre_a = Boolean()
    fait_compte_avec  = Boolean()
Esempio n. 16
0
class Travail(EntityType):
    artisan = SubjectRelation('Personne', cardinality='1*', composite='object', inlined=True)
    salaire_argent = SubjectRelation('Prix', cardinality='??', inlined=True, composite='subject')
    salaire_nature_qt = Int()
    salaire_nature_obj = String(maxsize=64, fulltextindexed=True)
    nombre_aides = Int()
    designation_aides = String(maxsize=64, fulltextindexed=True)
    salaire_aides = SubjectRelation('Prix', cardinality='??', inlined=True, composite='subject')
    tache = String(maxsize=255, fulltextindexed=True)
    duree = Int()
    date_travail = Date()
    remarques = RichString(fulltextindexed=True, default_format='text/rest')
    facon_et_etoffe = Boolean(default=False, required=True)
Esempio n. 17
0
class Frozable(EntityType):
    __permissions__ = {
        'read':   ('managers', 'users'),
        'add':    ('managers', 'users'),
        'update': ('managers', ERQLExpression('X frozen False'),),
        'delete': ('managers', ERQLExpression('X frozen False'),)
    }
    name = String()
    frozen = Boolean(default=False,
                     __permissions__ = {
                         'read':   ('managers', 'users'),
                         'add':    ('managers', 'users'),
                         'update': ('managers', 'owners')
                         })
Esempio n. 18
0
class Eetype(EntityType):
    """define an entity type, used to build the application schema"""
    __permissions__ = {
        'read': (
            'managers',
            'users',
            'guests',
        ),
        'add': ('managers', ),
        'delete': ('managers', ),
        'update': (
            'managers',
            'owners',
        ),
    }
    name = String(required=True,
                  indexed=True,
                  internationalizable=True,
                  constraints=[UniqueConstraint(),
                               SizeConstraint(64)])
    description = String(fulltextindexed=True)
    meta = Boolean()
    final = Boolean()
Esempio n. 19
0
class Personne(EntityType):
    identite = String(maxsize=255, required=True, fulltextindexed=True, indexed=True)
    nom = String(maxsize=64, fulltextindexed=True)
    surnom = String(maxsize=64, fulltextindexed=True)
    diminutif = String(maxsize=64, fulltextindexed=True)
    #occupation = String(maxsize=30, default='inconnue', required=True, fulltextindexed=True)
    titre = String(maxsize=128, fulltextindexed=True)
    sexe = String(vocabulary=['M', 'F', '?'], required=True, default='M')
    ville_domicile = String(maxsize=255, fulltextindexed=True) # XXX
    ville_origine = String(maxsize=255, fulltextindexed=True) # XXX
    lieu_domicile = SubjectRelation('Lieu', cardinality='?*', inlined=True)
    lieu_origine = SubjectRelation('Lieu', cardinality='?*', inlined=True)
    remarques= RichString(fulltextindexed=True, default_format='text/rest')
    rattachement = String(maxsize=64, fulltextindexed=True)
    #maj_occupation= Boolean(default=True)
    base_paradox = Boolean(default=False, description='vient de la base Paradox')
Esempio n. 20
0
class Note(Para):
    __specializes_schema__ = True

    __permissions__ = {'read':   ('managers', 'users', 'guests',),
                   'update': ('managers', 'owners',),
                   'delete': ('managers', ),
                   'add':    ('managers',
                              ERQLExpression('X ecrit_part PE, U in_group G, '
                                             'PE require_permission P, P name "add_note", '
                                             'P require_group G'),)}

    whatever = Int(default=0)  # keep it before `date` for unittest_migraction.test_add_attribute_int
    yesno = Boolean(default=False)
    date = Datetime()
    type = String(maxsize=1)
    unique_id = String(maxsize=1, required=True, unique=True)
    mydate = Date(default='TODAY')
    oldstyledefaultdate = Date(default='2013/01/01')
    newstyledefaultdate = Date(default=dt.date(2013, 1, 1))
    shortpara = String(maxsize=11, default='hop', vocabulary=['hop', 'hop hop', 'hop hop hop'])
    ecrit_par = SubjectRelation('Personne', constraints=[RQLConstraint('S concerne A, O concerne A')])
    attachment = SubjectRelation('File')
Esempio n. 21
0
 class MyEntity(EntityType):
     base_arg_b = String()
     base_arg_a = Boolean()
     base_sub = SubjectRelation('MyOtherEntity')
Esempio n. 22
0
class AchatPretPorter(EntityType):
    date_achat = Date()
    quantite = Float()
    quantite_plusieurs = Boolean(default=False, required=True, description='True if quantite is "plusieurs"')
    parure = SubjectRelation('Parure', cardinality='1*', inlined=True)
    remarques = RichString(fulltextindexed=True, default_format='text/rest')