コード例 #1
0
ファイル: bootstrap.py プロジェクト: zogzog/cubicweb
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'))
コード例 #2
0
ファイル: genomics.py プロジェクト: dgoyard/brainomics2
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)
コード例 #3
0
ファイル: schema.py プロジェクト: gurneyalex/myosotis
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')
コード例 #4
0
ファイル: schema.py プロジェクト: gurneyalex/myosotis
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")
コード例 #5
0
ファイル: bootstrap.py プロジェクト: zogzog/cubicweb
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'))
コード例 #6
0
ファイル: schema.py プロジェクト: gurneyalex/myosotis
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')
コード例 #7
0
ファイル: schema.py プロジェクト: gurneyalex/yams
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')
コード例 #8
0
ファイル: bootstrap.py プロジェクト: zogzog/cubicweb
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'))
コード例 #9
0
ファイル: schema.py プロジェクト: gurneyalex/myosotis
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)
コード例 #10
0
ファイル: schema.py プロジェクト: gurneyalex/myosotis
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')
コード例 #11
0
ファイル: schema.py プロジェクト: gurneyalex/myosotis
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()
コード例 #12
0
ファイル: schema.py プロジェクト: gurneyalex/myosotis
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)
コード例 #13
0
ファイル: State.py プロジェクト: zogzog/cubicweb
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()
コード例 #14
0
ファイル: schema.py プロジェクト: gurneyalex/myosotis
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')
コード例 #15
0
ファイル: schema.py プロジェクト: gurneyalex/myosotis
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')
コード例 #16
0
ファイル: unittest_reader.py プロジェクト: gurneyalex/yams
 class MyEntity(EntityType):
     base_arg_b = String()
     base_arg_a = Boolean()
     base_sub = SubjectRelation('MyOtherEntity')