diff --git a/schema.py b/schema.py index 3dfd0d4f9513f36e17b4b5793ed54171e102d150_c2NoZW1hLnB5..99e3f9c4f8222fe62dde618f037c10c4c2d74ec8_c2NoZW1hLnB5 100644 --- a/schema.py +++ b/schema.py @@ -1,5 +1,9 @@ from yams.buildobjs import EntityType, String, SubjectRelation -from cubicweb.schema import format_constraint +try: + from yams.buildobjs import RichString +except ImportError: + from cubicweb.schema import RichString + class Blog(EntityType): title = String(maxsize=50, required=True) @@ -3,11 +7,9 @@ class Blog(EntityType): title = String(maxsize=50, required=True) - description_format = String(meta=True, internationalizable=True, maxsize=50, - default='text/rest', constraints=[format_constraint]) - description = String() + description = RichString() rss_url = String(maxsize=128, description=_('blog\'s rss url (useful for when using external site such as feedburner)')) class BlogEntry(EntityType): title = String(required=True, fulltextindexed=True, maxsize=256) @@ -9,9 +11,7 @@ rss_url = String(maxsize=128, description=_('blog\'s rss url (useful for when using external site such as feedburner)')) class BlogEntry(EntityType): title = String(required=True, fulltextindexed=True, maxsize=256) - content_format = String(meta=True, internationalizable=True, maxsize=50, - default='text/rest', constraints=[format_constraint]) - content = String(required=True, fulltextindexed=True) + content = RichString(required=True, fulltextindexed=True) entry_of = SubjectRelation('Blog', cardinality='**')