IntegerField and null/blank values error

270 views
Skip to first unread message

Matt

unread,
Aug 1, 2008, 9:17:11 PM8/1/08
to Django users
I inherited a Django 0.96 app recently and along with it I inherited
an error which I can't figure out.

The error will happen in the Admin interface whenever I try to add a
new entry if I leave one of the fields blank. At first I thought the
model was missing null=True or blank=True parameters but that isn't
the case. Also, I looked at the underlying table in MySQL and that
column will allow nulls. And yet I still get this error:

(1048, "Column 'order' cannot be null")

In my model, I have an integer field called "order" which is not a FK
or anything, it's just a ranking value to let items be shown in a
certain order on the page. Seems like it should be pretty simple.

I searched this group and google but I'm not seeing anything.

Any ideas?

Thanks!

-/matt/-
http://youell.com/matt

Michael J

unread,
Aug 13, 2008, 2:45:29 PM8/13/08
to Django users
I started another thread with the same issue. You may find this
helpful:
http://groups.google.com/group/django-users/browse_thread/thread/222a2fd5da800ae8/c7d52113b0c2824f?lnk=gst&q=blank%3DTrue#c7d52113b0c2824f


On Aug 1, 8:17 pm, Matt <softbuil...@gmail.com> wrote:
> I inherited a Django 0.96 app recently and along with it I inherited
> an error which I can't figure out.
>
> The error will happen in the Admin interface whenever I try to add a
> new entry if I leave one of the fieldsblank. At first I thought the
> model was missing null=True orblank=True parameters but that isn't
> the case. Also, I looked at the underlying table in MySQL and thatcolumnwill allow nulls. And yet I still get this error:
>
> (1048, "Column'order'cannotbe null")
Reply all
Reply to author
Forward
0 new messages