mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Don't escape object ids when passing to the contenttypes.shortcut view.
This commit also changes the string pk to string_pk instead of id, to test if the admin uses .pk throughout the codebase.
This commit is contained in:
@@ -93,10 +93,13 @@ class CustomArticle(models.Model):
|
||||
|
||||
|
||||
class ModelWithStringPrimaryKey(models.Model):
|
||||
id = models.CharField(max_length=255, primary_key=True)
|
||||
string_pk = models.CharField(max_length=255, primary_key=True)
|
||||
|
||||
def __unicode__(self):
|
||||
return self.id
|
||||
return self.string_pk
|
||||
|
||||
def get_absolute_url(self):
|
||||
return u'/dummy/%s/' % self.string_pk
|
||||
|
||||
|
||||
class Color(models.Model):
|
||||
|
||||
Reference in New Issue
Block a user