code: def create_entity2user(enti_uid, user_id):
          '''
          create entity2user record in the database.
          '''
          record = TabEntity2User.select().where(
              (TabEntity2User.entity_id == enti_uid) & (TabEntity2User.user_id == user_id)
          )
  
          if record.count() > 0:
              record = record.get()
              MEntity2User.count_increate(record.uid, record.count)
          else:
              TabEntity2User.create(
                  uid=tools.get_uuid(),
                  entity_id=enti_uid,
                  user_id=user_id,
                  count=1,
                  timestamp=time.time()
              f create_entity2user(enti_uid, user_id):
          '''
          create entity2user record in the database.
          '''
          record = TabEntity2User.select().where(
              (TabEntity2User.entity_id == enti_uid) & (TabEntity2User.user_id == user_id)
          )
  
          if record.count() > 0:
              record = record.get()
              MEntity2User.count_increate(record.uid, record.count)
          else:
              TabEntity2User.create(
                  uid=tools.get_uuid(),
                  entity_id=enti_uid,
                  user_id=user_id,
                  count=1,
                  timestamp=time.time()
              )
docs: create entity2user record in the database.