some util functions that makes it easier to write Django apps