MCPcopy Create free account
hub / github.com/aaPanel/BaoTa / table

Method table

class/wptoolkitModel/sqlite_easy.py:1869–1893  ·  view source on GitHub ↗

@name 设置表名(包含前缀) @param table_name 表名 @param is_fullname 是否完整表名(不包含前缀) @return self

(self, table_name, is_fullname=True)

Source from the content-addressed store, hash-verified

1867 return self.table(table_name, False)
1868
1869 def table(self, table_name, is_fullname=True):
1870 '''
1871 @name 设置表名(包含前缀)
1872 @param table_name<string> 表名
1873 @param is_fullname<bool> 是否完整表名(不包含前缀)
1874 @return self
1875 ''&#x27;
1876 m = match_table_name_reg.match(table_name)
1877
1878 if m is None or m.group(1) is None:
1879 raise PanelError('Invalid table name:{}'.format(table_name))
1880
1881 self.__DB_TABLE = m.group(1).strip('`')
1882
1883 # 添加前缀
1884 if not is_fullname and self.__OPT_PREFIX is not None:
1885 self.__DB_TABLE = self.__OPT_PREFIX + self.__DB_TABLE
1886
1887 if m.group(2) is not None:
1888 self.__OPT_ALIAS = m.group(2).strip('`')
1889
1890 # 重置主键字段名
1891 self.__PK = None
1892
1893 return self
1894
1895 # 使用子查询
1896 def from_sub_query(self, sub_query):

Callers 5

nameMethod · 0.95
forkMethod · 0.45
SFunction · 0.45
add_pluginsMethod · 0.45
add_themesMethod · 0.45

Calls 4

PanelErrorClass · 0.90
matchMethod · 0.45
groupMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected