diff --git a/sandbox/grist/table.py b/sandbox/grist/table.py index ca5b965e..0bec5eb1 100644 --- a/sandbox/grist/table.py +++ b/sandbox/grist/table.py @@ -248,6 +248,16 @@ class Table(object): """ return len(self._empty_lookup_column._do_fast_empty_lookup()) + @property + def sample_record(self): + """ + Used for auto-completion as a record with correct properties of correct types. + """ + return _make_sample_record( + self.table_id, + [col for col_id, col in self.all_columns.items() if col_id not in self._special_cols], + ) + def _rebuild_model(self, user_table): """ Sets class-wide properties from a new Model class for the table (inner class within the table @@ -267,9 +277,6 @@ class Table(object): default_func = self.Model.__dict__.get(get_default_func_name(col_id)) new_cols[col_id] = self._create_or_update_col(col_id, col_model, default_func) - # Used for auto-completion as a record with correct properties of correct types. - self.sample_record = _make_sample_record(self.table_id, six.itervalues(new_cols)) - # Note that we reuse previous special columns like lookup maps, since those not affected by # column changes should stay the same. These get removed when unneeded using other means. new_cols.update(sorted(six.iteritems(self._special_cols)))