~sircmpwn/lists.sr.ht#137: 
Provide list owners with a subscriber count

List of email addresses probably overkill, but a count of subscribers to each list would allow basic tracking of engagement and growth

Status
RESOLVED BY_DESIGN
Submitter
~chaoticnorth
Assigned to
No-one
Submitted
5 years ago
Updated
4 years ago
Labels
No labels applied.

~exprez135 4 years ago

I worked on this a bit today, and I can work on submitting a patch as long as ~sircmpwn wants to include this feature. I need some help with the last bit though. What I've done would:

  • Add a new integer column in the list table called subscriber_count
  • Add the new "subscriber_count" field to the mailing list API response
  • Add "__ subscribers." to the sidebar beneath the etiquette notice and buttons.
  • Update the subscriber count each time the _subscribe() or _unsubscribe() functions are run with something like:
dest.subscriber_count = dest.subscribers.count()

or

dest.subscriber_count = select([func.count()]).select_from(dest.subscribers)

or

dest.subscriber_count = List.query.filter(List.id == dest.id).one_or_none().subscribers.count()

I'm not experienced with SQLAlchemy, so I will probably need some advice on how to get that line to work. What's the best way to run something like func.count() on dest.subscribers within process.py?

dest is defined with dest = List.query.filter(List.id == list_id).one_or_none(). And _forward() uses it like for sub in dest.subscribers:.

~sircmpwn REPORTED BY_DESIGN 4 years ago

A subscriber count is not desirable. Tracking "engagement and growth" is not desirable. Sorry I missed this before, but I'm not interested in a patch.

Register here or Log in to comment, or comment via email.