Opened 5 years ago

Closed 5 years ago

#12920 closed (invalid)

max_length should be maxlength on my system

Reported by: rocteur Owned by: nobody
Component: Uncategorized Version: 1.1
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

python manage.py validate
rocsite.polls: init() got an unexpected keyword argument 'max_length'

$:/opt/roccode/rocsite$ python manage.py validate
polls.poll: "question": CharFields require a "maxlength" attribute.
polls.choice: "choice": CharFields require a "maxlength" attribute.

class Poll(models.Model):

#question = models.CharField(max_length=200)
question = models.CharField(maxlength=200)
pub_date = models.DateTimeField('date published')

class Choice(models.Model):

poll = models.ForeignKey(Poll)
#choice = models.CharField(max_length=200)
choice = models.CharField(maxlength=200)
votes = models.IntegerField()

$:/opt/roccode/rocsite$ python manage.py validate
0 errors found.
$:/opt/roccode/rocsite$ python manage.py sql polls
BEGIN;
CREATE TABLE polls_poll (

id integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
question varchar(200) NOT NULL,
pub_date datetime NOT NULL

);
CREATE TABLE polls_choice (

id integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
poll_id integer NOT NULL REFERENCES polls_poll (id),
choice varchar(200) NOT NULL,
votes integer NOT NULL

);
COMMIT;

Change History (1)

comment:1 Changed 5 years ago by russellm

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to invalid
  • Status changed from new to closed

I have no idea what you've done here, but the use of maxlength as an argument name was deprecated a *long* time ago - pre v1.0. I suggest asking on Django-users for assistance.

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