Why did you replace all the permalink methods with equivalent uses of reverse?  It can cause circular imports.