noyainrain / listling

Web app to make and edit lists collaboratively.
https://listling.org/
GNU Affero General Public License v3.0
34 stars 8 forks source link

Add referral summary function #78

Closed NiklasMM closed 4 years ago

NiklasMM commented 4 years ago

Referrals.summarize now provides access to a summary of referrals over a given time period.

noyainrain commented 4 years ago

Thanks so much for the contribution! It would be awesome if you could additionally expose the functionality as web API endpoint /api/stats/referrals/summary?period, where period is a simplified ISO 8601 time interval. If period is omitted, I would suggest it defaults to the last seven days (currently your function returns all referral entries, which can be quite many ;) ). Everything you need to implement an endpoint should be available in micro/micro/server.py. :blush:

NiklasMM commented 4 years ago

Sure I can do that. Unfortunately the server tests are affected by issue we discussed over the weekend, where the test suite doesn't like to be in a sub-folder or something. Could you first integrate this into micro and I add the endpoint directly there? You can also contact me on Slack to discuss this.

noyainrain commented 4 years ago

Good point, let's do it like this! :blush: I've created an issue for the feature (noyainrain/micro#104) and moved your changes to a branch where you can continue your work: https://github.com/noyainrain/micro/tree/referral-summary-104