| 21 | == Interactive vs. Non-Iteractive Fucntions == |
| 22 | * '''Interactive''' = via web browser (html) |
| 23 | * '''Non-Iteractive''' = Sync, import, etc (xml, csv) |
| 24 | |
| 25 | Never do a redirect or create records (the latter is slightly less |
| 26 | 100%) in non-interactive functions. |
| 27 | |
| 28 | All resources should assume to be touched non-interactively at some point (even if just to load test/demo data) |
| 29 | |
| 30 | onaccept & onvalidation are always called by non-interactive functions |
| 31 | |
| 32 | Protect sections within these functions to be only accessed via interactive calls using: |
| 33 | if "_formkey" in request.post_vars: |
| 34 | |
| 35 | |