Ticket #1562: inspect-setnull.2.diff

File inspect-setnull.2.diff, 615 bytes (added by mir@…, 19 years ago)
  • django/core/management.py

    a b def inspectdb(db_name):  
    727727            if att_name == 'id' and field_type == 'AutoField(' and extra_params == {'primary_key': True}:
    728728                continue
    729729
     730            # Handle "null_ok" flag
     731            if row[6]:
     732                extra_params["blank"] = True
     733                if not field_type in ("TextField","CharField"):
     734                    extra_params["null"] = True
     735
    730736            field_desc = '%s = models.%s' % (att_name, field_type)
    731737            if extra_params:
    732738                if not field_desc.endswith('('):
Back to Top