| 65 | === Redirection === |
| 66 | Remember that the interactive HTML interface is just one way to access the system. Non-interactive interfaces like Synchronization are also common, as are background interactions like AJAX. |
| 67 | |
| 68 | Therefore be very wary of using Redirection, which should '''never''' be done in Validators, Onaccept or Onvalidation routines & should be done within REST Controllers only with a check: |
| 69 | {{{ |
| 70 | def my_resource(): |
| 71 | """ REST Controller for my_resource """ |
| 72 | |
| 73 | def prep(r): |
| 74 | if r.representation in shn_interactive_formats |
| 75 | redirect ok |
| 76 | ... |
| 77 | }}} |