fix long-waiting symetric typo: should be spelled symmetric. Add auto database migration on schema deserialization
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 05 Feb 2010 11:56:57 +0100
changeset 4467 0e73d299730a
parent 4466 8b0ca7904820
child 4468 f958628cadc1
fix long-waiting symetric typo: should be spelled symmetric. Add auto database migration on schema deserialization
devtools/devctl.py
devtools/fill.py
devtools/test/data/schema.py
doc/book/fr/04-02-schema-definition.fr.txt
entities/schemaobjs.py
goa/doc/devmanual_fr/sect_definition_schema.txt
goa/test/unittest_schema.py
hooks/syncschema.py
hooks/test/unittest_hooks.py
i18n/en.po
i18n/es.po
i18n/fr.po
schemas/base.py
schemas/bootstrap.py
schemaviewer.py
server/migractions.py
server/repository.py
server/rqlannotation.py
server/schemaserial.py
server/session.py
server/sources/rql2sql.py
server/test/data/migratedapp/schema.py
server/test/data/schema.py
server/test/unittest_querier.py
server/test/unittest_rql2sql.py
server/test/unittest_schemaserial.py
test/data/schema.py
test/unittest_entity.py
test/unittest_schema.py
web/views/autoform.py
web/views/primary.py
--- a/devtools/devctl.py	Fri Feb 05 11:54:23 2010 +0100
+++ b/devtools/devctl.py	Fri Feb 05 11:56:57 2010 +0100
@@ -185,7 +185,7 @@
             # XXX also generate "creating ...' messages for actions in the
             # addrelated submenu
     w('# subject and object forms for each relation type\n')
-    w('# (no object form for final or symetric relation types)\n')
+    w('# (no object form for final or symmetric relation types)\n')
     w('\n')
     for rschema in sorted(schema.relations()):
         rtype = rschema.type
@@ -205,7 +205,7 @@
             for subjschema in rschema.subjects():
                 if not subjschema in libsubjects:
                     add_msg(w, rtype, subjschema.type)
-        if not (schema.rschema(rtype).final or rschema.symetric):
+        if not (schema.rschema(rtype).final or rschema.symmetric):
             if rschema not in no_context_rtypes:
                 libobjects = librschema and librschema.objects() or ()
                 for objschema in rschema.objects():
--- a/devtools/fill.py	Fri Feb 05 11:54:23 2010 +0100
+++ b/devtools/fill.py	Fri Feb 05 11:56:57 2010 +0100
@@ -394,7 +394,7 @@
             # for each couple (subjschema, objschema), insert relations
             for subj, obj in rschema.rdefs:
                 sym.add( (subj, obj) )
-                if rschema.symetric and (obj, subj) in sym:
+                if rschema.symmetric and (obj, subj) in sym:
                     continue
                 subjcard, objcard = rschema.rdef(subj, obj).cardinality
                 # process mandatory relations first
--- a/devtools/test/data/schema.py	Fri Feb 05 11:54:23 2010 +0100
+++ b/devtools/test/data/schema.py	Fri Feb 05 11:56:57 2010 +0100
@@ -16,5 +16,5 @@
     severity = String(vocabulary=('important', 'normal', 'minor'), default='normal')
     cost = Int()
     description	= String(maxsize=4096, fulltextindexed=True)
-    identical_to = SubjectRelation('Bug', symetric=True)
+    identical_to = SubjectRelation('Bug', symmetric=True)
 
--- a/doc/book/fr/04-02-schema-definition.fr.txt	Fri Feb 05 11:54:23 2010 +0100
+++ b/doc/book/fr/04-02-schema-definition.fr.txt	Fri Feb 05 11:56:57 2010 +0100
@@ -177,7 +177,7 @@
   à la relation. Cela se limite donc aux relations dont la cardinalité
   sujet->relation->objet vaut 0..1 ('?') ou 1..1 ('1')
 
-* `symetric` : booléen indiquant que la relation est symétrique. i.e.
+* `symmetric` : booléen indiquant que la relation est symétrique. i.e.
   `X relation Y` implique `Y relation X`
 
 Dans le cas de définitions de relations simultanée, `sujet` et `object` peuvent
--- a/entities/schemaobjs.py	Fri Feb 05 11:54:23 2010 +0100
+++ b/entities/schemaobjs.py	Fri Feb 05 11:56:57 2010 +0100
@@ -46,8 +46,8 @@
     def dc_long_title(self):
         stereotypes = []
         _ = self._cw._
-        if self.symetric:
-            stereotypes.append(_('symetric'))
+        if self.symmetric:
+            stereotypes.append(_('symmetric'))
         if self.inlined:
             stereotypes.append(_('inlined'))
         if self.final:
--- a/goa/doc/devmanual_fr/sect_definition_schema.txt	Fri Feb 05 11:54:23 2010 +0100
+++ b/goa/doc/devmanual_fr/sect_definition_schema.txt	Fri Feb 05 11:56:57 2010 +0100
@@ -168,7 +168,7 @@
   à la relation. Cela se limite donc aux relations dont la cardinalité
   sujet->relation->objet vaut 0..1 ('?') ou 1..1 ('1')
 
-* `symetric` : booléen indiquant que la relation est symétrique, i.e. "X relation
+* `symmetric` : booléen indiquant que la relation est symétrique, i.e. "X relation
    Y" implique "Y relation X"
 
 Dans le cas de définitions de relations simultanée, `sujet` et `object` peuvent
--- a/goa/test/unittest_schema.py	Fri Feb 05 11:54:23 2010 +0100
+++ b/goa/test/unittest_schema.py	Fri Feb 05 11:56:57 2010 +0100
@@ -44,7 +44,7 @@
                                   'inlined', 'inlined_relation', 'is', 'is_instance_of',
                                   'label', 'last_login_time', 'login',
                                   'mainvars', 'meta', 'modification_date', 'name', 'owned_by', 'pkey', 'primary_email',
-                                  'read_permission', 'require_group', 'state_of', 'surname', 'symetric',
+                                  'read_permission', 'require_group', 'state_of', 'surname', 'symmetric',
                                   'synopsis', 'talks_about', 'title', 'to_state', 'transition_of',
                                   'update_permission', 'use_email', 'value')))
 
--- a/hooks/syncschema.py	Fri Feb 05 11:54:23 2010 +0100
+++ b/hooks/syncschema.py	Fri Feb 05 11:56:57 2010 +0100
@@ -897,7 +897,7 @@
                              description=entity.get('description'),
                              meta=entity.get('meta', False),
                              inlined=entity.get('inlined', False),
-                             symetric=entity.get('symetric', False),
+                             symmetric=entity.get('symmetric', False),
                              eid=entity.eid)
         MemSchemaCWRTypeAdd(self._cw, rtype)
 
@@ -919,7 +919,7 @@
         entity = self.entity
         rschema = self._cw.vreg.schema.rschema(entity.name)
         newvalues = {}
-        for prop in ('meta', 'symetric', 'inlined'):
+        for prop in ('meta', 'symmetric', 'inlined'):
             if prop in entity:
                 newvalues[prop] = entity[prop]
         if newvalues:
--- a/hooks/test/unittest_hooks.py	Fri Feb 05 11:54:23 2010 +0100
+++ b/hooks/test/unittest_hooks.py	Fri Feb 05 11:56:57 2010 +0100
@@ -302,7 +302,7 @@
         # schema should be update on insertion (after commit)
         eeid = self.execute('INSERT CWEType X: X name "Societe2", X description "", X final FALSE')[0][0]
         self._set_perms(eeid)
-        self.execute('INSERT CWRType X: X name "concerne2", X description "", X final FALSE, X symetric FALSE')
+        self.execute('INSERT CWRType X: X name "concerne2", X description "", X final FALSE, X symmetric FALSE')
         self.failIf(schema.has_entity('Societe2'))
         self.failIf(schema.has_entity('concerne2'))
         # have to commit before adding definition relations
--- a/i18n/en.po	Fri Feb 05 11:54:23 2010 +0100
+++ b/i18n/en.po	Fri Feb 05 11:56:57 2010 +0100
@@ -3486,11 +3486,11 @@
 msgid "surname"
 msgstr ""
 
-msgid "symetric"
+msgid "symmetric"
 msgstr ""
 
 msgctxt "CWRType"
-msgid "symetric"
+msgid "symmetric"
 msgstr ""
 
 msgid "system entities"
--- a/i18n/es.po	Fri Feb 05 11:54:23 2010 +0100
+++ b/i18n/es.po	Fri Feb 05 11:56:57 2010 +0100
@@ -3585,11 +3585,11 @@
 msgid "surname"
 msgstr ""
 
-msgid "symetric"
+msgid "symmetric"
 msgstr "simetrico"
 
 msgctxt "CWRType"
-msgid "symetric"
+msgid "symmetric"
 msgstr ""
 
 msgid "system entities"
--- a/i18n/fr.po	Fri Feb 05 11:54:23 2010 +0100
+++ b/i18n/fr.po	Fri Feb 05 11:56:57 2010 +0100
@@ -3609,11 +3609,11 @@
 msgid "surname"
 msgstr "nom de famille"
 
-msgid "symetric"
+msgid "symmetric"
 msgstr "symétrique"
 
 msgctxt "CWRType"
-msgid "symetric"
+msgid "symmetric"
 msgstr "symétrique"
 
 msgid "system entities"
--- a/schemas/base.py	Fri Feb 05 11:54:23 2010 +0100
+++ b/schemas/base.py	Fri Feb 05 11:56:57 2010 +0100
@@ -204,7 +204,7 @@
         'delete': ('managers', 'owners'),
         }
     cardinality = '*1'
-    symetric = True
+    symmetric = True
     # NOTE: the 'object = ExternalUri' declaration will still be mandatory
     #       in the cube's schema.
     object = 'ExternalUri'
@@ -234,7 +234,7 @@
 
 class identical_to(RelationType):
     """identical to"""
-    symetric = True
+    symmetric = True
     __permissions__ = {
         'read':   ('managers', 'users', 'guests',),
         # XXX should have update __permissions__ on both subject and object,
@@ -249,7 +249,7 @@
 
 class see_also(RelationType):
     """generic relation to link one entity to another"""
-    symetric = True
+    symmetric = True
     __permissions__ = {
         'read':   ('managers', 'users', 'guests',),
         'add':    ('managers', RRQLExpression('U has_update_permission S'),),
--- a/schemas/bootstrap.py	Fri Feb 05 11:54:23 2010 +0100
+++ b/schemas/bootstrap.py	Fri Feb 05 11:56:57 2010 +0100
@@ -33,7 +33,7 @@
                   unique=True, maxsize=64)
     description = RichString(internationalizable=True,
                              description=_('semantic description of this relation type'))
-    symetric = Boolean(description=_('is this relation equivalent in both direction ?'))
+    symmetric = Boolean(description=_('is this relation equivalent in both direction ?'))
     inlined = Boolean(description=_('is this relation physically inlined? you should know what you\'re doing if you are changing this!'))
     fulltext_container = String(description=_('if full text content of subject/object entity '
                                               'should be added to other side entity (the container).'),
--- a/schemaviewer.py	Fri Feb 05 11:54:23 2010 +0100
+++ b/schemaviewer.py	Fri Feb 05 11:56:57 2010 +0100
@@ -172,8 +172,8 @@
             stereotypes = []
             if rschema.meta:
                 stereotypes.append('meta')
-            if rschema.symetric:
-                stereotypes.append('symetric')
+            if rschema.symmetric:
+                stereotypes.append('symmetric')
             if rschema.inlined:
                 stereotypes.append('inlined')
             title = Section(children=(title, ' (%s)'%rschema.display_name(self.req)), klass='title')
@@ -199,7 +199,7 @@
                 if (subjtype, objtype) in done:
                     continue
                 done.add((subjtype, objtype))
-                if rschema.symetric:
+                if rschema.symmetric:
                     done.add((objtype, subjtype))
                 data.append(Link(self.eschema_link_url(schema[subjtype]), subjtype))
                 data.append(Link(self.eschema_link_url(schema[objtype]), objtype))
--- a/server/migractions.py	Fri Feb 05 11:54:23 2010 +0100
+++ b/server/migractions.py	Fri Feb 05 11:56:57 2010 +0100
@@ -395,7 +395,7 @@
         current definition:
 
         * description
-        * symetric, meta
+        * symmetric, meta
         * inlined
         * relation definitions if `syncrdefs`
         * permissions if `syncperms`
@@ -482,7 +482,7 @@
         if (subjtype, rschema, objtype) in self._synchronized:
             return
         self._synchronized.add((subjtype, rschema, objtype))
-        if rschema.symetric:
+        if rschema.symmetric:
             self._synchronized.add((objtype, rschema, subjtype))
         confirm = self.verbosity >= 2
         if syncprops:
@@ -764,7 +764,7 @@
                         self.cmd_add_relation_type(rschema.type, False, commit=True)
                         rtypeadded = True
                     # register relation definition
-                    # remember this two avoid adding twice non symetric relation
+                    # remember this two avoid adding twice non symmetric relation
                     # such as "Emailthread forked_from Emailthread"
                     added.append((etype, rschema.type, targettype))
                     self.rqlexecall(ss.rdef2rql(rschema, etype, targettype,
--- a/server/repository.py	Fri Feb 05 11:54:23 2010 +0100
+++ b/server/repository.py	Fri Feb 05 11:56:57 2010 +0100
@@ -1129,7 +1129,7 @@
                                eidfrom=subject, rtype=rtype, eidto=object)
         source.add_relation(session, subject, rtype, object)
         rschema = self.schema.rschema(rtype)
-        session.update_rel_cache_add(subject, rtype, object, rschema.symetric)
+        session.update_rel_cache_add(subject, rtype, object, rschema.symmetric)
         if source.should_call_hooks:
             self.hm.call_hooks('after_add_relation', session,
                                eidfrom=subject, rtype=rtype, eidto=object)
@@ -1144,9 +1144,9 @@
                                eidfrom=subject, rtype=rtype, eidto=object)
         source.delete_relation(session, subject, rtype, object)
         rschema = self.schema.rschema(rtype)
-        session.update_rel_cache_del(subject, rtype, object, rschema.symetric)
-        if rschema.symetric:
-            # on symetric relation, we can't now in which sense it's
+        session.update_rel_cache_del(subject, rtype, object, rschema.symmetric)
+        if rschema.symmetric:
+            # on symmetric relation, we can't now in which sense it's
             # stored so try to delete both
             source.delete_relation(session, object, rtype, subject)
         if source.should_call_hooks:
--- a/server/rqlannotation.py	Fri Feb 05 11:54:23 2010 +0100
+++ b/server/rqlannotation.py	Fri Feb 05 11:56:57 2010 +0100
@@ -23,7 +23,7 @@
     has_text_query = False
     need_distinct = rqlst.distinct
     for rel in rqlst.iget_nodes(Relation):
-        if getrschema(rel.r_type).symetric and not rel.neged(strict=True):
+        if getrschema(rel.r_type).symmetric and not rel.neged(strict=True):
             for vref in rel.iget_nodes(VariableRef):
                 stinfo = vref.variable.stinfo
                 if not stinfo['constnode'] and stinfo['selected']:
@@ -105,7 +105,7 @@
                     # can use N.ecrit_par as principal
                     if (stinfo['selected'] or len(stinfo['relations']) > 1):
                         break
-                elif rschema.symetric and stinfo['selected']:
+                elif rschema.symmetric and stinfo['selected']:
                     break
             joins.add(rel)
         else:
--- a/server/schemaserial.py	Fri Feb 05 11:54:23 2010 +0100
+++ b/server/schemaserial.py	Fri Feb 05 11:56:57 2010 +0100
@@ -113,6 +113,13 @@
                 print sql
                 sqlcu.execute(sql)
         # other table renaming done once schema has been read
+    # 3.6 migration
+    sqlcu.execute("SELECT * FROM cw_CWRType WHERE cw_name='symetric'")
+    if sqlcu.fetchall():
+        sql = dbhelper.sql_rename_col('cw_CWRType', 'cw_symetric', 'cw_symmetric',
+                                      dbhelper.TYPE_MAPPING['Boolean'], True)
+        sqlcu.execute(sql)
+        sqlcu.execute("UPDATE cw_CWRType SET cw_name='symmetric' WHERE cw_name='symetric'")
     sidx = {}
     permsdict = deserialize_ertype_permissions(session)
     schema.reading_from_database = True
@@ -163,9 +170,9 @@
         schema.eschema(stype)._specialized_by.append(etype)
     for eid, rtype, desc, sym, il, ftc in session.execute(
         'Any X,N,D,S,I,FTC WHERE X is CWRType, X name N, X description D, '
-        'X symetric S, X inlined I, X fulltext_container FTC', build_descr=False):
+        'X symmetric S, X inlined I, X fulltext_container FTC', build_descr=False):
         rtype = ybo.RelationType(name=rtype, description=desc,
-                                 symetric=bool(sym), inlined=bool(il),
+                                 symmetric=bool(sym), inlined=bool(il),
                                  fulltext_container=ftc, eid=eid)
         rschema = schema.add_relation_type(rtype)
         sidx[eid] = rschema
@@ -185,7 +192,7 @@
                                       internationalizable=i18n,
                                       default=default, eid=rdefeid)
         rdefs = schema.add_relation_def(rdef)
-        # rdefs can be None on duplicated relation definitions (e.g. symetrics)
+        # rdefs can be None on duplicated relation definitions (e.g. symmetrics)
         if rdefs is not None:
             set_perms(rdefs, permsdict)
     for values in session.execute(
@@ -198,7 +205,7 @@
                                       cardinality=card, order=ord, description=desc,
                                       composite=c,  eid=rdefeid)
         rdefs = schema.add_relation_def(rdef)
-        # rdefs can be None on duplicated relation definitions (e.g. symetrics)
+        # rdefs can be None on duplicated relation definitions (e.g. symmetrics)
         if rdefs is not None:
             set_perms(rdefs, permsdict)
     schema.infer_specialization_rules()
@@ -331,7 +338,7 @@
 def rschema_relations_values(rschema):
     values = _ervalues(rschema)
     values['final'] = rschema.final
-    values['symetric'] = rschema.symetric
+    values['symmetric'] = rschema.symmetric
     values['inlined'] = rschema.inlined
     if HAS_FULLTEXT_CONTAINER:
         if isinstance(rschema.fulltext_container, str):
--- a/server/session.py	Fri Feb 05 11:54:23 2010 +0100
+++ b/server/session.py	Fri Feb 05 11:56:57 2010 +0100
@@ -133,16 +133,16 @@
 
     # relations cache handling #################################################
 
-    def update_rel_cache_add(self, subject, rtype, object, symetric=False):
+    def update_rel_cache_add(self, subject, rtype, object, symmetric=False):
         self._update_entity_rel_cache_add(subject, rtype, 'subject', object)
-        if symetric:
+        if symmetric:
             self._update_entity_rel_cache_add(object, rtype, 'subject', subject)
         else:
             self._update_entity_rel_cache_add(object, rtype, 'object', subject)
 
-    def update_rel_cache_del(self, subject, rtype, object, symetric=False):
+    def update_rel_cache_del(self, subject, rtype, object, symmetric=False):
         self._update_entity_rel_cache_del(subject, rtype, 'subject', object)
-        if symetric:
+        if symmetric:
             self._update_entity_rel_cache_del(object, rtype, 'object', object)
         else:
             self._update_entity_rel_cache_del(object, rtype, 'object', subject)
--- a/server/sources/rql2sql.py	Fri Feb 05 11:54:23 2010 +0100
+++ b/server/sources/rql2sql.py	Fri Feb 05 11:56:57 2010 +0100
@@ -742,7 +742,7 @@
         sqls += self._process_relation_term(relation, rid, lhsvar, lhsconst, 'eid_from')
         sqls += self._process_relation_term(relation, rid, rhsvar, rhsconst, 'eid_to')
         sql = ' AND '.join(sqls)
-        if rschema.symetric:
+        if rschema.symmetric:
             sql = '(%s OR %s)' % (sql, switch_relation_field(sql))
         return sql
 
--- a/server/test/data/migratedapp/schema.py	Fri Feb 05 11:54:23 2010 +0100
+++ b/server/test/data/migratedapp/schema.py	Fri Feb 05 11:56:57 2010 +0100
@@ -102,7 +102,7 @@
     travaille = SubjectRelation('Societe')
     concerne = SubjectRelation('Affaire')
     concerne2 = SubjectRelation(('Affaire', 'Note'), cardinality='1*')
-    connait = SubjectRelation('Personne', symetric=True)
+    connait = SubjectRelation('Personne', symmetric=True)
 
 class Societe(WorkflowableEntityType):
     __permissions__ = {
--- a/server/test/data/schema.py	Fri Feb 05 11:54:23 2010 +0100
+++ b/server/test/data/schema.py	Fri Feb 05 11:56:57 2010 +0100
@@ -118,7 +118,7 @@
     inlined = True
 
 class connait(RelationType):
-    symetric = True
+    symmetric = True
 
 class concerne(RelationType):
     __permissions__ = {
--- a/server/test/unittest_querier.py	Fri Feb 05 11:54:23 2010 +0100
+++ b/server/test/unittest_querier.py	Fri Feb 05 11:56:57 2010 +0100
@@ -559,7 +559,7 @@
         rset = self.execute('CWGroup X ORDERBY N LIMIT 2 OFFSET 2 WHERE X name N')
         self.assertEquals(tuplify(rset.rows), [(3,), (4,)])
 
-    def test_select_symetric(self):
+    def test_select_symmetric(self):
         self.execute("INSERT Personne X: X nom 'machin'")
         self.execute("INSERT Personne X: X nom 'bidule'")
         self.execute("INSERT Personne X: X nom 'chouette'")
@@ -938,7 +938,7 @@
         rset = self.execute('Personne P WHERE P travaille S')
         self.assertEqual(len(rset.rows), 0)
 
-    def test_delete_symetric(self):
+    def test_delete_symmetric(self):
         teid1 = self.execute("INSERT Folder T: T name 'toto'")[0][0]
         teid2 = self.execute("INSERT Folder T: T name 'tutu'")[0][0]
         self.execute('SET X see_also Y WHERE X eid %s, Y eid %s' % (teid1, teid2))
--- a/server/test/unittest_rql2sql.py	Fri Feb 05 11:54:23 2010 +0100
+++ b/server/test/unittest_rql2sql.py	Fri Feb 05 11:56:57 2010 +0100
@@ -1325,7 +1325,7 @@
         rqlst = self._prepare(rql)
         self.assertRaises(BadRQLQuery, self.o.generate, rqlst)
 
-    def test_symetric(self):
+    def test_symmetric(self):
         for t in self._parse(SYMETRIC):
             yield t
 
--- a/server/test/unittest_schemaserial.py	Fri Feb 05 11:54:23 2010 +0100
+++ b/server/test/unittest_schemaserial.py	Fri Feb 05 11:56:57 2010 +0100
@@ -49,8 +49,8 @@
     def test_rschema2rql1(self):
         self.assertListEquals(list(rschema2rql(schema.rschema('relation_type'))),
                              [
-            ('INSERT CWRType X: X description %(description)s,X final %(final)s,X fulltext_container %(fulltext_container)s,X inlined %(inlined)s,X name %(name)s,X symetric %(symetric)s',
-             {'description': u'link a relation definition to its relation type', 'symetric': False, 'name': u'relation_type', 'final' : False, 'fulltext_container': None, 'inlined': True}),
+            ('INSERT CWRType X: X description %(description)s,X final %(final)s,X fulltext_container %(fulltext_container)s,X inlined %(inlined)s,X name %(name)s,X symmetric %(symmetric)s',
+             {'description': u'link a relation definition to its relation type', 'symmetric': False, 'name': u'relation_type', 'final' : False, 'fulltext_container': None, 'inlined': True}),
 
             ('INSERT CWRelation X: X cardinality %(cardinality)s,X composite %(composite)s,X description %(description)s,X ordernum %(ordernum)s,X relation_type ER,X from_entity SE,X to_entity OE WHERE SE name %(se)s,ER name %(rt)s,OE name %(oe)s',
              {'rt': 'relation_type', 'description': u'', 'composite': u'object', 'oe': 'CWRType',
@@ -68,7 +68,7 @@
     def test_rschema2rql2(self):
         self.assertListEquals(list(rschema2rql(schema.rschema('add_permission'))),
                               [
-            ('INSERT CWRType X: X description %(description)s,X final %(final)s,X fulltext_container %(fulltext_container)s,X inlined %(inlined)s,X name %(name)s,X symetric %(symetric)s', {'description': u'core relation giving to a group the permission to add an entity or relation type', 'symetric': False, 'name': u'add_permission', 'final': False, 'fulltext_container': None, 'inlined': False}),
+            ('INSERT CWRType X: X description %(description)s,X final %(final)s,X fulltext_container %(fulltext_container)s,X inlined %(inlined)s,X name %(name)s,X symmetric %(symmetric)s', {'description': u'core relation giving to a group the permission to add an entity or relation type', 'symmetric': False, 'name': u'add_permission', 'final': False, 'fulltext_container': None, 'inlined': False}),
 
             ('INSERT CWRelation X: X cardinality %(cardinality)s,X composite %(composite)s,X description %(description)s,X ordernum %(ordernum)s,X relation_type ER,X from_entity SE,X to_entity OE WHERE SE name %(se)s,ER name %(rt)s,OE name %(oe)s',
              {'rt': 'add_permission', 'description': u'groups allowed to add entities/relations of this type', 'composite': None, 'oe': 'CWGroup', 'ordernum': 3, 'cardinality': u'**', 'se': 'CWAttribute'}),
@@ -89,8 +89,8 @@
     def test_rschema2rql3(self):
         self.assertListEquals(list(rschema2rql(schema.rschema('cardinality'))),
                              [
-            ('INSERT CWRType X: X description %(description)s,X final %(final)s,X fulltext_container %(fulltext_container)s,X inlined %(inlined)s,X name %(name)s,X symetric %(symetric)s',
-             {'description': u'', 'symetric': False, 'name': u'cardinality', 'final': True, 'fulltext_container': None, 'inlined': False}),
+            ('INSERT CWRType X: X description %(description)s,X final %(final)s,X fulltext_container %(fulltext_container)s,X inlined %(inlined)s,X name %(name)s,X symmetric %(symmetric)s',
+             {'description': u'', 'symmetric': False, 'name': u'cardinality', 'final': True, 'fulltext_container': None, 'inlined': False}),
 
             ('INSERT CWAttribute X: X cardinality %(cardinality)s,X defaultval %(defaultval)s,X description %(description)s,X fulltextindexed %(fulltextindexed)s,X indexed %(indexed)s,X internationalizable %(internationalizable)s,X ordernum %(ordernum)s,X relation_type ER,X from_entity SE,X to_entity OE WHERE SE name %(se)s,ER name %(rt)s,OE name %(oe)s',
              {'rt': 'cardinality', 'description': u'subject/object cardinality', 'internationalizable': True, 'fulltextindexed': False, 'ordernum': 5, 'defaultval': None, 'indexed': False, 'cardinality': u'?1', 'oe': 'String', 'se': 'CWAttribute'}),
@@ -123,16 +123,16 @@
     def test_updaterschema2rql1(self):
         self.assertListEquals(list(updaterschema2rql(schema.rschema('relation_type'))),
                              [
-            ('SET X description %(description)s,X final %(final)s,X fulltext_container %(fulltext_container)s,X inlined %(inlined)s,X name %(name)s,X symetric %(symetric)s WHERE X is CWRType, X name %(rt)s',
-             {'rt': 'relation_type', 'symetric': False,
+            ('SET X description %(description)s,X final %(final)s,X fulltext_container %(fulltext_container)s,X inlined %(inlined)s,X name %(name)s,X symmetric %(symmetric)s WHERE X is CWRType, X name %(rt)s',
+             {'rt': 'relation_type', 'symmetric': False,
               'description': u'link a relation definition to its relation type',
               'final': False, 'fulltext_container': None, 'inlined': True, 'name': u'relation_type'})
             ])
 
     def test_updaterschema2rql2(self):
         expected = [
-            ('SET X description %(description)s,X final %(final)s,X fulltext_container %(fulltext_container)s,X inlined %(inlined)s,X name %(name)s,X symetric %(symetric)s WHERE X is CWRType, X name %(rt)s',
-             {'rt': 'add_permission', 'symetric': False,
+            ('SET X description %(description)s,X final %(final)s,X fulltext_container %(fulltext_container)s,X inlined %(inlined)s,X name %(name)s,X symmetric %(symmetric)s WHERE X is CWRType, X name %(rt)s',
+             {'rt': 'add_permission', 'symmetric': False,
               'description': u'core relation giving to a group the permission to add an entity or relation type',
               'final': False, 'fulltext_container': None, 'inlined': False, 'name': u'add_permission'})
             ]
--- a/test/data/schema.py	Fri Feb 05 11:54:23 2010 +0100
+++ b/test/data/schema.py	Fri Feb 05 11:56:57 2010 +0100
@@ -14,7 +14,7 @@
     type = String()
     travaille = SubjectRelation('Societe')
     evaluee = SubjectRelation(('Note', 'Personne'))
-    connait = SubjectRelation('Personne', symetric=True)
+    connait = SubjectRelation('Personne', symmetric=True)
 
 class Societe(EntityType):
     nom = String()
--- a/test/unittest_entity.py	Fri Feb 05 11:54:23 2010 +0100
+++ b/test/unittest_entity.py	Fri Feb 05 11:56:57 2010 +0100
@@ -156,7 +156,7 @@
                               'WHERE X is Personne, X nom AA, X prenom AB, X travaille AC?, AC nom AD, '
                               'AC evaluee AE?, AE modification_date AF'
                               )
-            # testing symetric relation
+            # testing symmetric relation
             Personne.fetch_attrs = ('nom', 'connait')
             self.assertEquals(Personne.fetch_rql(user), 'Any X,AA,AB ORDERBY AA ASC '
                               'WHERE X is Personne, X nom AA, X connait AB?')
--- a/test/unittest_schema.py	Fri Feb 05 11:54:23 2010 +0100
+++ b/test/unittest_schema.py	Fri Feb 05 11:56:57 2010 +0100
@@ -203,7 +203,7 @@
 
                               'read_permission', 'relation_type', 'require_group',
 
-                              'specializes', 'state_of', 'subworkflow', 'subworkflow_exit', 'subworkflow_state', 'surname', 'symetric', 'synopsis',
+                              'specializes', 'state_of', 'subworkflow', 'subworkflow_exit', 'subworkflow_state', 'surname', 'symmetric', 'synopsis',
 
                               'tags', 'timestamp', 'title', 'to_entity', 'to_state', 'transition_of', 'travaille', 'type',
 
--- a/web/views/autoform.py	Fri Feb 05 11:54:23 2010 +0100
+++ b/web/views/autoform.py	Fri Feb 05 11:56:57 2010 +0100
@@ -449,7 +449,7 @@
         options = []
         divid = 'div%s_%s_%s' % (rschema.type, role, entity.eid)
         selectid = 'select%s_%s_%s' % (rschema.type, role, entity.eid)
-        if rschema.symetric or role == 'subject':
+        if rschema.symmetric or role == 'subject':
             targettypes = rschema.objects(entity.e_schema)
             etypes = '/'.join(sorted(etype.display_name(self._cw) for etype in targettypes))
         else:
--- a/web/views/primary.py	Fri Feb 05 11:54:23 2010 +0100
+++ b/web/views/primary.py	Fri Feb 05 11:56:57 2010 +0100
@@ -309,5 +309,5 @@
 
 for attr in ('name', 'final'):
     _pvs.tag_attribute(('CWEType', attr), 'hidden')
-for attr in ('name', 'final', 'symetric', 'inlined'):
+for attr in ('name', 'final', 'symmetric', 'inlined'):
     _pvs.tag_attribute(('CWRType', attr), 'hidden')