Re: [web2py] Re: Unexpected behaviour executing a query with DAL and record versioning enabled

2018-03-08 Thread 'Awe' via web2py-users
You wrote: In [4]: query = (test2.type_marker=='object') | (test2.type_marker==None) & (test1.type_marker=='person') ...: In [5]: db().select(db.test.ALL) Out[5]: So in [5] you did not use the query definition, its db() AND the result is 3 Rows, it should be 2! Thats why I asked for the

Re: [web2py] Re: Unexpected behaviour executing a query with DAL and record versioning enabled

2018-03-07 Thread Richard Vézina
That why I think you wrongly initialize you db in the first place while onboarding the record versioning feature... Please try on your side to create new app drop the model and fixture I include in one of my last email and start web2py shell and launch the various commands of yours... You should

Re: [web2py] Re: Unexpected behaviour executing a query with DAL and record versioning enabled

2018-03-07 Thread Richard Vézina
In [4]: query = (test2.type_marker=='object') | (test2.type_marker==None) & (test1.type_marker=='person') ...: In [5]: db().select(db.test.ALL) Out[5]: I did there... Same result... That my point... On Wed, Mar 7, 2018 at 1:47 PM, 'Awe' via web2py-users < web2py@googlegroups.com> wrote:

Re: [web2py] Re: Unexpected behaviour executing a query with DAL and record versioning enabled

2018-03-07 Thread 'Awe' via web2py-users
Hello Richard, you are right, the use case is parent child relation. All I want to point out is if you use this query: "query = (test2.type_marker=='object') | (test2.type_marker==None) & (test1.type_marker=='person')" you do not get the same result with record versioning enabled or disabled.

Re: [web2py] Re: Unexpected behaviour executing a query with DAL and record versioning enabled

2018-03-07 Thread Richard Vézina
I don't get it, I don't understand what is the issue... I just demonstrate that with and without record versioning DAL returns the same set of result which what it should be doing no?? So my understanding of the issue is that you don't get the same query output when record versioning is on and

Re: [web2py] Re: Unexpected behaviour executing a query with DAL and record versioning enabled

2018-03-07 Thread 'Awe' via web2py-users
Hello Richard, have read your post 3 times, but I can't find the right query result. Could you tell me where to find in your test the query which leads to: test1.titletest2.title PeterNone PaulLaptop Thank you. Am Mittwoch, 7. März 2018 17:33:33 UTC+1 schrieb

Re: [web2py] Re: Unexpected behaviour executing a query with DAL and record versioning enabled

2018-03-07 Thread Richard Vézina
Here some tests : *WITH record versioning* In [1]: db(db.test.id < 0).select() Out[1]: In [2]: db(db.test.id > 0).select() Out[2]: In [3]: test1 = db.test.with_alias('test1') In [4]: test2 = db.test.with_alias('test2') In [5]: query = (test2.type_marker=='object') |

Re: [web2py] Re: Unexpected behaviour executing a query with DAL and record versioning enabled

2018-03-07 Thread 'Awe' via web2py-users
Great, many thanks for testing it. Andreas Am Dienstag, 6. März 2018 22:30:59 UTC+1 schrieb Richard: > > Can you make a model definition with a fixture for loading the table, I > will make some test with trunk and various version to determine if it a > regression... Nevermind I just thought you

Re: [web2py] Re: Unexpected behaviour executing a query with DAL and record versioning enabled

2018-03-06 Thread Richard Vézina
Can you make a model definition with a fixture for loading the table, I will make some test with trunk and various version to determine if it a regression... Nevermind I just thought you provide that in the first email... Let me have a look at that... Richard On Mon, Mar 5, 2018 at 2:02 PM,

Re: [web2py] Re: Unexpected behaviour executing a query with DAL and record versioning enabled

2018-03-05 Thread 'Awe' via web2py-users
Hello Richard, it is not a problem of deleted or changed records. As shown in the example, there is the table and versioning defined. After that 3 records are inserted and then the query is executed. The defined query: query = (test2.type_marker=='object') | (test2.type_marker==None) &

Re: [web2py] Re: Unexpected behaviour executing a query with DAL and record versioning enabled

2018-03-05 Thread Richard Vézina
Did you set the actual record that have been deleted to is_active = False?? Or all the records that haven't be deleted yet to TRUE?? You have to go in your backend and do an update there UPDATE stored_item SET is_active = TRUE WHERE is_active IS NULL If you didn't delete any record

Re: [web2py] Re: Unexpected behaviour executing a query with DAL and record versioning enabled

2018-03-04 Thread 'Awe' via web2py-users
Hello Richard, many thanks for analyzing. Everything you wrote is completely right. But I still do not understand the behaviour explained before. If you look at the table posted before, all is_acitve Flags are TRUE. to get the result I need, I have defined: query =

Re: [web2py] Re: Unexpected behaviour executing a query with DAL and record versioning enabled

2018-03-02 Thread Richard Vézina
Hmmm... I think that if you have record versioning activated there shouldn't be any is_active row(s) with NULL value... I mean is_active flag is used to determine if the record in the "parent" table has been deleted or not, since you can truely deleted in case you use record versioning feature as