semvec/pypi-packages huggingface dataset:
django-model-audit 0.1.9
A simple Django app to manage history of models.
License: BSD License

===========
Audit Trail
===========

Audit trail is a simple Django app to track the database changes and maintain history in any application. It also provide history for many_to_many fields, with ready admin page.


Quick start
-----------
1. Install django-model-audit::

       pip install django-model-audit

2. Add "audit_trail" to your INSTALLED_APPS::

       INSTALLED_APPS = [
               ...
              'audit_trail',
       ]

3. Add Middlewre::
       
       MIDDLEWARE = [
              ...
              'audit_trail.middleware.AuditMiddleware'
       ]

4. Run Migrate::

       python manage.py migrate

5. Add an AuditTrail and manager to model you want to create history::

        from audit_trail.history import AuditTrail, AuditManager
        class MyModel(models.Model):
            ...

            history = AuditTrail()

            objects = AuditManager.as_manager()

            class Meta:
                display_format = '{model_name.field_name}'

6. To add admin screen for audit simply inherit AuditTrailAdmin in your model admin::
   
        from audit_trail.admin import AuditTrailAdmin
        class MyModelAdmin(AuditTrailAdmin):
            ...

   Visit django model admin screen to get the history of particular
   model(Click on History button in that screen).

7. To get audit trail of many_to_many fields just send signal from your AppConfig class' ready method::
        
        from audit_trail.signals import audit_m2m_ready

        class MyappConfig(AppConfig):
            ...
            def ready(self):
                audit_m2m.ready.send(sender=self.__class__)
                ...

8. To get audit trail logs in your django app import and call function
   get_audit_trail() like this::

        from audit_trail.admin import get_audit_trail
        get_audit_trail(model_name, object_id)
sberbank 0.38
Sberbank payments service
License: BSD License

Sberbank
========

Installation
-----------

1. Add "sberbank" to your INSTALLED_APPS settings:
    ```python
        INSTALLED_APPS = [
            ...
            'sberbank',
        ]
    ```

2. Add merchants params to your settings:
    ```python
        MERCHANTS = {
            %merchant_id%: {
                'username': %merchant_username%,
                'password': %merchant_password%,
                'success_url': %default_success_url%
            }
        }
    ```

3. Add callback url to you urls.py:
    ```python
        urlpatterns = [
            ...
            url('/sberbank', include('sberbank.urls'))
        ]

    ```

Sberbank
========

Installation
-----------

1. Add "sberbank" to your INSTALLED_APPS settings:
    ```python
        INSTALLED_APPS = [
            ...
            'sberbank',
        ]
    ```

2. Add merchants params to your settings:
    ```python
        MERCHANTS = {
            %merchant_id%: {
                'username': %merchant_username%,
                'password': %merchant_password%,
                'success_url': %default_success_url%
            }
        }
    ```

3. Add callback url to you urls.py:
    ```python
        urlpatterns = [
            ...
            url('/sberbank', include('sberbank.urls'))
        ]

    ```

4. Run `python manage.py migrate` to create models.

Usage
-----------
* Pay

    ```python
        from sberbank.service import BankService

        instance = BankService(%merchant_id%)
        payment = instance.pay(amount=%amount%)
    ```
    Response:

  | name | type | example |
  |----- | ---- | ------- |
  | payment_id | UUID | UUID('8b7e1798-eb96-402d-ac0e-fa23042d05a7') |
  | redirest_url | string | https://3dsec.sberbank.ru/payment/merchants/upravdoma/payment_ru.html?mdOrder=c12f8fae-447c-7853-c12f-8fae0000302b |

* Check payment status:

    ```python
        from sberbank.service import BankService

        instance = BankService(%merchant_id%)
        status = instance.check_status(%payment_id%)
    ```
  Response:

  | name | type | example |
  |----- | ---- | ------- |
  | status | ENUM | <Status.CREATED: 0> |
  | amount | decimal | 190.82 |
  | created| datetime | datetime.datetime(2018, 1, 26, 9, 4, 1, 950122) |
  | updated| datetime | datetime.datetime(2018, 1, 26, 9, 4, 1, 950122) |