I have an ostensibly simple problem. Here is my models.py:
from django.db import models
class Email(models.Model):
def __unicode__(self):
return self.email
email = models.EmailField()
EmailField, according to the docs, should check if the entered email address is valid. So then why does my shell allow me to save malformed emails? In the shell:
>>> from emailapp.models import Email
>>> e = Email(email="sdf")
>>> e
<Email: sdf>
>>> e.save()
>>> Email.objects.all()
[<Email: [email protected]>, <Email: [email protected]>, <Email: sdf>]
The admin interface doesn t allow me to save these malformed emails, but the shell does.Why is this?