dddp/migrations/__init__.py
def truncate(self, app_label, schema_editor, models):
        """Truncate tables."""
        for model_name in models:
            model = '%s_%s' % (app_label, model_name)
            schema_editor.execute(
                'TRUNCATE TABLE %s RESTART IDENTITY CASCADE' % (
                    model.lower(),
                ),
            )
def truncate(self, app_label, schema_editor, models):
        """Truncate tables."""
        for model_name in models:
            model = '%s_%s' % (app_label, model_name)
            schema_editor.execute(
                'TRUNCATE TABLE %s RESTART IDENTITY CASCADE' % (
                    model.lower(),
                ),
            )
Truncate tables.