Closed singleton11 closed 7 years ago
@@ master #57 diff @@
==========================================
Files 12 13 +1
Lines 631 707 +76
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 286 388 +102
+ Misses 345 319 -26
Partials 0 0
Powered by Codecov. Last update 61debd4...06e26a0
Added possibility to make validation before move node in admin through can_be_moved
method of PolymorphicMPTTModel
overriding. This method calls in admin, and if there are exceptions during execution, error response returns
Thanks for this wonderful work!
@singleton11 I do wonder, is can_be_moved()
needed? For example, there is already can_have_children()
which does about the same thing. Where are you using that hook for?
I've also merged some other fixes, so please merge/rebase before you add a new fix ;-)
@singleton11 FYI, I've renamedcan_move_to()
to validate_move_to()
Since we can limit the children types now, would you still need validate_move_to()
to exist?
Thanks for letting me know!
@vdboor, I promise, I will send different features as separate PRs next time ;-)
mptt doesn't call clean()
to check, if validation error occurs, when move_to()
executed.
Yes, I need to do clean()
before moving. Hovewer it's not a django-polymorhic-tree
problem, therefore I made this hook. I don't know where to add clean()
calling in django-mptt
If PolymorphicTreeForeignKey field name has name which different from 'parent' there was an error in admin Added test for case above Actualized tox and travis configs Added step-by-step instruction to readme how to run tests Adjusted supported version list in readme