cubicweb/dataimport/test/data/schema.py
changeset 11342 62a7100d774b
parent 11057 0b59724cb3f2
equal deleted inserted replaced
11341:bd3cd3691ade 11342:62a7100d774b
    14 # details.
    14 # details.
    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 CubicWeb.  If not, see <http://www.gnu.org/licenses/>.
    17 # with CubicWeb.  If not, see <http://www.gnu.org/licenses/>.
    18 
    18 
    19 from yams.buildobjs import EntityType, String, SubjectRelation
    19 from yams.buildobjs import Bytes, EntityType, String, SubjectRelation
    20 
    20 
    21 from cubicweb.schema import RQLConstraint
    21 from cubicweb.schema import RQLConstraint
    22 
    22 
    23 
    23 
    24 class Personne(EntityType):
    24 class Personne(EntityType):
    25     nom = String(required=True)
    25     nom = String(required=True)
    26     prenom = String()
    26     prenom = String()
    27     enfant = SubjectRelation('Personne', inlined=True, cardinality='?*')
    27     enfant = SubjectRelation('Personne', inlined=True, cardinality='?*')
    28     connait = SubjectRelation('Personne', symmetric=True,
    28     connait = SubjectRelation('Personne', symmetric=True,
    29                               constraints=[RQLConstraint('NOT S identity O')])
    29                               constraints=[RQLConstraint('NOT S identity O')])
       
    30     photo = Bytes()