개정판 75551614
issue #563: sym attr code first testing
Change-Id: Ie5e74fcc0ffbae1c7ae6bc9a0f9020ac7637d9d1
DTI_PID/DTI_PID/AppDocData.py | ||
---|---|---|
2165 | 2165 |
# Get a cursor object |
2166 | 2166 |
cursor = conn.cursor() |
2167 | 2167 |
|
2168 |
# delete symbol attribute code table data for deleted symbol attribute |
|
2168 |
# delete symbol attribute code table data for deleted symbol attribute, and backup not edited attribute code table data
|
|
2169 | 2169 |
origin_attrs = self.getSymbolAttribute(type_str) |
2170 | 2170 |
for origin_attr in origin_attrs: |
2171 | 2171 |
remain = False |
... | ... | |
2173 | 2173 |
if str(origin_attr.UID) == attr[0]: |
2174 | 2174 |
remain = True |
2175 | 2175 |
break |
2176 |
if not remain: |
|
2177 |
sql = "delete from SymbolAttributeCodeTable where SymbolAttribute_UID = '{}'".format(origin_attr.UID) |
|
2178 |
cursor.execute(sql) |
|
2176 |
if remain and not attr[-1]: |
|
2177 |
attr[-1] = self.getCodeTable('SymbolAttributeCodeTable', forCheckLineNumber=False, symbol_attribute_uid=origin_attr.UID) |
|
2178 |
|
|
2179 |
sql = "delete from SymbolAttributeCodeTable where SymbolAttribute_UID = '{}'".format(origin_attr.UID) |
|
2180 |
cursor.execute(sql) |
|
2179 | 2181 |
# up to here |
2180 | 2182 |
|
2181 | 2183 |
# update symbol attribute |
... | ... | |
2194 | 2196 |
# update symbol attribute code table data |
2195 | 2197 |
for attr in attrs: |
2196 | 2198 |
if attr[-1]: |
2197 |
sql = "delete from SymbolAttributeCodeTable where SymbolAttribute_UID = '{}'".format(attr[0]) |
|
2198 |
cursor.execute(sql) |
|
2199 |
|
|
2200 | 2199 |
for code in attr[-1]: |
2201 | 2200 |
sql = self.project.database.to_sql( \ |
2202 | 2201 |
"insert into SymbolAttributeCodeTable(UID, Code, Description, Allowables, SymbolAttribute_UID) VALUES(?,?,?,?,?)") |
내보내기 Unified diff