Opened 10 years ago

Closed 10 years ago

#325 closed defect (invalid)

Primary Key as SmallIntegerField

Reported by: Bless Owned by: adrian
Component: Database layer (models, ORM) Version: 1.0
Severity: minor Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

I tried change the value of Primary Key in my model:


meta.PositiveSmallIntegerField('id', primary_key=True),
I tried also:
meta.SmallIntegerField('id', primary_key=True),

but both fail.

>>> p.save()
>>> p.id
''
>>> 

So it isn't possible change the value of the Primary key, and its value is an integer.
I think that it's a value large for store a bit of registers.

Change History (1)

comment:1 Changed 10 years ago by adrian

  • Resolution set to invalid
  • Status changed from new to closed

Django can't auto-set your ID unless it's an AutoField.

Note: See TracTickets for help on using tickets.
Back to Top