Ticket #13803: 13803.diff

File 13803.diff, 661 bytes (added by hjeffrey, 14 years ago)
  • django/db/backends/creation.py

     
    4141        for f in opts.local_fields:
    4242            col_type = f.db_type(connection=self.connection)
    4343            tablespace = f.db_tablespace or opts.db_tablespace
     44            if f.name == 'pk':
     45                raise AttributeError("Model attribute cannot be named 'pk'")
    4446            if col_type is None:
    4547                # Skip ManyToManyFields, because they're not represented as
    4648                # database columns in this table.
Back to Top