Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.
  • Root
  • » Django
  • » Newbie here, needs help with ImageField [RSS Feed]

#1 March 10, 2008 13:55:08

f.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Newbie here, needs help with ImageField


Hi,

I've read the tutorial, and bits of docs here and there. I would like
to thank the great Django community for making this a splendid
learning experience!

So, I felt confident enough to start writing a simple image gallery
app.

Here's the code for the main app's models.py.http://dpaste.com/38695/I've enabled the admin app, syncdb'd and created a user. So I log in,
but the image upload doesn't work.

When I pick an image and click on Save, the form complains that there
is an error I need to fix, but it doesn't pinpoint the erroneous
field.

After a while, I tried to remove the lines 59 and 60, and also the
width_field, and height_field from line 58. I also removed the
matching columns from the MySQL database manually, because syncdb
doesn't do that for me. Then I restarted the app, but then I had a
different situation. The image and its record get saved, but the
post_save signal is not emitted (aparently, because there is nothing
in the admin's history view for the item, not even its creation) and
instead of the admin page, I get an error page which says 'width'
field doesn't have a default value.

Can anyone please take a look at dpaste and tell me if I did something
wrong there? (I'm almost sure I did.)

Thanks,


Branko
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en-~----------~----~----~----~------~----~------~--~---

Offline

#2 March 10, 2008 14:10:41

Michael N.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Newbie here, needs help with ImageField


Passing your error along would be helpful because it will help us
pinpoint exactly what part of your code is having issues. Python
traceback is amazing helpful in that if you follow its path, even
though it might not look like anything initially, it will lead you to
what the problem is. This is why I would swear by python over most
other programming languages.

t.save should be t.save() as it is a function call.
Also it might be dpaste but it looks like you are having issues with
tabs. In python that whitespace is really important and if your error
has anything to do with unexpected indent it's because of that.

Anyway change the t.save() call and post your error and we can figure
out exactly what the error is.

Michael

On Mar 10, 8:54 am, foxbunny <> wrote:
> Hi,
>
> I've read the tutorial, and bits of docs here and there. I would like
> to thank the great Django community for making this a splendid
> learning experience!
>
> So, I felt confident enough to start writing a simple image gallery
> app.
>
> Here's the code for the main app's models.py.
>
>http://dpaste.com/38695/>
> I've enabled the admin app, syncdb'd and created a user. So I log in,
> but the image upload doesn't work.
>
> When I pick an image and click on Save, the form complains that there
> is an error I need to fix, but it doesn't pinpoint the erroneous
> field.
>
> After a while, I tried to remove the lines 59 and 60, and also the
> width_field, and height_field from line 58. I also removed the
> matching columns from the MySQL database manually, because syncdb
> doesn't do that for me. Then I restarted the app, but then I had a
> different situation. The image and its record get saved, but the
> post_save signal is not emitted (aparently, because there is nothing
> in the admin's history view for the item, not even its creation) and
> instead of the admin page, I get an error page which says 'width'
> field doesn't have a default value.
>
> Can anyone please take a look at dpaste and tell me if I did something
> wrong there? (I'm almost sure I did.)
>
> Thanks,
>
> Branko
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en-~----------~----~----~----~------~----~------~--~---

Offline

#3 March 10, 2008 14:39:53

f.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Newbie here, needs help with ImageField


On Mar 10, 2:10 pm, Michael Newman <> wrote:
> Passing your error along would be helpful because it will help us
> pinpoint exactly what part of your code is having issues. Python
> traceback is amazing helpful in that if you follow its path, even
> though it might not look like anything initially, it will lead you to
> what the problem is. This is why I would swear by python over most
> other programming languages.

I will paste the error messages as soon as I get home. I don't have
access to my code and Python right now.

> t.save should be t.save() as it is a function call.
> Also it might be dpaste but it looks like you are having issues with
> tabs. In python that whitespace is really important and if your error
> has anything to do with unexpected indent it's because of that.

I will double-check the tabs. I've spotted a few things that I think
might have caught your attention. :)

> Anyway change the t.save() call and post your error and we can figure
> out exactly what the error is.

I will do so. I come from Rails world, so I'm not yet used to calling
a function with ().

Thanks for the input, Michael.


Branko

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en-~----------~----~----~----~------~----~------~--~---

Offline

  • Root
  • » Django
  • » Newbie here, needs help with ImageField [RSS Feed]

Board footer

Moderator control

Enjoy the 16th of December
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support