Opened 16 years ago
Closed 16 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: | no | UI/UX: | no |
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 (
idinteger AUTO_INCREMENT NOT NULL PRIMARY KEY,
questionvarchar(200) NOT NULL,
pub_datedatetime NOT NULL
);
CREATE TABLE polls_choice (
idinteger AUTO_INCREMENT NOT NULL PRIMARY KEY,
poll_idinteger NOT NULL REFERENCESpolls_poll(id),
choicevarchar(200) NOT NULL,
votesinteger NOT NULL
);
COMMIT;
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.