piccolo_api icon indicating copy to clipboard operation
piccolo_api copied to clipboard

Add post save, edit, delete hooks

Open ocervell opened this issue 2 years ago • 10 comments

Fixes:

  • [x] https://github.com/piccolo-orm/piccolo_admin/issues/64
  • [x] https://github.com/piccolo-orm/piccolo_api/issues/162

ocervell avatar Feb 02 '23 12:02 ocervell

Thanks a lot for this - it's looking good 👍

The tests are failing, but it looks like something pretty minor.

dantownsend avatar Feb 02 '23 15:02 dantownsend

Sorry for the slow reply. The tests should pass now when updated from master.

dantownsend avatar Feb 09 '23 18:02 dantownsend

Sorry I cannot commit more time to this at the moment. I might come back to it later ...

ocervell avatar May 08 '23 12:05 ocervell

@ocervell @dantownsend If you both agree, I can make a new PR based on this and fix the linter errors and tests so they can be merged into master (if PR pass review). If not, forget about this comment.

sinisaos avatar May 09 '23 06:05 sinisaos

Sorry I cannot commit more time to this at the moment. I might come back to it later ...

@ocervell No problem - I think it's mostly done, just some final tweaks 👍

@sinisaos Yes, that would be helpful, thanks. I think the only outstanding question (I think it was related to this PR, but maybe not) was I think the POST endpoint returns a list containing the ID instead of just the ID. To change it would be a breaking change, but might make more sense.

dantownsend avatar May 09 '23 11:05 dantownsend

@sinisaos Yes, that would be helpful, thanks.

OK. I will make a new PR based on this PR with linter errors, some typos in the docs and tests fixed.

I think the only outstanding question (I think it was related to this PR, but maybe not) was I think the POST endpoint returns a list containing the ID instead of just the ID. To change it would be a breaking change, but might make more sense.

No, it's not in this PR or any PR. This is mention in issue #211. UPDATE: I just checked and nothing actually breaks (I don't know if you have more complicated projects that could be affected by this change). Only one FastAPI test failed ([{"id": 2}] should be {"id": 2}). Piccolo Admin also works without changes. Hope that helps.

sinisaos avatar May 09 '23 12:05 sinisaos

Any news?

JoshYuJump avatar Oct 11 '23 01:10 JoshYuJump

@JoshYuJump There was a #231 based on this PR with fixed linter errors and tests., but I closed it due to lack of interest in it. Feel free to use the code from that PR and redeploy it, if there is interest in implementing it now.

sinisaos avatar Oct 11 '23 05:10 sinisaos

@JoshYuJump There was a #231 based on this PR with fixed linter errors and tests., but I closed it due to lack of interest in it. Feel free to use the code from that PR and redeploy it, if there is interest in implementing it now.

@sinisaos Thanks your solution, I used the code from the PR, it works fine.

JoshYuJump avatar Oct 11 '23 06:10 JoshYuJump

@JoshYuJump Thanks. Yes, PR works and passes all tests and linter checks and is ready to merge. Feel free to use the code from that PR, you might have better luck and your PR will be merged.

P.S. There are a few more PRs (#145, #160, #226) with interesting features that I closed because they were open for too long and I gave up on them. Check them out if you want and feel free to use the code for your PRs (if you're interested in making PRs) as you might have better luck getting them merged. I think they are good and useful and will make the library better.

sinisaos avatar Oct 11 '23 07:10 sinisaos