Changeset 517
- Timestamp:
- 08/16/05 13:28:00 (3 years ago)
- Files:
-
- django/trunk/django/core/meta/fields.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/django/core/meta/fields.py
r516 r517 588 588 choices = self.get_choices(include_blank=False) 589 589 return [curry(formfields.SelectMultipleField, size=min(max(len(choices), 5), 15), choices=choices)] 590 590 591 591 def get_m2m_db_table(self, original_opts): 592 592 "Returns the name of the many-to-many 'join' table." 593 593 return '%s_%s' % (original_opts.db_table, self.name) 594 594 595 595 def isValidIDList(self, field_data, all_data): 596 596 "Validates that the value is a valid list of foreign keys" … … 604 604 if len(objects) != len(pks): 605 605 badkeys = [k for k in pks if k not in objects] 606 raise validators.ValidationError, "Please enter valid %s IDs (the value%s %r %s invalid)" % \ 607 (self.verbose_name, len(badkeys) > 1 and 's' or '', len(badkeys) == 1 and badkeys[0] or tuple(badkeys), len(badkeys) == 1 and "is" or "are") 608 606 raise validators.ValidationError, "Please enter valid %s IDs. The value%s %r %s invalid." % \ 607 (self.verbose_name, len(badkeys) > 1 and 's' or '', 608 len(badkeys) == 1 and badkeys[0] or tuple(badkeys), 609 len(badkeys) == 1 and "is" or "are") 610 609 611 class OneToOneField(IntegerField): 610 612 def __init__(self, to, to_field=None, rel_name=None, **kwargs):
