File size: 332 Bytes
d3530f3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from pydantic import BaseModel, Field

class ILogin(BaseModel):
    username: str
    password: str

class IPagination(BaseModel):
    paging: int = Field(1, ge=1)
    limit: int = Field(10, ge=1)
    sort_by: str = "id",
    sort_order: str = 'asc',

    @property
    def offset(self):
        return (self.page - 1) * self.limit