(core) Refactor Table.Record[Set] classes

Summary:
Dealing with some things that bothered and sometimes confused me:

Make Table.Record[Set] provide the table argument automatically
Remove the classes from UserTable because they're not used anywhere and the Table/UserTable distinction is already confusing. They're not documented for users and they don't show up in autocomplete.
Remove RecordSet.Record because it was confusing me where that attribute was being set, but also this means .Record will work properly for users with columns named 'Record'.

Test Plan: existing tests

Reviewers: dsagal

Reviewed By: dsagal

Differential Revision: https://phab.getgrist.com/D2913
This commit is contained in:
Alex Hall
2021-07-16 20:15:04 +02:00
parent 5b2666a88a
commit a9d5b4d5af
10 changed files with 48 additions and 26 deletions

View File

@@ -380,7 +380,7 @@ class TestRenames(test_engine.EngineTestCase):
from datetime import date
# A helper for comparing Record objects below.
people_table = self.engine.tables['People']
people_rec = lambda row_id: people_table.Record(people_table, row_id, None)
people_rec = lambda row_id: people_table.Record(row_id, None)
# Verify the data and calculations are correct.
self.assertTableData("Address", cols="all", data=[