schemas/base.py
changeset 6957 ffda12be2e9f
parent 6944 0cf10429ad39
child 7399 972ed1843bd8
--- a/schemas/base.py	Wed Feb 09 18:06:13 2011 +0100
+++ b/schemas/base.py	Wed Feb 09 18:06:17 2011 +0100
@@ -21,7 +21,7 @@
 _ = unicode
 
 from yams.buildobjs import (EntityType, RelationType, RelationDefinition,
-                            SubjectRelation, String, Datetime, Password)
+                            SubjectRelation, String, Datetime, Password, Interval)
 from cubicweb.schema import (
     RQLConstraint, WorkflowableEntityType, ERQLExpression, RRQLExpression,
     PUB_SYSTEM_ENTITY_PERMS, PUB_SYSTEM_REL_PERMS, PUB_SYSTEM_ATTR_PERMS)
@@ -258,6 +258,13 @@
                         'read':   ('managers',),
                         'update': ('managers',),
                         })
+    # put this here and not in a subclass even if it's only for some sources
+    # since having subclasses on generic relation (cw_source) double the number
+    # of rdef in the schema, and make ms planning harder since queries solutions
+    # may changes when sources are specified
+    url = String(description=_('URLs from which content will be imported. You can put one url per line'))
+    parser = String(description=_('parser to use to extract entities from content retrieved at given URLs.'))
+    latest_retrieval = Datetime(description=_('latest synchronization time'))
 
 
 ENTITY_MANAGERS_PERMISSIONS = {
@@ -272,6 +279,7 @@
     'delete': ('managers',),
     }
 
+
 class CWSourceHostConfig(EntityType):
     __permissions__ = ENTITY_MANAGERS_PERMISSIONS
     __unique_together__ = [('match_host', 'cw_host_config_of')]