It was really nice to meet you today Jose! I will cheer for you business and your very bright future ahead.
@microapis8 ай бұрын
Thank you was a great pleasure meeting you too and I really enjoyed our conversation! Wish you the very best with your projects too and looking forward to seeing them grow. Hope we can see each other again!
@grahortarg993310 ай бұрын
I still have a question - how to do count with filters?
@microapis7 ай бұрын
Thank you for your question! You'd follow the same approach shown in the video, only applying the filters first. Here's an example: @router.get("/jobs", response_model=ListJobs) def list_jobs(contract_type: ContractTypeEnum | None = None,): with session_maker() as session: query = select(Job) if contract_type: query = query.where(Job.contract_type == contract_type.value) count = session.execute( select(func.count()).select_from(query.subquery()) ).scalar_one() This endpoint returns a list of jobs and allows you to filter by contract type. The filter is optional and None by default, so first we check if it's set, and if so, we apply the filter to the query. Once we've filtered the result set, we count the items. Hope this helps, if you have any more questions please let me know!