MasoniteFramework / api

Masonite API package currently in development
MIT License
8 stars 4 forks source link

Index method sort by certain field #12

Closed damdinsharav closed 5 years ago

damdinsharav commented 5 years ago

Hello, I am creating API for TV Guide while learning Masonite framework. `"""Model Definition (generated with love by Masonite)

id: integer default: None
name: string(255) default: None
start_time: datetime default: None
end_time: datetime default: None
duration: integer default: None
ch_id: integer default: None
created_at: datetime default: CURRENT_TIMESTAMP
updated_at: datetime default: CURRENT_TIMESTAMP
"""`
  1. On "index" method, I'd like to sort by EPG by start_time.

  2. I'd like to show all EPG of certain "ch_id".

In this case how would I do it? or it's better to stick with main framework, not masonite-api. Generally speaking, where is best place to post general how-to questions about the framework?

josephmancuso commented 5 years ago

To be honest I stick with the general framework for building api but if you want to to this for index methods you can just override that index method and return what you want