Changes between Version 22 and Version 23 of DjangoCheatSheet


Ignore:
Timestamp:
05/11/2011 03:14:48 PM (4 years ago)
Author:
simon@…
Comment:

Added unicode method to data model so that ticket IDs are displayed in admin. # - http://stackoverflow.com/questions/5671826/django-cant-display-model-id-in-change-form

Legend:

Unmodified
Added
Removed
Modified
  • DjangoCheatSheet

    v22 v23  
    4444    case_number = models.IntegerField()
    4545    dollar_amount = models.DecimalField('Cost (in dollars)', max_digits=10, decimal_places=2)
     46
     47    def __unicode__(self):
     48            return u"%s" % self.id
    4649}}}
    4750see: [http://www.djangoproject.com/documentation/model_api/ model api], [http://www.djangoproject.com/documentation/models/ model examples]
Back to Top