django-unitology
Custom model fields to store, retrieve and convert measurements of height, weight and more…
Authored by Basil Shubin, and some great contributors.
Installation
pip install django-unitology
External dependencies
jQuery - this is not included in the package since it is expected that in most scenarios this would already be available.
Setup
Add unitology to INSTALLED_APPS:
INSTALLED_APPS += (
'unitology',
)
Update your urls.py file:
urlpatterns += [
url(r'^unitology/', include('unitology.urls')),
]
When deploying on production server, don’t forget to run:
python manage.py collectstatic
Usage
# models.py
from django.db import models
from django.contrib import admin
from unitology.models import UnitsFieldMixin
from unitology.fields import WeightField, HeightField
from unitology.forms import UnitsFieldFormMixin
class Person(UnitsFieldMixin):
name = models.CharField(max_length=128)
weight = WeightField(blank=True, null=True)
height = HeightField(blank=True, null=True)
class PersonChangeForm(UnitsFieldFormMixin):
class Meta:
model = Person
class PersonAdmin(admin.ModelAdmin):
form = PersonChangeForm
admin.site.register(Person, PersonAdmin)
Please see example application. This application is used to manually test the functionalities of this package. This also serves as a good example.
You need only Django 1.4 or above to run that. It might run on older versions but that is not tested.
License
django-unitology is released under the MIT license.
Metadata
Release files for django-unitology 0.0.7
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 |
|---|---|---|---|---|
| django-unitology-0.0.7.tar.gz | 11.8 kB | Without provenance | Details for django-unitology-0.0.7.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| django_unitology-0.0.7-py3-none-any.whl | Python 3 | none | any | Details for django_unitology-0.0.7-py3-none-any.whl |
Total release size: 29.3 kB
Release files / django-unitology-0.0.7.tar.gz
| Download URL | django-unitology-0.0.7.tar.gz |
|---|---|
| Size | 11.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
50fc41fe31856f7bd3e94dafb4a9456e93c39f6aa44cffbeb8b6ef09f43aaaf2
|
|
BLAKE2b-256 checksum How to use checksums |
2ca2d48c6167fbf83c853fd2c9f0fe3be0fe2ae5927d9c12f3cc7b30f789332d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
Python-urllib/3.8
|
Release files / django_unitology-0.0.7-py3-none-any.whl
| Download URL | django_unitology-0.0.7-py3-none-any.whl |
|---|---|
| Size | 17.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
847d8a2ac28c2b026b4c297a0a0963328e67f22b7ace58e3f059bf3bd4a833cb
|
|
BLAKE2b-256 checksum How to use checksums |
4d65ece11592ee02f82f22f57050b691c6e70430dacc435e0222fd5446de37ff
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
Python-urllib/3.8
|
Security for django-unitology 0.0.7
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.