django-computed-property
                                
                                 django-computed-property copied to clipboard
                                
                                    django-computed-property copied to clipboard
                            
                            
                            
                        Computed Property Fields for Django
django-computed-property
Computed Property Fields for Django
Inspired by Google Cloud Datastore NDB Computed Properties.
Automatically store a computed value in the database when saving your model so you can filter on values requiring complex (or simple!) calculations.
Quick start
- 
Install this library pip install django-computed-property
- 
Add to INSTALLED_APPSINSTALLED_APPS = [ ..., 'computed_property' ]
- 
Add a computed field to your model(s) from django.db import models import computed_property class MyModel(models.Model): doubled = computed_property.ComputedIntegerField(compute_from='double_it') base = models.IntegerField() def double_it(self): return self.base * 2
Documentation available at http://django-computed-property.readthedocs.io/en/latest/