Hi there,

I'm unable to do any testing -- my fixtures fail with a "Duplicate
Entry" error when loading. From what I've googled, this might have
something to do with a mismatch between my model definitions and the
sql table definition. This fails on a model that I've done a lot of
manual sql editing on, so it's likely that I've inadvertently screwed
something up. After messing with this for an afternoon, I'm just going
to post the first few lines of the model and the output of DESCRIBE
TABLE, and I hope someone will see something obviously wrong here. The
fixture loading fails like this:
IntegrityError: (1062, "Duplicate entry 'dbase-author' for key 2")

The only unusual thing about the second record is that it's the first
one with "characters" set to an empty string. I'm using a django
updated earlier in the day.

model
####

class Author(models.Model):
  surname = models.CharField(max_length=30)
  given_name = models.CharField(max_length=30)
  slug = models.SlugField(blank=True)
  characters = models.CharField(max_length=6,blank=True)
  user = models.ForeignKey(User, blank=True, null=True)
...more

DESCRIBE TABLE
#####
Field Type Null Key Default Extra
id int(11) no pri null auto_increment
surname varchar(30) no [blank] [blank] [blank]
given_name varchar(30) no [blank] [blank] [blank]
slug varchar(50) no [blank] [blank] [blank]
characters varchar(6) no [blank] [blank] [blank]
user_id int(11) yes mul null [blank]
...more


Is this something to do with having a foreignkey that's set to
blank=True,null=True?

TIA,
Eric
--~--~---------~--~----~------------~-------~--~----~
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