These functions are the ones that I used in the tma_admin app. I'll commit the file and then I'll start actually writing the functions for the public site.