magic-removal: Removed get_model_module() call in django.db.models.fields
git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@1658 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
867fdd5084
commit
8f696be3b7
|
@ -39,10 +39,10 @@ string_concat = lazy(string_concat, str)
|
||||||
|
|
||||||
def manipulator_valid_rel_key(f, self, field_data, all_data):
|
def manipulator_valid_rel_key(f, self, field_data, all_data):
|
||||||
"Validates that the value is a valid foreign key"
|
"Validates that the value is a valid foreign key"
|
||||||
mod = f.rel.to._meta.get_model_module()
|
klass = f.rel.to
|
||||||
try:
|
try:
|
||||||
mod.get_object(pk=field_data)
|
klass._default_manager.get_object(pk=field_data)
|
||||||
except ObjectDoesNotExist:
|
except klass.DoesNotExist:
|
||||||
raise validators.ValidationError, _("Please enter a valid %s.") % f.verbose_name
|
raise validators.ValidationError, _("Please enter a valid %s.") % f.verbose_name
|
||||||
|
|
||||||
def manipulator_validator_unique(f, opts, self, field_data, all_data):
|
def manipulator_validator_unique(f, opts, self, field_data, all_data):
|
||||||
|
|
Loading…
Reference in New Issue