Q:

Django EmailField and full email address with first and last name

I would like to use the EmailField in a form. However, instead of only storing
support@acme.com

I want to store
"ACME Support" <support@acme.com>

The reason is, that when I send email, I would like a "friendly name" to appear.
Can this be done?

A:

We use Django's email field, and then use a property to render the friendly name in the email.
from django.utils.html import escape
from django.utils.safestring import mark_safe

class MyModel(models.Model):
    email_address = models.EmailField()
    full_name = models.CharField(max_length=30)
    ...

    @property
    def friendly_email(self):
        return mark_safe(u"%s <%s>") % (escape(self.fullname), escape(self.email_address))

