mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Allow filtering hidden columns
Summary: Existing filters are now moved out of fields and into a new metadata table for filters, and the client is updated to retrieve/update/save filters from the new table. This enables storing of filters for columns that don't have fields (notably, hidden columns). Test Plan: Browser and server tests. Reviewers: jarek Reviewed By: jarek Differential Revision: https://phab.getgrist.com/D3138
This commit is contained in:
@@ -107,6 +107,11 @@ class MetaTableExtras(object):
|
||||
class _grist_Views_section(object):
|
||||
fields = _record_set('_grist_Views_section_field', 'parentId', sort_by='parentPos')
|
||||
|
||||
class _grist_Filters(object):
|
||||
def setAutoRemove(rec, table):
|
||||
"""Marks the filter for removal if its column no longer exists."""
|
||||
table.docmodel.setAutoRemove(rec, not rec.colRef)
|
||||
|
||||
|
||||
def enhance_model(model_class):
|
||||
"""
|
||||
@@ -159,6 +164,7 @@ class DocModel(object):
|
||||
self.pages = self._prep_table("_grist_Pages")
|
||||
self.aclResources = self._prep_table("_grist_ACLResources")
|
||||
self.aclRules = self._prep_table("_grist_ACLRules")
|
||||
self.filters = self._prep_table("_grist_Filters")
|
||||
|
||||
def _prep_table(self, name):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user