query: Add db_name column.

This commit is contained in:
Brett Smith 2021-03-18 16:22:30 -04:00
parent 0d01be68b3
commit ca94ecafb0
2 changed files with 9 additions and 1 deletions

View file

@ -224,6 +224,12 @@ class DBId(DBColumn):
_dtype = int
class DBName(DBColumn):
"""Look up an entity's display name from the database"""
_db_query = "SELECT display_name FROM donor WHERE ledger_entity_id = ?"
_dtype = str
class DBPostal(DBColumn):
"""Look up an entity's postal addresses from the database"""
_db_query = """
@ -444,10 +450,12 @@ class _EnvironmentMixin:
except (OSError, sqlite3.Error):
columns['db_email'] = DBEmail
columns['db_id'] = DBId
columns['db_name'] = DBName
columns['db_postal'] = DBPostal
else:
columns['db_email'] = DBEmail.with_db(db_conn)
columns['db_id'] = DBId.with_db(db_conn)
columns['db_name'] = DBName.with_db(db_conn)
columns['db_postal'] = DBPostal.with_db(db_conn)
rt_credentials = config.rt_credentials()

View file

@ -5,7 +5,7 @@ from setuptools import setup
setup(
name='conservancy_beancount',
description="Plugin, library, and reports for reading Conservancy's books",
version='1.19.5',
version='1.19.6',
author='Software Freedom Conservancy',
author_email='info@sfconservancy.org',
license='GNU AGPLv3+',