Code

Opened 11 months ago

Closed 11 months ago

Last modified 11 months ago

#20543 closed Cleanup/optimization (fixed)

Possible typo in Django's documentation

Reported by: i.amber.jain@… Owned by: nobody
Component: Documentation Version: 1.5
Severity: Normal Keywords: max_length,db,model
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation:
Needs tests: Patch needs improvement:
Easy pickings: no UI/UX: no

Description

https://docs.djangoproject.com/en/1.5/topics/db/models/#field-options lists following example (under "choices" sub-section):

from django.db import models

class Person(models.Model):
    SHIRT_SIZES = (
        ('S', 'Small'),
        ('M', 'Medium'),
        ('L', 'Large'),
    )
    name = models.CharField(max_length=60)
    shirt_size = models.CharField(max_length=2, choices=SHIRT_SIZES)

Why does the example below has max_length=2 instead of max_length=1 ? Is this because of some DB/vendor issue (I could not find anything about this at https://docs.djangoproject.com/en/1.5/ref/databases/)?
Someone on #django (freenode) suggested this could be a typo. So, I thought of reporting it here.

Thanks!

Attachments (0)

Change History (2)

comment:1 Changed 11 months ago by Tim Graham <timograham@…>

  • Resolution set to fixed
  • Status changed from new to closed

In f315693304865162d0b1bb8f913e9c5f14fb351e:

Fixed #20543 - Typo in db model fields docs.

Thanks i.amber.jain@ for the report.

comment:2 Changed 11 months ago by Tim Graham <timograham@…>

In 56192d21d5fde1b4085bb7a175e450f1e94ee962:

[1.5.x] Fixed #20543 - Typo in db model fields docs.

Thanks i.amber.jain@ for the report.

Backport of f315693304 from master

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.