-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from divar-ir/assets
assets
- Loading branch information
Showing
4 changed files
with
263 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,4 @@ | |
from .image import * | ||
from .oauth import * | ||
from .widgets import * | ||
from .asset import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
from typing import List | ||
|
||
from pydantic import BaseModel | ||
|
||
|
||
class GetCategoriesResponse(BaseModel): | ||
class Category(BaseModel): | ||
display: str | ||
slug: str | ||
|
||
categories: List[Category] = None | ||
|
||
|
||
class GetCitiesResponse(BaseModel): | ||
class City(BaseModel): | ||
display: str | ||
slug: str | ||
|
||
cities: List[City] = None | ||
|
||
|
||
class GetDistrictsResponse(BaseModel): | ||
class District(BaseModel): | ||
display: str | ||
slug: str | ||
|
||
districts: List[District] = None | ||
|
||
|
||
class GetBrandModelsResponse(BaseModel): | ||
class BrandModel(BaseModel): | ||
display: str | ||
slug: str | ||
|
||
brand_models: List[BrandModel] = None | ||
|
||
|
||
class GetColorsResponse(BaseModel): | ||
class Color(BaseModel): | ||
display: str | ||
slug: str | ||
|
||
colors: List[Color] = None | ||
|
||
|
||
class GetMobileInternalStoragesResponse(BaseModel): | ||
class InternalStorage(BaseModel): | ||
display: str | ||
slug: str | ||
|
||
internal_storages: List[InternalStorage] = None | ||
|
||
|
||
class GetMobileRamMemoriesResponse(BaseModel): | ||
class InternalStorage(BaseModel): | ||
display: str | ||
slug: str | ||
|
||
ram_memories: List[InternalStorage] = None | ||
|
||
|
||
class GetLightBodyStatusResponse(BaseModel): | ||
class BodyStatus(BaseModel): | ||
display: str | ||
slug: str | ||
|
||
body_status: List[BodyStatus] = None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
from samples.sample_app import app | ||
|
||
if __name__ == "__main__": | ||
resp = app.asset.get_categories() | ||
print(resp.categories) | ||
|
||
resp = app.asset.get_cities() | ||
print(resp.cities) | ||
|
||
resp = app.asset.get_districts() | ||
print(resp.districts) | ||
|
||
resp = app.asset.get_city_districts(city="tehran") | ||
print(resp.districts) | ||
|
||
resp = app.asset.get_brand_models(category="light") | ||
print(resp.brand_models) | ||
|
||
resp = app.asset.get_colors(category="mobile-phones") | ||
print(resp.colors) | ||
|
||
resp = app.asset.get_mobile_internal_storages() | ||
print(resp.internal_storages) | ||
|
||
resp = app.asset.get_mobile_ram_memories() | ||
print(resp.ram_memories) | ||
|
||
resp = app.asset.get_light_body_status() | ||
print(resp.body_status) |