Changeset 3851
- Timestamp:
- 09/26/06 01:33:32 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/django/db/models/fields/__init__.py
r3844 r3851 6 6 from django.core.exceptions import ObjectDoesNotExist 7 7 from django.utils.functional import curry 8 from django.utils.itercompat import tee 8 9 from django.utils.text import capfirst 9 10 from django.utils.translation import gettext, gettext_lazy … … 81 82 self.unique_for_date, self.unique_for_month = unique_for_date, unique_for_month 82 83 self.unique_for_year = unique_for_year 83 self. choices = choices or []84 self._choices = choices or [] 84 85 self.radio_admin = radio_admin 85 86 self.help_text = help_text … … 324 325 def bind(self, fieldmapping, original, bound_field_class): 325 326 return bound_field_class(self, fieldmapping, original) 327 328 def _get_choices(self): 329 if hasattr(self._choices, 'next'): 330 choices, self._choices = tee(self._choices) 331 return choices 332 else: 333 return self._choices 334 choices = property(_get_choices) 326 335 327 336 class AutoField(Field):
