Skip to content

Instantly share code, notes, and snippets.

@mgill25
Created May 7, 2013 12:14
Show Gist options
  • Save mgill25/5532131 to your computer and use it in GitHub Desktop.
Save mgill25/5532131 to your computer and use it in GitHub Desktop.
Mailman Model Prototype for Lists and Members
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.contrib.auth.models import User
from django.db import models
# Conceptual Model representation in the Mailman API
class Member(models.Model):
name = models.CharField(max_length=200)
address = models.EmailField() # An EmailListField(), with one being primary?
permissions = models.ListField() # Or something like that
def subscribe(self, listname):
pass
def unsubscribe(self, listname):
pass
def get_permissions(self):
pass
def post_message(self, msg):
pass
def change_primary_address(self, new_address):
pass
class MailingList(models.Model):
fqdn_listname = models.CharField(max_length=200)
list_id = models.CharField(max_length=200)
members = models.ManyToManyField(Member)
public = models.BooleanField(default=True)
def get_member(self, name):
pass
def get_roster(self):
pass
def is_public(self):
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment