removed requirement for primary key to be an IntegerField.

fix_request_path_info
mathieusteele 2010-10-14 19:14:58 -07:00
parent 116e2af08b
commit 50b54f5aca
1 changed files with 3 additions and 3 deletions

View File

@ -12,7 +12,7 @@ def _represent_foreign_key(o):
class ShowFieldsAndTypes(object): class ShowFieldsAndTypes(object):
""" model mixin, like ShowFields, but also show field types """ """ model mixin, like ShowFields, but also show field types """
def __repr__(self): def __repr__(self):
out = 'id %d' % (self.pk) out = 'id ' + str(self.pk)
for f in self._meta.fields: for f in self._meta.fields:
if f.name in [ 'id' ] + self.polymorphic_internal_model_fields or 'ptr' in f.name: continue if f.name in [ 'id' ] + self.polymorphic_internal_model_fields or 'ptr' in f.name: continue
out += ', ' + f.name + ' (' + type(f).__name__ + ')' out += ', ' + f.name + ' (' + type(f).__name__ + ')'
@ -26,7 +26,7 @@ class ShowFieldsAndTypes(object):
class ShowFields(object): class ShowFields(object):
""" model mixin that shows the object's class, it's fields and field contents """ """ model mixin that shows the object's class, it's fields and field contents """
def __repr__(self): def __repr__(self):
out = 'id %d, ' % (self.pk) out = 'id ' + str(self.pk) + ', '
for f in self._meta.fields: for f in self._meta.fields:
if f.name in [ 'id' ] + self.polymorphic_internal_model_fields or 'ptr' in f.name: continue if f.name in [ 'id' ] + self.polymorphic_internal_model_fields or 'ptr' in f.name: continue
out += ', ' + f.name out += ', ' + f.name
@ -42,7 +42,7 @@ class ShowFieldTypes(object):
This mixin is already used by default by PolymorphicModel. This mixin is already used by default by PolymorphicModel.
(model mixin that shows the object's class and it's field types) """ (model mixin that shows the object's class and it's field types) """
def __repr__(self): def __repr__(self):
out = self.__class__.__name__ + ': id %d' % (self.pk or - 1) out = self.__class__.__name__ + ': id ' + str(self.pk)
for f in self._meta.fields: for f in self._meta.fields:
if f.name in [ 'id' ] + self.polymorphic_internal_model_fields or 'ptr' in f.name: continue if f.name in [ 'id' ] + self.polymorphic_internal_model_fields or 'ptr' in f.name: continue
out += ', ' + f.name + ' (' + type(f).__name__ + ')' out += ', ' + f.name + ' (' + type(f).__name__ + ')'