Django Banks
A Django application that provides Indonesian bank choices for use with forms and a country field for models.
Installation
pip install p1-bank
Add bank to INSTALLED_APPS
Run python manage.py migrate to create banks models
Bank Model
A model of bank that holds all banks in Indonesia.
Supports long name, short name, bank code, and branch code.
>>> from django.apps import apps
>>> Bank = apps.get_model('bank', 'Bank')
>>> bank = Bank.get(short_name='Bank BCA')
>>> bank.long_name
'PT. Bank Central Asia Tbk.'
>>> bank.short_name
'Bank BCA'
>>> bank.bank_code
'014'
>>> bank.branch_code
'0397'
>>> bank.bi_code
'0140397'
Bank Field
BankField is based on Django’s ForeignKey, a relationship to Bank model.
Consider the following model using a BankField:
from django.db import models
from p1_bank.fields import BankField
class Account(models.Model):
name = models.CharField(max_length=100)
bank = BankField(related_name='accounts')
Any Account instance will have a bank attribute that you can use to identify account’s bank:
>>> bank = Bank.objects.get(short_name='Bank BCA')
>>> account = Account.objects.create(name='Kania', bank=bank)
>>> account.bank
'Bank BCA'
>>> account.bank.code
'014'
Metadata
Release files for p1-bank 0.2.36160053
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| p1-bank-0.2.36160053.tar.gz | 9.5 kB | Without provenance | Details for p1-bank-0.2.36160053.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| p1_bank-0.2.36160053-py2-none-any.whl | Python 2 | none | any | Details for p1_bank-0.2.36160053-py2-none-any.whl |
Total release size: 21.3 kB
Release files / p1-bank-0.2.36160053.tar.gz
| Download URL | p1-bank-0.2.36160053.tar.gz |
|---|---|
| Size | 9.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
741730b806957760a890605f740c433c12d76c221c7da000ee786aa49a49c8f2
|
|
BLAKE2b-256 checksum How to use checksums |
7d83355f9b1d15b6baec33a2b4c3e8818fbdbb106bb13a2d11c1d49f644f5c2c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/2.7.15
|
Release files / p1_bank-0.2.36160053-py2-none-any.whl
| Download URL | p1_bank-0.2.36160053-py2-none-any.whl |
|---|---|
| Size | 11.8 kB |
| Tags | Python 2 |
|
SHA-256 checksum How to use checksums |
ce940ec10e1c1197fecea2c360b372bf9766b78b9f0148c9c03158017c2f6b36
|
|
BLAKE2b-256 checksum How to use checksums |
edb6792c02313d6126b8674a4a0cbac9df44f9805957a71d22e107c393cd60db
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/2.7.15
|
Security for p1-bank 0.2.36160053
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.