mirror of
https://github.com/django/django.git
synced 2025-10-05 00:00:37 +00:00
Changed a whole bunch of places to raise exception instances instead of old-style raising exception classes plus a comma. Good for the future Python 3 conversion
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12180 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
bef891399e
commit
5ceed0a053
46 changed files with 120 additions and 124 deletions
|
@ -94,7 +94,7 @@ class Options(object):
|
|||
|
||||
# Any leftover attributes must be invalid.
|
||||
if meta_attrs != {}:
|
||||
raise TypeError, "'class Meta' got invalid attribute(s): %s" % ','.join(meta_attrs.keys())
|
||||
raise TypeError("'class Meta' got invalid attribute(s): %s" % ','.join(meta_attrs.keys()))
|
||||
else:
|
||||
self.verbose_name_plural = string_concat(self.verbose_name, 's')
|
||||
del self.meta
|
||||
|
@ -274,7 +274,7 @@ class Options(object):
|
|||
for f in to_search:
|
||||
if f.name == name:
|
||||
return f
|
||||
raise FieldDoesNotExist, '%s has no field named %r' % (self.object_name, name)
|
||||
raise FieldDoesNotExist('%s has no field named %r' % (self.object_name, name))
|
||||
|
||||
def get_field_by_name(self, name):
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue