Open dvnstrcklnd opened 3 years ago
I would also expect Model.last to return a single object. I can change things so it does, but, in the interim, there is also a "one" method you can call that will return the last item.
last_sample = session.Sample.one()
print("{}: {}".format(last_sample.name, last_sample.description))
GS apater F: subpool adapter with linker for Agilent libraries
The way it is now, .last(n)
was intended to always return a list, but it doesn't have to be that way, so it may make sense to change it to
Sample.last()
- return last Sample (or None if there are no Samples)
-Sample.last(1)
- return last Sample as a listSample.last(10)
return last 10 Samples as a listSample.first()
- return first Sample (or None if there are no Samples)Sample.first(1)
- return first Sample as a listSample.first(10)
return first 10 Samples as a list
The
Model.last()
method returns a list. It seems like it should return a single object.produces