You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MongoEngine will throw a NotRegistered exception when a user tries to register a delete rule on a Document that hasn't been defined yet. This is because the delete rule is stored directly on the Document class, so attempting to access the Document through get_document throws an exception. Rather than immediately throwing an exception, MongoEngine should just store the delete rule and lazily assign it to the Document once it is defined.
Fixing this issue will allow users to define bi-directional delete rules (this can currently be done by defining delete rules at runtime, but this behavior is not documented well). It also decouples delete rules from import ordering, which created a problem for my project that uses mongoengine.
The text was updated successfully, but these errors were encountered:
MongoEngine will throw a
NotRegistered
exception when a user tries to register a delete rule on a Document that hasn't been defined yet. This is because the delete rule is stored directly on the Document class, so attempting to access the Document throughget_document
throws an exception. Rather than immediately throwing an exception, MongoEngine should just store the delete rule and lazily assign it to the Document once it is defined.Fixing this issue will allow users to define bi-directional delete rules (this can currently be done by defining delete rules at runtime, but this behavior is not documented well). It also decouples delete rules from import ordering, which created a problem for my project that uses mongoengine.
The text was updated successfully, but these errors were encountered: