2007-08-16 14:06:55 +08:00
|
|
|
from django.core.management.base import AppCommand
|
|
|
|
|
|
|
|
class Command(AppCommand):
|
|
|
|
help = 'Prints the SQL statements for resetting sequences for the given app name(s).'
|
|
|
|
output_transaction = True
|
|
|
|
|
|
|
|
def handle_app(self, app, **options):
|
2007-08-20 08:21:10 +08:00
|
|
|
from django.db import connection, models
|
2008-06-19 22:38:56 +08:00
|
|
|
return u'\n'.join(connection.ops.sequence_reset_sql(self.style, models.get_models(app))).encode('utf-8')
|