Fixed handling for old style types
This commit is contained in:
		| @@ -2,6 +2,10 @@ | |||||||
| Changelog | Changelog | ||||||
| ========= | ========= | ||||||
|  |  | ||||||
|  | Changes in 0.7.7 | ||||||
|  | ================ | ||||||
|  | - Fix handling for old style _types | ||||||
|  |  | ||||||
| Changes in 0.7.6 | Changes in 0.7.6 | ||||||
| ================ | ================ | ||||||
| - Unicode fix for repr (MongoEngine/mongoengine#133) | - Unicode fix for repr (MongoEngine/mongoengine#133) | ||||||
|   | |||||||
| @@ -12,7 +12,7 @@ from signals import * | |||||||
| __all__ = (document.__all__ + fields.__all__ + connection.__all__ + | __all__ = (document.__all__ + fields.__all__ + connection.__all__ + | ||||||
|            queryset.__all__ + signals.__all__) |            queryset.__all__ + signals.__all__) | ||||||
|  |  | ||||||
| VERSION = (0, 7, 6) | VERSION = (0, 7, 7) | ||||||
|  |  | ||||||
|  |  | ||||||
| def get_version(): | def get_version(): | ||||||
|   | |||||||
| @@ -121,11 +121,10 @@ class ValidationError(AssertionError): | |||||||
| def get_document(name): | def get_document(name): | ||||||
|     doc = _document_registry.get(name, None) |     doc = _document_registry.get(name, None) | ||||||
|     if not doc: |     if not doc: | ||||||
|         # Possible old style names |         # Possible old style name | ||||||
|         end = ".%s" % name |         end = name.split('.')[-1] | ||||||
|         possible_match = [k for k in _document_registry.keys() |         possible_match = [k for k in _document_registry.keys() if k == end] | ||||||
|                           if k.endswith(end)] |         if len(possible_match) == 1 and end != name: | ||||||
|         if len(possible_match) == 1: |  | ||||||
|             doc = _document_registry.get(possible_match.pop(), None) |             doc = _document_registry.get(possible_match.pop(), None) | ||||||
|     if not doc: |     if not doc: | ||||||
|         raise NotRegistered(""" |         raise NotRegistered(""" | ||||||
|   | |||||||
| @@ -5,7 +5,7 @@ | |||||||
| %define srcname mongoengine | %define srcname mongoengine | ||||||
|  |  | ||||||
| Name:           python-%{srcname} | Name:           python-%{srcname} | ||||||
| Version:        0.7.6 | Version:        0.7.7 | ||||||
| Release:        1%{?dist} | Release:        1%{?dist} | ||||||
| Summary:        A Python Document-Object Mapper for working with MongoDB | Summary:        A Python Document-Object Mapper for working with MongoDB | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user