On Tue, Oct 6, 2009 at 3:31 PM, Aaron <aa...@genieknows.com> wrote:

>
> On Oct 6, 4:20 pm, Karen Tracey <kmtra...@gmail.com> wrote:
> > On Tue, Oct 6, 2009 at 2:49 PM, Aaron <aa...@genieknows.com> wrote:
> >
> > > Just tried it, like this:
> >
> > > class MyModel(models.Model):
> > >    myfield = models.CharField(unique = True, blank = True, null =
> > > True)
> >
> > That can't be right because this field is missing max_length.
>
> Well, I was simplifying things a bit.
>
> If you really must know, myfield is actually a SlugField.
> I also have __unicode__ defined, which returns another field that I'm
> not dealing with here.
>
>
> I can't recreate that.  I only get IntegrityError for a non-empty-string
> > duplicate value
>
> I see you were trying it programmatically.  I was attempting to create
> the model through the admin interface.  I know the admin inserts empty
> strings instead of NULLs for character fields by default, but I was
> hoping that my save() code would override that.
>
>
I showed it from the shell because that's easiest to demonstrate.  But it
also works for the model you have included here even from admin.  If it's
not working for the model you actually have then it is due to some
difference between what you have posted and what you are actually using.

Simplifying is good, so long as you haven't simplified to the point where
the error no longer appears, which is what you seem to have done in this
case.  You might try starting from the simplified case and adding back in
the things you removed in simplification to figure out which one causes a
problem.  That would be a hint.

Karen

--~--~---------~--~----~------------~-------~--~----~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to