'Get a field from a StackedObjectProxy
Always succeeds, even if the proxy has not yet been initialized.
Normally, if the proxy hasn\'t been initialized, a `TypeError` is
raised to indicate a programming error. To avoid crashing on feature
checks that are done too early (e.g., during initial DB set-up of
the pylons environment), this function will instead return `default`
for an uninitialized proxy.
(Initialized proxies ALWAYS return a value, either a set value
or an empty string)'

@staticmethod
def stacked_proxy_safe_get(stacked_proxy, key, default=None):

    try:
        return getattr(stacked_proxy, key)
    except TypeError:
        return default
