Exemplo n.º 1
0
def run_update_cat(*args):
    recs = MPost2Catalog.query_all().naive()
    for rec in recs:
        if rec.tag_kind != 'z':
            print('-' * 40)
            print(rec.uid)
            print(rec.tag_id)
            print(rec.par_id)

            MPost2Catalog.update_field(rec.uid, par_id=rec.tag_id[:2] + "00")
Exemplo n.º 2
0
    def test_query_all(self):
        self.add_message()
        self.add_P2C()
        a = MPost2Catalog.query_all()
        TF = False

        for i in a:
            if i.post_id == self.post_id:
                TF = True

        assert TF
        self.tearDown()
Exemplo n.º 3
0
def run_update_cat(_):
    '''
    Update the catagery.
    '''
    recs = MPost2Catalog.query_all().objects()
    for rec in recs:
        if rec.tag_kind != 'z':
            print('-' * 40)
            print(rec.uid)
            print(rec.tag_id)
            print(rec.par_id)

            MPost2Catalog.update_field(rec.uid, par_id=rec.tag_id[:2] + "00")
Exemplo n.º 4
0
    def test_remove_relation(self):
        self.add_message()
        MPost2Catalog.add_record(self.post_id, self.tag_id)
        MPost2Catalog.remove_relation(self.post_id, self.tag_id)
        a = MPost2Catalog.query_all()
        TF = True

        for i in a:
            if i.post_id == self.post_id:
                TF = False

        assert TF
        self.tearDown()
Exemplo n.º 5
0
 def test_query_all(self):
     MPost2Catalog.query_all()
     assert True