Commit efb68fc1 authored by Nicolas Chauvat's avatar Nicolas Chauvat
Browse files

[schema] refactor to define relations the new way (cw > 3.8)

parent 8589be6583ff
......@@ -7,7 +7,7 @@
:license: GNU Lesser General Public License, v2.1 - http://www.gnu.org/licenses
"""
from yams.buildobjs import EntityType, String, Datetime, SubjectRelation, Int
from yams.buildobjs import EntityType, String, Datetime, RelationDefinition, Int
class ClassifiedAd(EntityType):
title = String(required=True, fulltextindexed=True)
......@@ -16,5 +16,11 @@ class ClassifiedAd(EntityType):
url = String()
price = Int()
currency = String(default='EUR')
same_as = SubjectRelation('ExternalUri')
has_image = SubjectRelation('ExternalUri')
class same_as(RelationDefinition):
subject = 'ClassifiedAd'
object = 'ExternalUri'
class has_image(RelationDefinition):
subject = 'ClassifiedAd'
object = 'ExternalUri'
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment