Permalink
Browse files

Handle file fields too

Note: ImageField inherits from FileField, therefore image fields
are supported too.
  • Loading branch information...
1 parent 31858b3 commit a1b600ba4359b325cd754cc2c71189b30c89187a @matthiask matthiask committed Mar 14, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 scaffolding/management/commands/scaffold.py
View
2 scaffolding/management/commands/scaffold.py
@@ -67,7 +67,7 @@ def make_object(self, cls, fields):
value = generator.next()
if isinstance(field, models.fields.related.ForeignKey) and isinstance(value, int):
field_name = u'%s_id' % field_name
- if isinstance(field, models.fields.files.ImageField):
+ if isinstance(field, models.fields.files.FileField):
getattr(obj, field_name).save(*value, save=False)
else:
setattr(obj, field_name, value)

0 comments on commit a1b600b

Please sign in to comment.