Skip to content

Instantly share code, notes, and snippets.

@rightx2
Last active October 30, 2016 02:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rightx2/19da0ba122366f7b9cffab16f8e1255f to your computer and use it in GitHub Desktop.
Save rightx2/19da0ba122366f7b9cffab16f8e1255f to your computer and use it in GitHub Desktop.
strange thing happens
## models.py
class OrderImage(TimeStampedModel):
img = models.ImageField()
name = models.CharField(max_length=40)
## forms.py
class OrderImageForm(forms.ModelForm):
class Meta:
model = OrderImage
fields = ['img', 'name',]
def clean_name(self):
print("name")
def clean_img(self):
print("img")
## tests.py
def test_a(self):
form = OrderImageForm({
'img':'b',
'name':'a'
})
form.is_valid()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment