Ticket #13086: choices.diff

File choices.diff, 648 bytes (added by skoom, 15 years ago)

diff patch

  • django/db/models/fields/__init__.py

     
    387387        as SelectField choices for this field."""
    388388        first_choice = include_blank and blank_choice or []
    389389        if self.choices:
     390            if first_choice and first_choice[0][0] in [c[0] for c in self.choices]:
     391                return list(self.choices)
    390392            return first_choice + list(self.choices)
    391393        rel_model = self.rel.to
    392394        if hasattr(self.rel, 'get_related_field'):
Back to Top