Changeset - 60dbeef3e51e
[Not reviewed]
0 2 0
Lance Edgar (lance) - 2 months ago 2024-08-19 14:36:03
lance@edbob.org
fix: minor tweaks to modernize etc.
2 files changed with 3 insertions and 14 deletions:
0 comments (0 inline, 0 general)
rattail/app.py
Show inline comments
 
@@ -1373,16 +1373,6 @@ class AppHandler(WuttaAppHandler):
 

	
 
        return prettify(field)
 

	
 
    def get_session(self, obj):
 
        """
 
        Returns the SQLAlchemy session with which the given object is
 
        associated.  Simple convenience wrapper around
 
        :func:`sqlalchemy:sqlalchemy.orm.object_session()`.
 
        """
 
        from sqlalchemy import orm
 

	
 
        return orm.object_session(obj)
 

	
 
    def get_runas_user(self, session=None, username=None, required=False):
 
        """
 
        Returns a proper :class:`~rattail.db.model.users.User` object
rattail/db/config.py
Show inline comments
 
@@ -28,6 +28,7 @@ import logging
 
import warnings
 

	
 
from wuttjamaican.util import parse_bool
 
from wuttjamaican.db import get_engines as wutta_get_engines
 
from wuttjamaican.db.conf import make_engine_from_config as wutta_make_engine_from_config
 

	
 
from rattail.exceptions import SQLAlchemyNotInstalled
 
@@ -44,8 +45,7 @@ def get_engines(config, section='rattail.db'):
 
    warnings.warn("rattail.db.config.get_engines() is deprecated; "
 
                  "please use wuttjamaican.db.get_engines() instead",
 
                  DeprecationWarning, stacklevel=2)
 
    from wuttjamaican.db import get_engines
 
    return get_engines(config, section)
 
    return wutta_get_engines(config, section)
 

	
 

	
 
def get_default_engine(config, section='rattail.db'):
 
@@ -56,8 +56,7 @@ def get_default_engine(config, section='rattail.db'):
 
    warnings.warn("rattail.db.config.get_default_engine() is deprecated; "
 
                  "please use wuttjamaican.db.get_engines() instead",
 
                  DeprecationWarning, stacklevel=2)
 
    from wuttjamaican.db import get_engines
 
    return get_engines(config, section).get('default')
 
    return wutta_get_engines(config, section).get('default')
 

	
 

	
 
# TODO: Deprecate/remove this.
0 comments (0 inline, 0 general)