Changeset 5016
- Timestamp:
- 04/17/07 02:08:42 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/django/contrib/databrowse/datastructures.py
r5015 r5016 8 8 from django.utils.text import capfirst 9 9 from django.utils.translation import get_date_formats 10 11 EMPTY_VALUE = '(None)' 10 12 11 13 class EasyModel(object): … … 135 137 # some settings to be imported, and we don't want to do that at the 136 138 # module level. 137 from django.contrib.admin.views.main import EMPTY_CHANGELIST_VALUE138 139 if self.field.rel: 139 140 if isinstance(self.field.rel, models.ManyToOneRel): … … 142 143 return list(getattr(self.instance.instance, self.field.name).all()) 143 144 elif self.field.choices: 144 objs = dict(self.field.choices).get(self.raw_value, EMPTY_ CHANGELIST_VALUE)145 objs = dict(self.field.choices).get(self.raw_value, EMPTY_VALUE) 145 146 elif isinstance(self.field, models.DateField) or isinstance(self.field, models.TimeField): 146 147 if self.raw_value: … … 153 154 objs = capfirst(dateformat.format(self.raw_value, date_format)) 154 155 else: 155 objs = EMPTY_ CHANGELIST_VALUE156 objs = EMPTY_VALUE 156 157 elif isinstance(self.field, models.BooleanField) or isinstance(self.field, models.NullBooleanField): 157 158 objs = {True: 'Yes', False: 'No', None: 'Unknown'}[self.raw_value]
