On 21 Sep 2008, at 8:11 pm, [EMAIL PROTECTED] wrote:
>
> Hello Daniel,
>
> Thank you for your reply.
>
> I guess then that I cannot test image heights and widths on a form
> pre-
> save, because that is the only reason I can think of for this error
> after forum submissal (if I use clean_logo)
Hello Daniel,
Thank you for your reply.
I guess then that I cannot test image heights and widths on a form pre-
save, because that is the only reason I can think of for this error
after forum submissal (if I use clean_logo) 'NoneType' object is
unsubscriptable.
Does that make sense ?
--~--~
On Sep 21, 6:01 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> Having done a bit more research I see this often used as:
>
> clean_fieldname(self) rather than clean(self)
>
> which I guess would eleviate my problem, as my clean(self) function
> doesn't appear to remember or pass on the rest
Having done a bit more research I see this often used as:
clean_fieldname(self) rather than clean(self)
which I guess would eleviate my problem, as my clean(self) function
doesn't appear to remember or pass on the rest of the submitted field
information. However when I try the above I get: 'None
Sorry I was wrong, if I try to submit a NEW logo that is too large it
fails correctly. But when I try to add a new logo that is the right
size it enters a fully blank row into the database.
Thanks
--~--~-~--~~~---~--~~
You received this message because you are subs
Hi,
This is my code:
class LogoAdminForm(forms.ModelForm):
class Meta:
model = Logo
def clean(self):
from django.core.files.images import get_image_dimensions
logo = self.cleaned_data['logo']
w, h = get_image_dimensions(logo)
if w > 150 or h > 150:
6 matches
Mail list logo