[schema] Add affiliation and extra infos to CWUser
authorVincent Michel <vincent.michel@logilab.fr>
Wed, 17 Jul 2013 13:57:38 +0200
changeset 313 e539166c4e6d
parent 312 e76dfd8c3e9b
child 314 7bef71b7fff3
[schema] Add affiliation and extra infos to CWUser
migration/0.3.0_Any.py
schema.py
--- a/migration/0.3.0_Any.py	Wed Jul 17 13:53:12 2013 +0200
+++ b/migration/0.3.0_Any.py	Wed Jul 17 13:57:38 2013 +0200
@@ -18,5 +18,7 @@
 
 add_relation_type('comments')
 add_relation_type('wiki')
+add_attribute('CWUser', 'affiliation')
+add_attribute('CWUser', 'extra_infos')
 add_cube('registration')
 add_cube('cwbootstrap')
--- a/schema.py	Wed Jul 17 13:53:12 2013 +0200
+++ b/schema.py	Wed Jul 17 13:57:38 2013 +0200
@@ -17,6 +17,7 @@
 # with this program. If not, see <http://www.gnu.org/licenses/>.
 
 """cubicweb-brainomics schema"""
+from cubicweb.schemas.base import CWUser
 from yams.buildobjs import (EntityType, RelationDefinition, SubjectRelation, String, RichString,
                             Int, Float, Boolean)
 
@@ -83,6 +84,11 @@
 AnatomicalRegion.add_relation(SubjectRelation('ScoreValue', cardinality='**'), name='concerned_by')
 ColumnRef.add_relation(SubjectRelation('Assessment', cardinality='1*', inlined=True), name='assessment')
 
+# Extra fields for CWUser
+
+CWUser.add_relation(String(maxsize=512, fulltextindexed=True), name='affiliation')
+CWUser.add_relation(String(maxsize=512, fulltextindexed=True), name='extra_infos')
+
 
 # Comments for entities
 class comments(RelationDefinition):