Django model fields for Bikram Sambat (Nepali) dates (built on bsdatetime)
Project description
django-bsdatetime
Django model fields for Bikram Sambat (Nepali) dates built on the bsdatetime core.
Documentation: https://rajendra-katuwal.github.io/bsdatetime.docs/
Install
pip install django-bsdatetime
Installs bsdatetime automatically.
Quick model example
from django.db import models
from django_bsdatetime import BikramSambatDateField
class Person(models.Model):
name = models.CharField(max_length=100)
birth_date_bs = BikramSambatDateField(null=True, blank=True)
person = Person.objects.create(name="राम बहादुर", birth_date_bs=(2050, 5, 15))
print(person.birth_date_bs) # (2050, 5, 15)
Data is stored internally as Gregorian; you work with BS tuples.
Provided fields
- BikramSambatDateField (aliases: BSDateField, NepaliDateField)
- BikramSambatDateTimeField
Input format:
- Date: (year, month, day)
- DateTime: (year, month, day, hour, minute, second)
Why use it
- Clean separation of storage (AD) vs domain (BS)
- Validation & conversion handled in one place
- Admin friendly
Need pure functions only? Use core:
pip install bsdatetime
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django_bsdatetime-1.0.1.tar.gz.
File metadata
- Download URL: django_bsdatetime-1.0.1.tar.gz
- Upload date:
- Size: 5.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6fb3ca93932679cb32f13ccc11b2ce7f6371027679c32ef22dba14e52f6a0c44
|
|
| MD5 |
9f0ea736073772a2e5fcae1afc5b1562
|
|
| BLAKE2b-256 |
87607534693510ebf8fc4a14a1238fddbe45cd73776d8a4cb934b6befab94a85
|
File details
Details for the file django_bsdatetime-1.0.1-py3-none-any.whl.
File metadata
- Download URL: django_bsdatetime-1.0.1-py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
50b1b60cf19ad5387db005934b8c87153193efa3da4e2f03943272716ad86bc9
|
|
| MD5 |
eaa97c33a5f49a2807ebc8d7a9efe73d
|
|
| BLAKE2b-256 |
0b829a873eed1e4b223939943229957f81887321c97e74f64303e2598f6e6be7
|