tortoise / tortoise/tortoise-orm
How to emulate such a request through Tortoise ORM?
Open
Nobody has claimed this yet.
documentation
enhancement
Next Release
- Dominant language
- Python
- Stars
- 5.6k
- Forks
- 516
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 9
Description
Hello, how I can a similar SQL request be sampled via Tortoise ORM? Read the documentation, but it doesn’t give examples of working with date and time
SELECT uid, SUM(posts) AS post, SUM(fine) AS fines, date FROM statistic
WHERE date > DATE(date) <= NOW() AND date >= DATE_SUB(NOW(), INTERVAL 31 DAY)
GROUP BY uid ORDER BY post DESC
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no repository file, test, or entry point; it only provides a SQL query and asks how to express it through Tortoise ORM. Start by locating the documentation covering date/time filters, aggregation, grouping, ordering, and raw expressions. Done means adding a working example that represents the requested query and explaining its date boundaries.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, sql
- Domain
- databases
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100