Fixed handling for old style types
This commit is contained in:
parent
9f5ab8149f
commit
653c4259ee
@ -2,6 +2,10 @@
|
||||
Changelog
|
||||
=========
|
||||
|
||||
Changes in 0.7.7
|
||||
================
|
||||
- Fix handling for old style _types
|
||||
|
||||
Changes in 0.7.6
|
||||
================
|
||||
- Unicode fix for repr (MongoEngine/mongoengine#133)
|
||||
|
@ -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("""
|
||||
|
@ -5,7 +5,7 @@
|
||||
%define srcname mongoengine
|
||||
|
||||
Name: python-%{srcname}
|
||||
Version: 0.7.6
|
||||
Version: 0.7.7
|
||||
Release: 1%{?dist}
|
||||
Summary: A Python Document-Object Mapper for working with MongoDB
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user