django-tckn-field-0.0.3
توضیحات
A Django app built to integrate Republic of Turkey Identification Number to your project.
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | django-tckn-field-0.0.3 |
| نام | django-tckn-field |
| نسخه کتابخانه | 0.0.3 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Enis B. Tuysuz |
| ایمیل نویسنده | enisbtuysuz@gmail.com |
| آدرس صفحه اصلی | https://github.com/enisbt/django-tckn-field |
| آدرس اینترنتی | https://pypi.org/project/django-tckn-field/ |
| مجوز | MIT |
# Django TCKN Field
A Django app built to integrate Republic of Turkey Identification Number to your project.
## Installation
```bash
pip install django-tckn-field
```
## Quick Start
```python
from tckn.fields import TCKNField
class MyModel(models.Model):
tckn_field = TCKNField()
```
## How Numbers Are Validated
TCKNField inherits CharField, so it must be a string. Identification numbers are created by following these rules:
- The number must be 11 characters long
- The number mustn't start with 0
- The tenth character is created with this formula:
<a href="https://www.codecogs.com/eqnedit.php?latex=(((N_1&space;+&space;N_3&space;+&space;N_5&space;+&space;N_7&space;+&space;N_9)&space;*&space;7)&space;-&space;(N_2&space;+&space;N_4&space;+&space;N_6&space;+&space;N_8))&space;(mod&space;10)" target="_blank"><img src="https://latex.codecogs.com/gif.latex?(((N_1&space;+&space;N_3&space;+&space;N_5&space;+&space;N_7&space;+&space;N_9)&space;*&space;7)&space;-&space;(N_2&space;+&space;N_4&space;+&space;N_6&space;+&space;N_8))&space;(mod&space;10)" title="(((N_1 + N_3 + N_5 + N_7 + N_9) * 7) - (N_2 + N_4 + N_6 + N_8)) (mod 10)" /></a>
- The eleventh character is created with this formula:
<a href="https://www.codecogs.com/eqnedit.php?latex=(N_1&space;+&space;N_2&space;+&space;N_3&space;+&space;N_4&space;+&space;N_5&space;+&space;N_6&space;+&space;N_7&space;+&space;N_8&space;+&space;N_9)&space;(mod&space;10)" target="_blank"><img src="https://latex.codecogs.com/gif.latex?(N_1&space;+&space;N_2&space;+&space;N_3&space;+&space;N_4&space;+&space;N_5&space;+&space;N_6&space;+&space;N_7&space;+&space;N_8&space;+&space;N_9)&space;(mod&space;10)" title="(N_1 + N_2 + N_3 + N_4 + N_5 + N_6 + N_7 + N_8 + N_9) (mod 10)" /></a>
## License
You can use this program under the terms of MIT License. See LICENSE for details.
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.4 | Python |
نحوه نصب
نصب پکیج whl django-tckn-field-0.0.3:
pip install django-tckn-field-0.0.3.whl
نصب پکیج tar.gz django-tckn-field-0.0.3:
pip install django-tckn-field-0.0.3.tar.gz