The schema is same for aquariki and dolly3d.
dolly3d - runs on 4.5
aquariki - runs on 4.8
The statement of search from code above:
'SELECT "aquariki"."public"."asset".*, "aquariki"."public"."asset"."code" as "_related_code" FROM "aquariki"."public"."asset" LEFT OUTER JOIN "aquariki"."public"."asset_in_asset" ON "asset"."code" = "asset_in_asset"."parent_asset_code" LEFT OUTER JOIN "aquariki"."public"."asset" ON "asset_in_asset"."parent_asset_code" = "asset"."code" WHERE ("asset"."s_status" != \'retired\' or "asset"."s_status" is NULL) ORDER BY "asset"."name"'
And this is with TACTIC 4.5 with the same schema:
'SELECT "dolly3d"."public"."assets".* FROM "dolly3d"."public"."assets" WHERE ("assets"."s_status" != \'retired\' or "assets"."s_status" is NULL) AND "assets"."code" in (\'ASSETS00377\', \'ASSETS00378\', \'ASSETS00379\', \'ASSETS00380\', \'ASSETS00381\', \'ASSETS00383\', \'ASSETS00384\', \'ASSETS00385\', \'ASSETS00387\', \'ASSETS00388\', \'ASSETS00389\', \'ASSETS00390\', \'ASSETS00391\', \'ASSETS00392\', \'ASSETS00394\', \'ASSETS00395\', \'ASSETS00396\', \'ASSETS00397\', \'ASSETS00398\', \'ASSETS00399\', \'ASSETS00400\', \'ASSETS00401\', \'ASSETS00402\', \'ASSETS00403\', \'ASSETS00404\', \'ASSETS00405\', \'ASSETS00406\', \'ASSETS00407\', \'ASSETS00408\', \'ASSETS00409\', \'ASSETS00410\', \'ASSETS00411\', \'ASSETS00412\', \'ASSETS00415\', \'ASSETS00416\', \'ASSETS00417\', \'ASSETS00418\', \'ASSETS00419\', \'ASSETS00420\', \'ASSETS00421\', \'ASSETS00422\', \'ASSETS00423\', \'ASSETS00425\', \'ASSETS00426\', \'ASSETS00427\', \'ASSETS00435\', \'ASSETS00436\', \'ASSETS00437\', \'ASSETS00438\', \'ASSETS00444\', \'ASSETS00468\', \'ASSETS00479\', \'ASSETS00480\', \'ASSETS00481\', \'ASSETS00497\', \'ASSETS00498\', \'ASSETS00499\', \'ASSETS00500\', \'ASSETS00501\', \'ASSETS00547\', \'ASSETS00548\', \'ASSETS00572\', \'ASSETS00573\', \'ASSETS00579\', \'ASSETS00587\', \'ASSETS00588\', \'ASSETS00601\', \'ASSETS00611\', \'ASSETS00638\', \'ASSETS00640\', \'ASSETS00642\', \'ASSETS00643\', \'ASSETS00655\') ORDER BY "assets"."name"'
As i see it. eval_sobjects = Search.eval("@SOBJECT(dolly3d/assets['assets_category_code', 'characters'])") getting sobjects, then
appends it to search.add_relationship_filters(eval_sobjects, op=op) and everything fine. But TACTIC 4.8 (may be 4.7 or even 4.6) do different things with added relationship.
I will do some camparsion between old and new add_relationship_filters method.
What i getting if i remove <connect from="workflow/asset" to="workflow/asset" instance_type="workflow/asset_in_asset" relationship="instance"/> and everything related to asset_in_asset:
'SELECT "aquariki"."public"."asset".* FROM "aquariki"."public"."asset" WHERE ("asset"."s_status" != \'retired\' or "asset"."s_status" is NULL) AND "asset"."code" in (\'ASSET00002\', \'ASSET00003\', \'ASSET00007\') ORDER BY "asset"."name"'
And this if i only remove these lines from schema and leave aseet-to asset instance line:
<connect from="workflow/asset_in_asset" to="workflow/asset" relationship="code" from_col="parent_code" to_col="code" path="parent" type="many_to_many"/>
<connect from="workflow/asset_in_asset" to="workflow/asset" relationship="code" from_col="search_code" to_col="code" path="child" type="many_to_many"/>
'SELECT "aquariki"."public"."asset".*, "aquariki"."public"."asset"."code" as "_related_code" FROM "aquariki"."public"."asset" WHERE ("asset"."s_status" != \'retired\' or "asset"."s_status" is NULL) ORDER BY "asset"."name"'
Codebase of add_relationship_filters in 4.5 and 4.5 is the same So may be it is scary!! sql.py
The schema for 4.5 Works:
<search_type name="dolly3d/assets" xpos="303" ypos="236"/>
<search_type name="dolly3d/assets_in_assets" xpos="696" ypos="136"/>
<connect from="dolly3d/assets" to="dolly3d/assets" instance_type="dolly3d/assets_in_assets" relationship="instance"/>
<connect from="dolly3d/assets_in_assets" to="dolly3d/assets" relationship="code" from_col="parent_assets_code" to_col="code" path="child" type="many_to_many"/>
<connect from="dolly3d/assets_in_assets" to="dolly3d/assets" relationship="code" from_col="child_assets_code" to_col="code" path="parent" type="many_to_many"/>
<connect from="dolly3d/assets_in_assets" to="dolly3d/assets" relationship="code" from_col="parent_assets_code" to_col="code" type="many_to_many"/>
The schema for 4.8 NOT
<search_type name="tvs/asset" type="manual" xpos="320" ypos="260"/>
<search_type name="tvs/asset_in_asset" type="manual" xpos="320" ypos="320"/>
<connect from="tvs/asset" to="tvs/asset" instance_type="tvs/asset_in_asset" relationship="instance"/>
<connect from="tvs/asset_in_asset" to="tvs/asset" relationship="code" from_col="parent_asset_code" to_col="code" path="child" type="many_to_many"/>
<connect from="tvs/asset_in_asset" to="tvs/asset" relationship="code" from_col="child_asset_code" to_col="code" path="parent" type="many_to_many"/>
<connect from="tvs/asset_in_asset" to="tvs/asset" relationship="code" from_col="parent_asset_code" to_col="code" type="many_to_many"/>
The only difference i see here is type="manual"
Statement for Search('tvs/asset') works as expected before add_relationship_filters:
'SELECT "aquariki"."public"."asset".* FROM "aquariki"."public"."asset" WHERE ("asset"."s_status" != \'retired\' or "asset"."s_status" is NULL) ORDER BY "asset"."name"'
dolly3d - runs on 4.5
aquariki - runs on 4.8
The statement of search from code above:
'SELECT "aquariki"."public"."asset".*, "aquariki"."public"."asset"."code" as "_related_code" FROM "aquariki"."public"."asset" LEFT OUTER JOIN "aquariki"."public"."asset_in_asset" ON "asset"."code" = "asset_in_asset"."parent_asset_code" LEFT OUTER JOIN "aquariki"."public"."asset" ON "asset_in_asset"."parent_asset_code" = "asset"."code" WHERE ("asset"."s_status" != \'retired\' or "asset"."s_status" is NULL) ORDER BY "asset"."name"'
And this is with TACTIC 4.5 with the same schema:
'SELECT "dolly3d"."public"."assets".* FROM "dolly3d"."public"."assets" WHERE ("assets"."s_status" != \'retired\' or "assets"."s_status" is NULL) AND "assets"."code" in (\'ASSETS00377\', \'ASSETS00378\', \'ASSETS00379\', \'ASSETS00380\', \'ASSETS00381\', \'ASSETS00383\', \'ASSETS00384\', \'ASSETS00385\', \'ASSETS00387\', \'ASSETS00388\', \'ASSETS00389\', \'ASSETS00390\', \'ASSETS00391\', \'ASSETS00392\', \'ASSETS00394\', \'ASSETS00395\', \'ASSETS00396\', \'ASSETS00397\', \'ASSETS00398\', \'ASSETS00399\', \'ASSETS00400\', \'ASSETS00401\', \'ASSETS00402\', \'ASSETS00403\', \'ASSETS00404\', \'ASSETS00405\', \'ASSETS00406\', \'ASSETS00407\', \'ASSETS00408\', \'ASSETS00409\', \'ASSETS00410\', \'ASSETS00411\', \'ASSETS00412\', \'ASSETS00415\', \'ASSETS00416\', \'ASSETS00417\', \'ASSETS00418\', \'ASSETS00419\', \'ASSETS00420\', \'ASSETS00421\', \'ASSETS00422\', \'ASSETS00423\', \'ASSETS00425\', \'ASSETS00426\', \'ASSETS00427\', \'ASSETS00435\', \'ASSETS00436\', \'ASSETS00437\', \'ASSETS00438\', \'ASSETS00444\', \'ASSETS00468\', \'ASSETS00479\', \'ASSETS00480\', \'ASSETS00481\', \'ASSETS00497\', \'ASSETS00498\', \'ASSETS00499\', \'ASSETS00500\', \'ASSETS00501\', \'ASSETS00547\', \'ASSETS00548\', \'ASSETS00572\', \'ASSETS00573\', \'ASSETS00579\', \'ASSETS00587\', \'ASSETS00588\', \'ASSETS00601\', \'ASSETS00611\', \'ASSETS00638\', \'ASSETS00640\', \'ASSETS00642\', \'ASSETS00643\', \'ASSETS00655\') ORDER BY "assets"."name"'
As i see it. eval_sobjects = Search.eval("@SOBJECT(dolly3d/assets['assets_category_code', 'characters'])") getting sobjects, then
appends it to search.add_relationship_filters(eval_sobjects, op=op) and everything fine. But TACTIC 4.8 (may be 4.7 or even 4.6) do different things with added relationship.
I will do some camparsion between old and new add_relationship_filters method.
What i getting if i remove <connect from="workflow/asset" to="workflow/asset" instance_type="workflow/asset_in_asset" relationship="instance"/> and everything related to asset_in_asset:
'SELECT "aquariki"."public"."asset".* FROM "aquariki"."public"."asset" WHERE ("asset"."s_status" != \'retired\' or "asset"."s_status" is NULL) AND "asset"."code" in (\'ASSET00002\', \'ASSET00003\', \'ASSET00007\') ORDER BY "asset"."name"'
And this if i only remove these lines from schema and leave aseet-to asset instance line:
<connect from="workflow/asset_in_asset" to="workflow/asset" relationship="code" from_col="parent_code" to_col="code" path="parent" type="many_to_many"/>
<connect from="workflow/asset_in_asset" to="workflow/asset" relationship="code" from_col="search_code" to_col="code" path="child" type="many_to_many"/>
'SELECT "aquariki"."public"."asset".*, "aquariki"."public"."asset"."code" as "_related_code" FROM "aquariki"."public"."asset" WHERE ("asset"."s_status" != \'retired\' or "asset"."s_status" is NULL) ORDER BY "asset"."name"'
Codebase of add_relationship_filters in 4.5 and 4.5 is the same So may be it is scary!! sql.py
The schema for 4.5 Works:
<search_type name="dolly3d/assets" xpos="303" ypos="236"/>
<search_type name="dolly3d/assets_in_assets" xpos="696" ypos="136"/>
<connect from="dolly3d/assets" to="dolly3d/assets" instance_type="dolly3d/assets_in_assets" relationship="instance"/>
<connect from="dolly3d/assets_in_assets" to="dolly3d/assets" relationship="code" from_col="parent_assets_code" to_col="code" path="child" type="many_to_many"/>
<connect from="dolly3d/assets_in_assets" to="dolly3d/assets" relationship="code" from_col="child_assets_code" to_col="code" path="parent" type="many_to_many"/>
<connect from="dolly3d/assets_in_assets" to="dolly3d/assets" relationship="code" from_col="parent_assets_code" to_col="code" type="many_to_many"/>
The schema for 4.8 NOT
<search_type name="tvs/asset" type="manual" xpos="320" ypos="260"/>
<search_type name="tvs/asset_in_asset" type="manual" xpos="320" ypos="320"/>
<connect from="tvs/asset" to="tvs/asset" instance_type="tvs/asset_in_asset" relationship="instance"/>
<connect from="tvs/asset_in_asset" to="tvs/asset" relationship="code" from_col="parent_asset_code" to_col="code" path="child" type="many_to_many"/>
<connect from="tvs/asset_in_asset" to="tvs/asset" relationship="code" from_col="child_asset_code" to_col="code" path="parent" type="many_to_many"/>
<connect from="tvs/asset_in_asset" to="tvs/asset" relationship="code" from_col="parent_asset_code" to_col="code" type="many_to_many"/>
The only difference i see here is type="manual"
Statement for Search('tvs/asset') works as expected before add_relationship_filters:
'SELECT "aquariki"."public"."asset".* FROM "aquariki"."public"."asset" WHERE ("asset"."s_status" != \'retired\' or "asset"."s_status" is NULL) ORDER BY "asset"."name"'