Django field for storing and evaluating formula expressions
Project description
Django Formula Field
When you want to provide placeholder columns for user to fill in based on values of the rows, you oftentimes want to have an Excel-like formula parser. This is the aim of this package, you provide a formula field and an evaluated result field.
Installation
Installation through pip: pip install django-formula-field
Getting Started
Defining an EvaluatedFormulaField is quite simple, you define a model:
from django.db import models
from django_formulafield.fields import EvaluatedFormulaField
class SampleModel(models.Model):
formula = models.CharField(max_length=255)
result = EvaluatedFormulaField(formula_field="formula")
Optional parameters are:
- max_length: behind the scenes, the evaluation is stored in a CharField
- reevaluate_on_update: if it should update the evaluation when you update the record
Formula field can be a callable function defined on the model.
Evaluation
Evaluation is completely offloaded to the formulas and any FormulaErrors are raised
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_formula_field-0.1.2.tar.gz.
File metadata
- Download URL: django_formula_field-0.1.2.tar.gz
- Upload date:
- Size: 7.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
39be8c0cd3393ec94e75584516ca5bc9f70ac548f35aeceed4f019ef0e584ec5
|
|
| MD5 |
1e20ed553da3228edb7c331b659904c0
|
|
| BLAKE2b-256 |
a8c7fc668990b549376f6c2164fb94a8afbddc29faecf2c3f3dcf33801d4bb55
|
Provenance
The following attestation bundles were made for django_formula_field-0.1.2.tar.gz:
Publisher:
python-publish.yml on j0hn-mc-clane/django-formulafield
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_formula_field-0.1.2.tar.gz -
Subject digest:
39be8c0cd3393ec94e75584516ca5bc9f70ac548f35aeceed4f019ef0e584ec5 - Sigstore transparency entry: 1392674460
- Sigstore integration time:
-
Permalink:
j0hn-mc-clane/django-formulafield@bb95aaeee64e41a507d3683b854e40a4a3ab147c -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/j0hn-mc-clane
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@bb95aaeee64e41a507d3683b854e40a4a3ab147c -
Trigger Event:
release
-
Statement type:
File details
Details for the file django_formula_field-0.1.2-py3-none-any.whl.
File metadata
- Download URL: django_formula_field-0.1.2-py3-none-any.whl
- Upload date:
- Size: 12.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7ef5219e83aeb2aebf8e4f1361cdcea34f6f4f3dee542fe1b9e33c3443a9caf1
|
|
| MD5 |
bdf71086eb69d3c707b51ec3671dc9a1
|
|
| BLAKE2b-256 |
df04df1a38dd619aa075206e1b6be096cdd10a5e9161ef349b26ca43b0160cb1
|
Provenance
The following attestation bundles were made for django_formula_field-0.1.2-py3-none-any.whl:
Publisher:
python-publish.yml on j0hn-mc-clane/django-formulafield
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_formula_field-0.1.2-py3-none-any.whl -
Subject digest:
7ef5219e83aeb2aebf8e4f1361cdcea34f6f4f3dee542fe1b9e33c3443a9caf1 - Sigstore transparency entry: 1392674467
- Sigstore integration time:
-
Permalink:
j0hn-mc-clane/django-formulafield@bb95aaeee64e41a507d3683b854e40a4a3ab147c -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/j0hn-mc-clane
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@bb95aaeee64e41a507d3683b854e40a4a3ab147c -
Trigger Event:
release
-
Statement type: