[Mailman-Developers] Accessing the members of a list

Harshit Bansal harshitbansal2015 at gmail.com
Tue Feb 23 12:40:52 EST 2016


> Hi,
>
> This is in regard to postorius. Is there a way by which I can access all
> the members of a list using its 'list_id' in the list.py file with/without
> creating a new client?
>
> The approach I tried was creating a client in the list.py file for this
> purpose and calling on the 'members()' function from the Client class
> defined in client.py. The doubt I had here is that the members() function
> uses the self parameter to decide which list is being referred to. For
> this, I think I need to pass the exact url to the list I wish to search for
> as a parameter while creating the client and then call on the members()
> function on it. Here, how do I figure out the url for this purpose?
>
> Thanks!
>
> Aditya
>
I think this approach can be used for getting all members without
creating a new client :
m_list = List.objects.get_or_404(fqdn_listname=list_id)
Then mlist.members can be used to access all the members of the mailing list.

If you want to use the client then the exact url of the list would be
lists/fqdn_listname.

Hope this helps.

Thanks and regards,
Harshit Bansal
HBTI, KANPUR


More information about the Mailman-Developers mailing list