Opened 19 years ago

Closed 19 years ago

#325 closed defect (invalid)

Primary Key as SmallIntegerField

Reported by: Bless Owned by: Adrian Holovaty
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: no UI/UX: no

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 by Adrian Holovaty, 19 years ago

Resolution: invalid
Status: newclosed

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

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