mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(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:
@@ -633,7 +633,7 @@ return ",".join(str(r.id) for r in Students.lookupRecords(firstName=fn, lastName
|
||||
# A helper for comparing Record objects below.
|
||||
schools_table = self.engine.tables['Schools']
|
||||
def SchoolsRec(row_id):
|
||||
return schools_table.Record(schools_table, row_id, None)
|
||||
return schools_table.Record(row_id, None)
|
||||
|
||||
# We'll play with schools "Columbia" and "Eureka", which are rows 1,3,5 in the Students table.
|
||||
self.assertTableData("Students", cols="subset", rows="subset", data=[
|
||||
@@ -680,7 +680,7 @@ return ",".join(str(r.id) for r in Students.lookupRecords(firstName=fn, lastName
|
||||
# A helper for comparing Record objects below.
|
||||
schools_table = self.engine.tables['Schools']
|
||||
def SchoolsRec(row_id):
|
||||
return schools_table.Record(schools_table, row_id, None)
|
||||
return schools_table.Record(row_id, None)
|
||||
|
||||
# We'll play with schools "Columbia" and "Eureka", which are rows 1,3,5 in the Students table.
|
||||
self.assertTableData("Students", cols="subset", rows="all", data=[
|
||||
|
||||
Reference in New Issue
Block a user