You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support calculated(virtual) fields in the query builder #2359
Probably using database views would be the most principled way of doing this. Then Specify queries and other APIs could access these fields in a consistent way as if they were normal fields. There would need to be a way to add the views to the database. Presumably this could be done using custom Django migrations. Also there would need to be some way to cause the backend to use the views when retrieving data from such tables but continue to issue updates and inserts to the underlying bare tables. MySQL does support updatable and insertable views, but I wouldn't bet on them being fit for use.
Activity
benanhalt commentedon Oct 27, 2022
Probably using database views would be the most principled way of doing this. Then Specify queries and other APIs could access these fields in a consistent way as if they were normal fields. There would need to be a way to add the views to the database. Presumably this could be done using custom Django migrations. Also there would need to be some way to cause the backend to use the views when retrieving data from such tables but continue to issue updates and inserts to the underlying bare tables. MySQL does support updatable and insertable views, but I wouldn't bet on them being fit for use.
[-]Support calculated fields in the query builder[/-][+]Support calculated(virtual) fields in the query builder[/+]maxpatiiuk commentedon Sep 30, 2023
From @grantfitzsimmons:
bhumikaguptaa commentedon Sep 3, 2025
Philippe Verely, IRD, requested this feature.
https://discourse.specifysoftware.org/t/count-rows-from-the-query-builder/2787
specifysoftware commentedon Sep 12, 2025
This issue has been mentioned on Specify Community Forum. There might be relevant details there:
https://discourse.specifysoftware.org/t/count-rows-from-the-query-builder/2787/2
specifysoftware commentedon Dec 1, 2025
This issue has been mentioned on Specify Community Forum. There might be relevant details there:
https://discourse.specifysoftware.org/t/show-calculated-virtual-fields-in-the-statistics-page/3178/1
grantfitzsimmons commentedon May 14, 2026
We had a crash today in PRI's database due to the virtual count amount fields being present in a query, but Specify 7 being unable to return them.