def create_user(self, username, email, password=None):
        now = datetime.datetime.now()

        # Normalize the address by lowercasing the domain part of the email
        # address.
        try:
            email_name, domain_part = email.strip().split('@', 1)
        except ValueError:
            pass
        else:
            email = '@'.join([email_name, domain_part.lower()])

        user = self.model(username=username, email=email, is_staff=False,
                         is_active=True, is_superuser=False, last_login=now,
                         date_joined=now)

        user.set_password(password)
        user.save(using=self._db)
        return user
Delete model helper
dataset/ETHPy150Open adieu/django-nonrel/django/contrib/auth/models.py/UserManager.create_user--crossover with--dataset/ETHPy150Open flask-admin/flask-admin/flask_admin/contrib/pymongo/view.py/ModelView.delete_model