code: def query_by_entity_uid(idd, kind=''):
          '''
          Query post2tag by certain post.
          '''
  
          if kind == '':
              return TabPost2Tag.select(
                  TabPost2Tag,
                  TabTag.slug.alias('tag_slug'),
                  TabTag.name.alias('tag_name')
              ).join(
                  TabTag, on=(TabPost2Tag.tag_id == TabTag.uid)
              ).where(
                  (TabPost2Tag.post_id == idd) &
                  (TabTag.kind != 'z')
              ).order_by(
                  TabPost2Tag.order
              )
          return TabPost2Tag.select(
              TabPost2Tag,
              TabTag.slug.alias('tag_slug'),
              TabTag.name.alias('tag_name')
          ).join(TabTag, on=(TabPost2Tag.tag_id == TabTag.uid)).where(
              (TabTag.kind == kind) &
              (TabPost2Tag.post_id == idd)
          ).order_by(
              TabPost2Tag.order
          f query_by_entity_uid(idd, kind=''):
          '''
          Query post2tag by certain post.
          '''
  
          if kind == '':
              return TabPost2Tag.select(
                  TabPost2Tag,
                  TabTag.slug.alias('tag_slug'),
                  TabTag.name.alias('tag_name')
              ).join(
                  TabTag, on=(TabPost2Tag.tag_id == TabTag.uid)
              ).where(
                  (TabPost2Tag.post_id == idd) &
                  (TabTag.kind != 'z')
              ).order_by(
                  TabPost2Tag.order
              )
          return TabPost2Tag.select(
              TabPost2Tag,
              TabTag.slug.alias('tag_slug'),
              TabTag.name.alias('tag_name')
          ).join(TabTag, on=(TabPost2Tag.tag_id == TabTag.uid)).where(
              (TabTag.kind == kind) &
              (TabPost2Tag.post_id == idd)
          ).order_by(
              TabPost2Tag.order
          )
docs: Query post2tag by certain post.