Ticket #2463: related.diff
File related.diff, 1.0 KB (added by , 18 years ago) |
---|
-
store/django/django/db/models/fields/__init__.py
289 289 if self.choices: 290 290 return first_choice + list(self.choices) 291 291 rel_model = self.rel.to 292 return first_choice + [(getattr(x, self.rel.get_related_field().attname), str(x)) 293 for x in rel_model._default_manager.complex_filter(self.rel.limit_choices_to)] 292 lst = [] 293 for x in rel_model._default_manager.complex_filter(self.rel.limit_choices_to): 294 if hasattr(self.rel, 'get_related_field'): 295 lst.append((getattr(x, self.rel.get_related_field().attname), str(x))) 296 else: 297 lst.append((x._get_pk_val(), str(x))) 298 return first_choice + lst 294 299 295 300 def get_choices_default(self): 296 301 if self.radio_admin: