Skip to main content

Billing audit utils

Project description

AUDIT UTILS

Các function dùng để dùng lại ở số lượng lớn audit repos

usages

  1. DatabaseWrapper: thêm database session cho task celery
from audit_utils.database import DatabaseWrapper
from somewhere import BillingDatabaseSession
from somewhere import celery_app

databases_mapping = {"billing": BillingDatabaseSession}

db_wrapper = DatabaseWrapper(databases_mapping)

@celery_app.task(bind=True)  # bind=True is required
@db_wrapper.wraps(databases={"billing"})
def task_name(self, *args, **kwargs):
    result = do_something_with_db(self.billing)
    return result

from billing.audit import ❤️

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

billing_audit-1.0.1.tar.gz (2.2 kB view hashes)

Uploaded Source

Built Distribution

billing_audit-1.0.1-py3-none-any.whl (2.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page