1
0
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:
Florian Apolloner
2012-06-07 17:34:25 +02:00
parent 840ffd80ba
commit e1643e3535
4 changed files with 20 additions and 9 deletions

View File

@@ -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):