def handle(self, *args, **options):
        try:
            app, model = args[0].split('.')
        except __HOLE__:
            raise CommandError('Expected argument <app>.<model>')

        self.connection = connections['default']

        # XXX: We cant use get_model because its now an abstract model
        # model = get_model(app, model)
        app = get_app(app)
        model = self.get_partitioned_model(app, model)

        num_children = options['num_children']
        shard_range = range(options['shard'], num_children, options['shards'])

        output = self.get_sequences(model, num_children, shard_range)
        output.extend(self.get_children_table_sql(model, [model], num_children, shard_range))

        return u'\n\n'.join(output) + '\n'
dataset/ETHPy150Open disqus/sharding-example/sqlshards/management/commands/sqlpartition.py/Command.handle