Closed neara closed 10 years ago
Hi! Thanks for report it!
Commenting this code is not a good solution. It should create some abstraction for transaction management with distinct api's. I will fix it as sooner as possible!
I'm getting the same error with django 1.6. Many thanks for working on it @niwibe !
I just commited a fix: https://github.com/niwibe/djorm-ext-pgfulltext/commit/d3db806e2cee3fc848ab2b9d13a7f86d75b21690
Can you test if it works properly before release a new version with a fix? A lot of thanks.
Works nicely. Admin works ok (saving/creating), all my tests pass as well. So far, don't see any problem ;) Thank you for the fix!
Work like a charm! Thank you.
:+1:
Since django 1.6, the orm submits all sql queries when they are called.
I didn't have any problems when working with the model, that has search field, outside of admin, but in admin, django enforces atomic validation and saving the model would fail with Transaction management error
This error lead me to think that something was trying to manage the transaction and/or open new transaction, while the current block is active.
I took the liberty of diving into the code, changing update_search_field() in SearchManagerMixin, fixed this issue. These are the changes i introduced:
I am not an expert on transaction management, but doing this made it all work in django admin. I also checked, and indeed the search_field is being updated as it should.
I didn't send you a pull request with this, as i am not 100% sure this is the proper way to solve this.
What do you think?