def create_subscribe(email): """Create a subscribe record.""" SubscribeList.create(email=email)
def test_create_subscribe_record(self): """Makes sure a subscription gets created.""" create_subscribe('*****@*****.**') s = SubscribeList.select().where(SubscribeList.email == '*****@*****.**')
def subscription_exists(form, field): if SubscribeList.select().where(SubscribeList.email == field.data).exists(): raise ValidationError('You are already subscribed.')