Solved by albanD in post #2 
              
              
                You would need to call this recursively on all the children as well if you want this to work for models with nested Modules. 
You can check the actual implementation here if you’re curious.