No cheat codes exist to unlock all characters in Lego Battles (DS).
Progression relies entirely on collecting Gold Bricks by completing missions, challenges, and finding secrets. There is no shortcut to bypass this grind.
Online guides may offer tips to earn Gold Bricks faster, but nothing unlocks everything instantly.