Example #1
0
def test_set_glottocode(db):
    c = Connection(DBSession)
    lpk = c.insert(common.Language, id='l', name='Language')
    c.set_glottocode('l', 'abcd1234')
    c.set_glottocode('l', 'abcd1234')
    l = DBSession.query(common.Language).get(lpk)
    assert l.glottocode == 'abcd1234'

    c.set_glottocode('l', 'dcba1234')
    DBSession.expire_all()
    l = DBSession.query(common.Language).get(lpk)
    assert l.glottocode == 'dcba1234'
    c.set_glottocode('l', 'abcd1234')
Example #2
0
def test_set_glottocode(db):
    c = Connection(DBSession)
    lpk = c.insert(common.Language, id='l', name='Language')
    c.set_glottocode('l', 'abcd1234')
    c.set_glottocode('l', 'abcd1234')
    l = DBSession.query(common.Language).get(lpk)
    assert l.glottocode == 'abcd1234'

    c.set_glottocode('l', 'dcba1234')
    DBSession.expire_all()
    l = DBSession.query(common.Language).get(lpk)
    assert l.glottocode == 'dcba1234'
    c.set_glottocode('l', 'abcd1234')
Example #3
0
    def test_set_glottocode(self):
        from clld.db.migration import Connection

        c = Connection(DBSession)
        lpk = c.insert(common.Language, id='l', name='Language')
        c.set_glottocode('l', 'abcd1234')
        c.set_glottocode('l', 'abcd1234')
        l = DBSession.query(common.Language).get(lpk)
        assert l.glottocode == 'abcd1234'

        c.set_glottocode('l', 'dcba1234')
        DBSession.expire_all()
        l = DBSession.query(common.Language).get(lpk)
        assert l.glottocode == 'dcba1234'
        c.set_glottocode('l', 'abcd1234')
Example #4
0
    def test_set_glottocode(self):
        from clld.db.migration import Connection

        c = Connection(DBSession)
        lpk = c.insert(common.Language, id='l', name='Language')
        c.set_glottocode('l', 'abcd1234')
        c.set_glottocode('l', 'abcd1234')
        l = DBSession.query(common.Language).get(lpk)
        assert l.glottocode == 'abcd1234'

        c.set_glottocode('l', 'dcba1234')
        DBSession.expire_all()
        l = DBSession.query(common.Language).get(lpk)
        assert l.glottocode == 'dcba1234'
        c.set_glottocode('l', 'abcd1234')
def upgrade():
    conn = Connection(op.get_bind())
    for lid, glottocode in GLOTTOCODES.items():
        conn.set_glottocode(lid, glottocode)
def upgrade():
    conn = Connection(op.get_bind())
    conn.set_glottocode('19', 'yaku1245')  # Sakha
    conn.set_glottocode('11', 'oldh1241')  # Old High German
    conn.set_glottocode('9', 'west2376')  # Selice Romani
    conn.set_glottocode('17', 'mana1288')  # Manange
def upgrade():
    conn = Connection(op.get_bind())
    for lid, glottocode in GLOTTOCODES.items():
        conn.set_glottocode(lid, glottocode)