Fixed handling for old style types
This commit is contained in:
		| @@ -12,7 +12,7 @@ from signals import * | ||||
| __all__ = (document.__all__ + fields.__all__ + connection.__all__ + | ||||
|            queryset.__all__ + signals.__all__) | ||||
|  | ||||
| VERSION = (0, 7, 6) | ||||
| VERSION = (0, 7, 7) | ||||
|  | ||||
|  | ||||
| def get_version(): | ||||
|   | ||||
| @@ -121,11 +121,10 @@ class ValidationError(AssertionError): | ||||
| def get_document(name): | ||||
|     doc = _document_registry.get(name, None) | ||||
|     if not doc: | ||||
|         # Possible old style names | ||||
|         end = ".%s" % name | ||||
|         possible_match = [k for k in _document_registry.keys() | ||||
|                           if k.endswith(end)] | ||||
|         if len(possible_match) == 1: | ||||
|         # Possible old style name | ||||
|         end = name.split('.')[-1] | ||||
|         possible_match = [k for k in _document_registry.keys() if k == end] | ||||
|         if len(possible_match) == 1 and end != name: | ||||
|             doc = _document_registry.get(possible_match.pop(), None) | ||||
|     if not doc: | ||||
|         raise NotRegistered(""" | ||||
|   | ||||
		Reference in New Issue
	
	Block a user