Closed NicoHood closed 1 year ago
Isnt that also what the type annotation says? I think we need to wrap it into the from_record()
function.
This would be nice!
I don't recall if I had a reason for doing it that way or if it was just a mistake. Probably the latter :)
Easy workaround until this is fixed:
models = [model.from_record(record) for record in model.all()]
Actual fix:
@classmethod
def all(cls, **kwargs) -> List[T]:
"""Returns all records for this model. See :meth:`~pyairtable.api.Api.all`"""
table = cls.get_table()
return [self.from_record(record) for record in table.all(**kwargs)]
Talking about this: https://github.com/gtalarico/pyairtable/blob/main/pyairtable/orm/model.py#L234-L238
This confuses me, as it really does not help for the ORM. I am currently trying to download existing data as Model. I thought that the
all()
function would do that, but it returns the json data, which is not what we want.