I'm writing custom django commands under my apps management/commands
directory. At the moment I have 6 different files in that directory. Each file has a different command that solves a unique need. However, there are some utilities that are common to all of them. What is the best way to abstract away this common code?
Below is an example:
load_colors
class Command(BaseCommand):def handle(self, *args, **options)....code unique to colorsdef check_validity(self, color)....#code common to both shades and colors
load_shades
class Command(BaseCommand):def handle(self, *args, **options)....#code unique to shadesdef check_validity(self, color)....#code common to both shades and colors