# Path: IESPV/settings.py
# EMAIL_HOST_USER = ''
# 
# Path: core/models.py
# class Observer(object):
#     
#     def update(self, input):
#         return        
# 
# class Observable(object):
#     
#     def add_observers():
#         return
# 
#     
#     def remove_observers(self, input):
#         return
# 
#     
#     def notify_observers(self, input):
#         pass        
# 
# class Email(object):
# 	
# 	def send_email(self, subject, message, email_destination):
# 		send_mail(
#                subject,
#                message,
#                EMAIL_HOST_USER,
#                [email_destination],
#                fail_silently=False,
#         )


from django.db import models
from django.contrib.auth.models import AbstractUser, User
from django.core.exceptions import ObjectDoesNotExist
from django.core.mail import send_mail
from IESPV.settings import EMAIL_HOST_USER
from datetime import datetime
from six import with_metaclass
from core.models import Observer, Observable, Email 
import hashlib


class Employee(models.Model):
    class Meta:
        abstract = True

    phone_number = models.CharField(max_length = 12)
    user = models.OneToOneField(User,on_delete=models.CASCADE)

    def register_donor(self, name, phone_number, address, address_reference, observations, email,donation_date):
        user = self.generate_user(self, name, email, '')
        donor = Donor (user=user,
                    name=name,
                    email = email,
                    phone_number=phone_number,
                    address = address,
                    address_reference = address_reference,
                    observations = observations,
                    donation_date=donation_date)
        donor.save()

    def confirm_scheduling(self):
        pass

    def edit_donor(self):

# Path: IESPV/settings.py
# EMAIL_HOST_USER = ''
# 
# Path: core/models.py
# class Observer(object):
#     
#     def update(self, input):
#         return        
# 
# class Observable(object):
#     
#     def add_observers():
#         return
# 
#     
#     def remove_observers(self, input):
#         return
# 
#     
#     def notify_observers(self, input):
#         pass        
# 
# class Email(object):
# 	
# 	def send_email(self, subject, message, email_destination):
# 		send_mail(
#                subject,
#                message,
#                EMAIL_HOST_USER,
#                [email_destination],
#                fail_silently=False,
#         )


# Path: users/models.py
from django.db import models
from django.contrib.auth.models import AbstractUser, User
from django.core.exceptions import ObjectDoesNotExist
from django.core.mail import send_mail
from IESPV.settings import EMAIL_HOST_USER
from datetime import datetime
from six import with_metaclass
from core.models import Observer, Observable, Email 
import hashlib



class Employee(models.Model):
    class Meta:
        abstract = True

    phone_number = models.CharField(max_length = 12)
    user = models.OneToOneField(User,on_delete=models.CASCADE)

    def register_donor(self, name, phone_number, address, address_reference, observations, email,donation_date):
        user = self.generate_user(self, name, email, '')
        donor = Donor (user=user,
                    name=name,
                    email = email,
                    phone_number=phone_number,
                    address = address,
                    address_reference = address_reference,
                    observations = observations,
                    donation_date=donation_date)
        donor.save()

    def confirm_scheduling(self):
        pass

    def edit_donor(self):

        pass