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:
Adrian Holovaty 2005-12-15 00:13:09 +00:00
parent 867fdd5084
commit 8f696be3b7
1 changed files with 6 additions and 6 deletions

View File

@ -39,10 +39,10 @@ string_concat = lazy(string_concat, str)
def manipulator_valid_rel_key(f, self, field_data, all_data):
"Validates that the value is a valid foreign key"
mod = f.rel.to._meta.get_model_module()
klass = f.rel.to
try:
mod.get_object(pk=field_data)
except ObjectDoesNotExist:
klass._default_manager.get_object(pk=field_data)
except klass.DoesNotExist:
raise validators.ValidationError, _("Please enter a valid %s.") % f.verbose_name
def manipulator_validator_unique(f, opts, self, field_data, all_data):