Opened 17 years ago

Last modified 17 years ago

#5037 closed

DB-API docs model example uses URLField for email adress — at Version 4

Reported by: popython@… Owned by: Jacob
Component: Documentation Version: dev
Severity: Keywords: EmailField
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by James Bennett)

The example models in the DB API documentation include this:

class Author(models.Model):
    name = models.CharField(maxlength=50)
    email = models.URLField()

    def __unicode__(self):
        return self.name

It should be this:

class Author(models.Model):
    name = models.CharField(maxlength=50)
    email = models.EmailField()

    def __unicode__(self):
        return self.name

Change History (5)

comment:1 by anonymous, 17 years ago

comment:2 by popt, 17 years ago

http://www.djangoproject.com/documentation/db-api

wrong TypeField for email field in models.py

class Author(models.Model):

name = models.CharField(maxlength=50)
email = models.URLField()

def unicode(self):

return self.name


it should be :

class Author(models.Model):

name = models.CharField(maxlength=50)
email = models.EmailField

def unicode(self):

return self.name

comment:3 by James Bennett, 17 years ago

Description: modified (diff)
Summary: wrong typefield for email field in models.pyDB-API docs model example uses URLField for email adress
Triage Stage: UnreviewedAccepted

Cleaning up summary and description to add formatting and make it clear what's being referenced.

comment:4 by James Bennett, 17 years ago

Description: modified (diff)

(again)

by James Bennett, 17 years ago

Attachment: db-api.diff added

Patch

Note: See TracTickets for help on using tickets.
Back to Top