Django

Code

Changeset 517

Show
Ignore:
Timestamp:
08/16/05 13:28:00 (3 years ago)
Author:
adrian
Message:

Small formatting change to validation error in [516], to be consistent with other validation errors.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/core/meta/fields.py

    r516 r517  
    588588            choices = self.get_choices(include_blank=False) 
    589589            return [curry(formfields.SelectMultipleField, size=min(max(len(choices), 5), 15), choices=choices)] 
    590              
     590 
    591591    def get_m2m_db_table(self, original_opts): 
    592592        "Returns the name of the many-to-many 'join' table." 
    593593        return '%s_%s' % (original_opts.db_table, self.name) 
    594         
     594 
    595595    def isValidIDList(self, field_data, all_data): 
    596596        "Validates that the value is a valid list of foreign keys" 
     
    604604        if len(objects) != len(pks): 
    605605            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 
    609611class OneToOneField(IntegerField): 
    610612    def __init__(self, to, to_field=None, rel_name=None, **kwargs):