To burn ISO to Flash Drive on a MAC system using Terminal, Open a new Terminal window. Then follow the instructions below.
Continue reading “burn ISO to Flash Drive on a MAC system using Terminal”
Here’s a class that subclasses the ImageField and allows you to set a limit on filesize while still allowing empty entries.
def __init__(self, *args, **kwargs):
super(ImageField50KB, self).__init__(*args, **kwargs)
self.label = (u'Passport (Max 50kB)')
self.helptext = (u'Attach a current passport photograph')
def clean(self, data, initial):
if not data and initial:
f = super(ImageField50KB, self).clean(data)
if not (f.size <= 50000):
raise forms.ValidationError((u'Image is too large, Maximum filesize allowed is 50kB' ))
To use this in your form, copy the code into forms.py and add the following to the form definition:
where BLANK_IMAGE has been declared already to point to a file that will be used as default image in case the field is empty.