From dbc8bbfba3591d2ea704673d90e95014765d0f10 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Mon, 14 Jul 2014 21:11:16 -0400 Subject: - allow the compilation rule that gets the formatted name to again have the chance to veto rendering, as the naming convention can make the decision that the name is "none" or not now. --- lib/sqlalchemy/sql/elements.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/sqlalchemy/sql/elements.py') diff --git a/lib/sqlalchemy/sql/elements.py b/lib/sqlalchemy/sql/elements.py index d273d9881..1447787ce 100644 --- a/lib/sqlalchemy/sql/elements.py +++ b/lib/sqlalchemy/sql/elements.py @@ -3209,7 +3209,7 @@ class _defer_name(_truncated_label): """ def __new__(cls, value): if value is None: - return _defer_none_name('_unnamed_') + return _NONE_NAME else: return super(_defer_name, cls).__new__(cls, value) @@ -3217,6 +3217,8 @@ class _defer_name(_truncated_label): class _defer_none_name(_defer_name): """indicate a 'deferred' name that was ultimately the value None.""" +_NONE_NAME = _defer_none_name("_unnamed_") + # for backwards compatibility in case # someone is re-implementing the # _truncated_identifier() sequence in a custom -- cgit v1.2.1