When creating a simple model with a non-integer primary key, the Admin interface shows the field as editable, but when making a change, it seems to execute an incorrect query.
For example:
class Group(models.Model):
name = models.CharField(maxlength=32, primary_key=True)
def __str__(self):
return self.name
class Admin:
list_display = ('name',)
search_fields = ('name',)
When changing the primary key field (e.g. from 'Test' to 'TestX') when editing a record, a ProgrammingError exception is raised. The SQL that is generated is:
UPDATE "config_group" SET WHERE "name"='Test'
This is missing the primary key field to be changed after SET.
This is with the latest SVN code. It seems to be an issue around line 179 of db/models/base.py where it only adds the non-pk columns after SET.