Opened 2 years ago

Closed 2 years ago

Last modified 2 years 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!

Change History (2)

comment:1 Changed 2 years 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 2 years 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

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