Code

Opened 7 years ago

Closed 7 years ago

#6193 closed (invalid)

clean_* not working with modelform

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

Description

Well, i tried to write some custom validation with model form using the pattern clean_fieldname. Well,
with latest django from svn, it didn't work. Example:

class MyModel(models.Model):

title = models.TextField(max_length=20)

class FormForMyModel(newforms.ModelForm):

class Meta:

model = MyModel

def clean_title(self):

print "test"
yield ValidationError("Clean_title is never called!")

Attachments (0)

Change History (1)

comment:1 Changed 7 years ago by brosner

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

Please don't post usage questions to Trac. Take this to django-users or #django on freenode. Create a new ticket with specific information on how to reproduce the bug.

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.