qwat-data-model
qwat-data-model copied to clipboard
Fix orientation of element part when updating pipe or element part
Description
When user wants to connect an element part to a pipe, orientation of the element is wrong, fixing angle to 0 or some wrong value.
Before
After
To do so, I fixed the node taken into account when updating pipe in trigger (NEW instead of OLD).
Then, for the element part update, I need to call a function in auto-generated trigger qwat_od.ft_element_part_update
. So I have created a custom_update
in ordinary_data/views/inheritance/od_all_inheritance.py
and I wanted to handle it in ordinary_data/views/inheritance/pg_inheritance_view_recursive.py
in sql_join_update_trigger
method (as there is the same thing with custom_delete
). But I have an error when I try to generate views :
/QWAT/data-model/ordinary_data/views/insert_views.sh: ligne 15: /usr/bin/psql: Liste d'arguments trop longue
So I am wondering how I can add an argument, something is missing but I can't find what... @3nids I need some help to understand how to add custom code in auto-generated triggers.
Thanks
I am not sure for the custom function. Sylvain originally wrote the Python code, and I am not really familiar with the code.
It was the right way to add custom code in generated trigger, but I had two ;;
generated. One in od_all_inheritance.py
and one in fn_element_part_set_orientation.sql
:facepalm:
Since CI is functionnal again, I would try to get this fixed if possible.
@kandre can you follow this?
@benoitblanc we need a delta and a test here, could you provide it?
Test should be based on similar testing from @sylvainbeo mentionned by @3nids
@ponceta I have rebased this branch on master, added deltas and added one test to update orientation by moving a node of a pipe.
Thank you @benoitblanc this is great!