Ticket #2034: django.core.management.diff

File django.core.management.diff, 527 bytes (added by jpellerin@…, 18 years ago)

Patch to exclude empty statements from sqlinitialdata

  • django/core/management.py

    === django/core/management.py
    ==================================================================
     
    344344    for sql_file in sql_files:
    345345        if os.path.exists(sql_file):
    346346            fp = open(sql_file)
    347             output.extend(sql_expr.findall(fp.read()))
     347            output.extend([ expr for expr in sql_expr.findall(fp.read())
     348                            if expr.strip() ])
    348349            fp.close()
    349350
    350351    return output
Back to Top