You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When page limit is applied, the value for count property in get method is wrong. It returns the count of all records instead of the current page length.
Refer to methods:
paginate in safrs/jsonapi_formatting.py
get in safrs/jsonapi.py
count is being calculated based on initial length of object_query, but it should consider instances length after applying pagination.
The text was updated successfully, but these errors were encountered:
This is by design: if you want the number of items returned you can use the length of data[].
You can change this behaviour by overriding _s_count , eg:
classBaseModel(SAFRSBase, db.Model):
__abstract__=Truedef_s_count():
return100classUser(BaseModel):
""" description: My User description """__tablename__="Users"id=db.Column(db.Integer, primary_key=True)
name=db.Column(db.String)
email=db.Column(db.String)
I added the meta.total to be compatible with a particular frontend client but it's the same value as meta.count. I may make this more configurable in the future though because it's not too obvious.
When page limit is applied, the value for
count
property inget
method is wrong. It returns the count of all records instead of the current page length.Refer to methods:
paginate
in safrs/jsonapi_formatting.pyget
in safrs/jsonapi.pycount
is being calculated based on initial length of object_query, but it should consider instances length after applying pagination.The text was updated successfully, but these errors were encountered: