I have a little project I am working. I am writing django database to hold some data. I have one ManyToManyField.
I am using my own Manager and adding methods for convience. I have one that adds different tasks to the users to do list. These items can be assigned to many people and so on.
When I do this I am getting an IntegrityError What is the main cause of this? The exact error I am getting is.
...items_id may not be NULL
I would appreciate answer on how to fix this. Also an explanation on how this exception is thrown. I have been told to catch it. But I dont like things being thrown unless they need to be.
Please and thank you!
Turns out all I needed to do was clean out my database with a
python manage.py sqlflushEverything was fine afterwards. I then added south to help with migrations in the future.I would advise caution since
sqlflushwill return your database to back the state of the last syncdb.