{"repo":"netzkolchose/django-computedfields","free":true,"listed":false,"github":"https://github.com/netzkolchose/django-computedfields","clone":"git clone https://github.com/netzkolchose/django-computedfields.git","description":"Provides autogenerated autoupdated database fields for model methods.","language":"Python","stars":108,"topics":["computed","django","field"],"license":"MIT","category":"databases-storage","readme_excerpt":"django-computedfields django-computedfields provides autoupdated database fields for model methods. Tested with Django 4.2 and 5.2 (Python 3.8 to 3.13). Example Just derive your model from ComputedFieldsModel and place the @computed decorator at a method: computed field will be turned into a real database field and can be accessed and searched like any other database field. During saving the associated method gets called and it’s result written to the database. How to recalculate without saving the model record If you need to recalculate the computed field but without saving it, use from computedfields.models import compute depends keyword The depends keyword argument can be used with any relation to indicate dependencies to fields on other models as well: Now changes to self.name , fk or fk.fieldname will update computed field . Alternative Syntax Instead of using the @computed decorator with inline field definitions, you can also use a more declarative syntax with ComputedField , example from above rewritten: Documentation The documentation can be found here. Changelog - 0.3.6 - Django 6.0 support - Django 4.2 support dropped - Fix 2 field merge bugs in not computed resync (#207, #211) - Fix checkdata bugs (#203, #204) - 0.3.5 - performance improvement: allow select related/prefetch related on UNIONed resolver updates - 0.3.4 - Fix UNIONed resolver updates, that contain select related - 0.3.3 - auto recovery for not computed context - 0.3.2 - regression fix (#190): add impl","default_branch":null,"files":null,"tree":[],"storefront":"/r/netzkolchose","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/netzkolchose/django-computedfields/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}