Re: IntegrityError at /userapp/detail/ NOT NULL constraint failed: userapp_profile.babyinfo_id

2021-05-31 Thread Hugh Frost
Hey bro, i try to combine two model forms in single view django views but i dnt knw how to work with this please check my below code and help me! On Monday, May 31, 2021 at 11:15:29 PM UTC+5:30 Kasper Laudrup wrote: > On 31/05/2021 18.46, Hugh Frost wrote: > > Hii all, > > I hv been struck in

Re: IntegrityError at /userapp/detail/ NOT NULL constraint failed: userapp_profile.babyinfo_id

2021-05-31 Thread Kasper Laudrup
On 31/05/2021 18.46, Hugh Frost wrote: > Hii all, > I hv been struck in last 4 days please fix this error , i'm new to django > Instead of telling people how many days you've spent trying to fix the error, try spend some time on explaining what you've spent the days on doing and what you're trying

Re: IntegrityError: null value in column "user_id" violates not-null constraint

2020-07-31 Thread Sunday Iyanu Ajayi
You will need to login into the database admin page ( maybe pgadmin ) to update the user_id . From your model, user_id can't be null *AJAYI Sunday * (+234) 806 771 5394 *sunnexaj...@gmail.com * On Thu, Jul 30, 2020 at 11:58 AM Dinolin yp job wrote: > > > It worked but the user_id in uploads_u

Re: IntegrityError: null value in column "user_id" violates not-null constraint

2020-07-30 Thread oba stephen
Good to know.. Cheers! On Fri, Jul 31, 2020 at 7:21 AM Dinolin yp job wrote: > Thanks a lot @obastephen it worked. > > On Friday, July 31, 2020 at 12:32:47 AM UTC+5:30 obast...@gmail.com wrote: > >> irst in your UploadSerializer fields use fields = "__all__" >> >> Then you can use this in your

Re: IntegrityError: null value in column "user_id" violates not-null constraint

2020-07-30 Thread Dinolin yp job
Thanks a lot @obastephen it worked. On Friday, July 31, 2020 at 12:32:47 AM UTC+5:30 obast...@gmail.com wrote: > irst in your UploadSerializer fields use fields = "__all__" > > Then you can use this in your views: > > *def post(self, **request, format=None**):* > *upload_file = request.da

Re: IntegrityError: null value in column "user_id" violates not-null constraint

2020-07-30 Thread oba stephen
irst in your UploadSerializer fields use fields = "__all__" Then you can use this in your views: *def post(self, **request, format=None**):* *upload_file = request.data.get("upload_file"**)* *upload_date = **request.data.get("upload_date"**)* *user = request.user

Re: IntegrityError: null value in column "user_id" violates not-null constraint

2020-07-30 Thread oba stephen
first in your UploadSerializer fields use fields = "__all__" Then you can use this in your views: *def post(self, **request, format=None**):* *upload_file = request.data.get("upload_file"**)* *upload_date = **request.data.get("upload_date"**)* *user = request.user

Re: IntegrityError: null value in column "user_id" violates not-null constraint

2020-07-30 Thread Dinolin yp job
I don't have forms.py since I'm creating only the endpoints using rest framework. I've done it earlier and it has worked but earlier the foreign key was to refer the default User model but now I have customized User model by extending AbstractBaseUser. uploads/views.py *class UploadView(

Re: IntegrityError: null value in column "user_id" violates not-null constraint

2020-07-30 Thread oba stephen
You can create an upload form with an Image field, then when saving the for set the User field to request.user. Do you have an UploadForm already in your forms.py? if yes, show me with the view that handles. On Thu, Jul 30, 2020 at 11:59 AM Dinolin yp job wrote: > > > It worked but user_id colu

Re: IntegrityError: null value in column "user_id" violates not-null constraint

2020-07-30 Thread Dinolin yp job
It worked but user_id column in uploads_upload table is empty. How to solve this issue? On Thursday, July 30, 2020 at 3:31:21 PM UTC+5:30 obast...@gmail.com wrote: > From the error, it states that you are trying to add an upload object to > the database without a user. And from your model.py,

Re: IntegrityError: null value in column "user_id" violates not-null constraint

2020-07-30 Thread Dinolin yp job
It worked but the user_id in uploads_upload is empty. How can I can make that work? On Thursday, July 30, 2020 at 3:31:21 PM UTC+5:30 obast...@gmail.com wrote: > From the error, it states that you are trying to add an upload object to > the database without a user. And from your model.py, the

Re: IntegrityError: null value in column "user_id" violates not-null constraint

2020-07-30 Thread oba stephen
>From the error, it states that you are trying to add an upload object to the database without a user. And from your model.py, the User foreign key does not have a null=True, and blank=True. So you can't save a null value for that user field. On Thu, Jul 30, 2020 at 10:52 AM Dinolin yp job wrote:

Re: IntegrityError: NOT NULL constraint failed

2020-05-27 Thread sunday honesty
Thanks Samuel it worked On Thu, May 28, 2020, 12:23 AM Samuel Nogueira wrote: > In your Comment model you have a author field wich is a ForeignKey. The > error is pointing exactly to that field, since it is a not null field. To > overcome this you must pick the ID of the logged user and set the

Re: IntegrityError: FOREIGN KEY constraint failed: Django 2.0.3

2018-03-22 Thread Seven Reeds
Uh, am I not using the ORM? If I am not then what must I do to get back on track? I just realized that i didn't include the "Delete" CBV in my original post. I do not have easy access to the code at the moment so what follows is a rough approximation of what that code is about and is prolly f

Re: IntegrityError: FOREIGN KEY constraint failed: Django 2.0.3

2018-03-21 Thread Simon Charette
Hello Anon, Django doesn't use database level ON DELETE constraints and emulates them in Python to dispatch pre_delete/post_delete signals. As long as you're using the ORM to perform the deletion you shouldn't encounter constraint violations. There's a ticket to add support for database level o

Re: IntegrityError column email is not unique

2016-07-02 Thread M Hashmi
@James As per my understanding I did following. Now it is not adding email if it exists but also its not giving me any error. class GuestCheckoutForm(forms.Form): email = forms.EmailField() email2 = forms.EmailField(label='Verify Email') def clean_email(self): email = self.c

Re: IntegrityError column email is not unique

2016-07-02 Thread M Hashmi
@James As per my understanding I did following. Now it is not adding email if it exists but also its not giving me any error. class GuestCheckoutForm(forms.Form): email = forms.EmailField() email2 = forms.EmailField(label='Verify Email') def clean_email(self): email = self.c

Re: IntegrityError column email is not unique

2016-07-02 Thread M Hashmi
Thanks james for your kind response. Intention is to set a single identifier for guest user account email. If that email exists then user can login or if doesn't he will have to get registered. However let me implement your suggested code and I will respond you back. Thanks again -- You receiv

Re: IntegrityError column email is not unique

2016-07-02 Thread James Schneider
On Jul 2, 2016 7:23 AM, "M Hashmi" wrote: > > I am working on my Checkout view with regular/guest user but getting hard time to come around the integrity error. Idea is to let guest users register with email only to checkout and I need to set the user email unique. > > models.py > > from django.co

Re: IntegrityError for unique_together ?

2016-06-23 Thread Derek
Thanks Simon Those definitions are the closest I can get to the original in terms of type and relationship; what other info is needed? That ticket refers to child models inline - not my situation. Upgrading is on the cards - but still has to be budgeted for Derek On 23 June 2016 at 21:26,

Re: IntegrityError for unique_together ?

2016-06-23 Thread Simon Charette
Hi Derek, It's hard to tell without your exact model admin definitions but I suspect this might be related to #25987[1] which is fixed in Django 1.10. By the way you should at least upgrade to 1.8 as your Django version is not supported anymore and you could be exposed to multiple security issue

Re: IntegrityError

2014-03-28 Thread Lukas Nemec
You need to re-create your database. Good way is to create a script that populates your DB with some test data, and drop DB after a major change, or when something breaks, and re-create it. For now, you should try to create different DB (to preserve your data) and do python manage.py syncdb

Re: IntegrityError --- NOT NULL constraint failed: books_book.publication_date

2014-03-26 Thread Sami Razi
i used python manage.py sqlall you're right sam, when i set null to true, it doesn't really change. thank you so very much. i'm a newbie with databases and i don't know what statements sould i use... i don't know the syntax... i would install south. thank you. thank you so very much. but i'm

Re: IntegrityError --- NOT NULL constraint failed: books_book.publication_date

2014-03-26 Thread Sam Walters
Did you perhaps change the schema of the database after you had created it. Eg: added null=True as a constraint after creating the table? If so check the db sheme using: python manage.py sqlall It sounds simple enough. You will have to go into the db shell and update your schema manually. usin

Re: IntegrityError with proxy model but not with parent?

2013-09-26 Thread Rafael Durán Castañeda
Hi, As long as I know, a model form needs the fields to be included in order to get validation working, so I suspect you did something like this: class ProxyForm(forms.ModelForm): class Meta: model = models.Myproxy fields = ('name', ) Since stuff field is not included in the

Re: IntegrityError after updating to custom user field: django_admin_log still has fk to auth_user

2013-03-02 Thread Peter of the Norse
This sound like a South kind of problem. Your tables were created with a foreign key from django_admin_log to auth_user, but you’re not longer using auth_user. You’ll have to drop the foreign key and recreate it to remove this error. On Feb 27, 2013, at 4:17 PM, Ben Roberts wrote: > This ring

Re: IntegrityError when creating a brand new model instance

2013-02-16 Thread Some Developer
On 11/02/13 14:54, Bill Freeman wrote: On Sun, Feb 10, 2013 at 10:50 AM, Some Developer mailto:someukdevelo...@gmail.com>> wrote: On 10/02/13 15:07, Bill Freeman wrote: Did you previously have a field named 'title' in this model that was marked unique, that you have since

Re: IntegrityError when creating a brand new model instance

2013-02-11 Thread Bill Freeman
On Sun, Feb 10, 2013 at 10:50 AM, Some Developer wrote: > On 10/02/13 15:07, Bill Freeman wrote: > >> Did you previously have a field named 'title' in this model that was >> marked unique, that you have since removed? If so, the column may still >> be in the database with a unique constraint. Si

Re: IntegrityError when creating a brand new model instance

2013-02-10 Thread Some Developer
On 10/02/13 15:07, Bill Freeman wrote: Did you previously have a field named 'title' in this model that was marked unique, that you have since removed? If so, the column may still be in the database with a unique constraint. Since it's no longer in the model, some default may be being used when

Re: IntegrityError when creating a brand new model instance

2013-02-10 Thread Bill Freeman
Did you previously have a field named 'title' in this model that was marked unique, that you have since removed? If so, the column may still be in the database with a unique constraint. Since it's no longer in the model, some default may be being used when you save, and that's obviously not uniqu

Re: IntegrityError when creating a brand new model instance

2013-02-09 Thread Some Developer
On 08/02/13 14:08, Andre Terra wrote: Please post traceback, settings.py, etc. On Fri, Feb 8, 2013 at 5:18 AM, Some Developer mailto:someukdevelo...@gmail.com>> wrote: I have a model for a Tag object with simply has two fields. A title (which has the unique constraint) and a description

Re: IntegrityError when creating a brand new model instance

2013-02-08 Thread Some Developer
On 08/02/13 14:08, Andre Terra wrote: Please post traceback, settings.py, etc. On Fri, Feb 8, 2013 at 5:18 AM, Some Developer mailto:someukdevelo...@gmail.com>> wrote: I have a model for a Tag object with simply has two fields. A title (which has the unique constraint) and a description

Re: IntegrityError when creating a brand new model instance

2013-02-08 Thread Andre Terra
Please post traceback, settings.py, etc. On Fri, Feb 8, 2013 at 5:18 AM, Some Developer wrote: > I have a model for a Tag object with simply has two fields. A title (which > has the unique constraint) and a description. I also have a FormView based > view class which handles the creation of Tag o

Re: IntegrityError

2012-12-18 Thread Satinderpal Singh
On Tue, Dec 18, 2012 at 12:25 PM, Sandeep kaur wrote: > On Tue, Dec 18, 2012 at 2:48 AM, Satinderpal Singh > wrote: >> I created a search box for searching the information about the client >> so that this information uses to create the report. > > add these lines : > >> def search(request): > >>

Re: IntegrityError

2012-12-18 Thread Satinderpal Singh
On Tue, Dec 18, 2012 at 11:21 AM, Chris Cogdon wrote: > Can you post the code for the model, and the complete exception trace? class head(models.Model): job = models.ForeignKey(Job, null=True) Header_column_1 = models.CharField(max_length=255,blank=True) Header_column_2 = models.CharF

Re: IntegrityError

2012-12-17 Thread Chris Cogdon
I'd need to see the source for Job and that other model, plus a proper exception traceback, so I can tell at what point the IntegrityError is being thrown. also, you should not be using form.save() there... if you do a commit=False to get a copy of the model, you only need to save that model...

Re: IntegrityError

2012-12-17 Thread Sandeep kaur
On Tue, Dec 18, 2012 at 2:48 AM, Satinderpal Singh wrote: > I created a search box for searching the information about the client > so that this information uses to create the report. add these lines : > def search(request): > {% endfor %} > > i want to get job id to be saved through head

Re: IntegrityError

2012-12-17 Thread Chris Cogdon
Can you post the code for the model, and the complete exception trace? I ask you use something that will properly maintain the intending, such as pastebin or dpaste. On Monday, December 17, 2012 1:18:54 PM UTC-8, Satinderpal Singh wrote: > > I created a search box for searching the information a

Re: IntegrityError at /add/ PRIMARY KEY must be unique

2012-09-27 Thread akaariai
.create() creates the object into DB, then .save(force_insert=True) tries to insert the same object with the same ID again -> integrity error. Seems like you don't need the second save at all. - Anssi On 27 syys, 15:39, Amyth Arora wrote: > Not quite sure, but it seems like the save() method is

Re: IntegrityError at /add/ PRIMARY KEY must be unique

2012-09-27 Thread Amyth Arora
Not quite sure, but it seems like the save() method is being called twice so it is trying to create insert an entry with a primary key that already exists. On Thu, Sep 27, 2012 at 2:23 PM, enemybass wrote: > http://wklej.org/id/837631/ - models, traceback, urls, views, database > structure > >

Re: IntegrityError at /register/ auth_user.username may not be NULL

2012-03-28 Thread laurence Turpin
On Mar 28, 9:38 pm, Daniel Roseman wrote: > On Wednesday, 28 March 2012 20:31:09 UTC+1, laurence Turpin wrote: > > > I'm getting the following error with my registration  section of my > > program. > > > IntegrityError at /register/ > > auth_user.username may not be NULL > > > I am using django

Re: IntegrityError at /register/ auth_user.username may not be NULL

2012-03-28 Thread Daniel Roseman
On Wednesday, 28 March 2012 20:31:09 UTC+1, laurence Turpin wrote: > > I'm getting the following error with my registration section of my > program. > > IntegrityError at /register/ > auth_user.username may not be NULL > > I am using django 1.3.1 and python 2.7.2 and I'm using sqlite3 as the

Re: IntegrityError while testing

2012-02-15 Thread xina towner
I think the problem is that the testing tool is trying to reset the database and when it tries to truncate this table it can't. Well, I'm pretty sure, but I don't know how to fix it. The table references itself. On 15 February 2012 14:06, 赵帅 wrote: > > Did you delete one key or update the key to

Re: IntegrityError while testing

2012-02-15 Thread 赵帅
Did you delete one key or update the key to different values that was referenced by another table as foreign key. 2012/2/15 xina towner > Hello, I get this error when I try to test my app. I'm using mysql. I > think it's when django tries to delete the table. I've tried with all On > delete optio

Re: IntegrityError: bookings_business.slug may not be NULL on .create()

2011-11-17 Thread Tom Evans
On Thu, Nov 17, 2011 at 12:48 PM, Mario Gudelj wrote: > Hi guys, > I have this issue I can not work out for the life of me. I would really > appreciate it if someone could help. > This is my model: > class Business(models.Model): >     ... >     slug = models.SlugField("Slug", max_length=255, uniq

Re: IntegrityError

2010-07-10 Thread Justin Myers
As another idea, can you just update your SITE_ID setting (http:// docs.djangoproject.com/en/1.2/ref/settings/#site-id)? It defaults to 1 (for the example.com instance), but if you've got a new Site object for your actual domain, you should just be able to use its id instead. -Justin On Jul 10, 7:

Re: IntegrityError

2010-07-10 Thread Karen Tracey
On Sat, Jul 10, 2010 at 2:04 AM, Fynn wrote: > Exception Type: IntegrityError at /comments/post/ > Exception Value: insert or update on table "django_comments" violates > foreign key constraint "django_comments_site_id_fkey" > DETAIL: Key (site_id)=(1) is not present in table "django_site". > >

Re: IntegrityError exception not caught by Django

2010-06-14 Thread felix
thanks again anssi, stellar reply I might do this below. the tracking is the last thing to happen before rendering, so there are no more UPDATE or INSERTS and in most cases views that use tracking don't do anything but select anyway but OTOH I'm already running rabbit and celery so I might mess

Re: IntegrityError exception not caught by Django

2010-06-14 Thread akaariai
On Jun 14, 1:24 am, felix wrote: > brilliant, you are correct: > > Foreign-key constraints: >     "traffic_tracking2010_content_type_id_fkey" FOREIGN KEY > (content_type_id) REFERENCES django_content_type(id) DEFERRABLE > INITIALLY DEFERRED >     "traffic_tracking2010_src_content_type_id_fkey" FOR

Re: IntegrityError exception not caught by Django

2010-06-13 Thread felix
brilliant, you are correct: Foreign-key constraints: "traffic_tracking2010_content_type_id_fkey" FOREIGN KEY (content_type_id) REFERENCES django_content_type(id) DEFERRABLE INITIALLY DEFERRED "traffic_tracking2010_src_content_type_id_fkey" FOREIGN KEY (src_content_type_id) REFERENCES djan

Re: IntegrityError exception not caught by Django

2010-06-13 Thread akaariai
> Can anybody figure out why the IntegrityError doesn't get thrown till > then ? > Why didn't Django catch errors thrown in middleware ? Most likely the foreign keys are defined as "deferrable initially deferred", meaning that the database doesn't check them before commit. And this of course mean

Re: IntegrityError: foreign key violation upon delete

2010-03-30 Thread naos
Problem has been solved and it doesn't have connection to any bugs, it was just programming error (there was shipment.save() somewhere later in python code) On Mar 30, 10:21 am, naos wrote: > Hi all, > > I have problem with foreign key contraint upon calling delete() on my > model. Here's my prob

Re: IntegrityError: may not be NULL for my simple override of models.DateTimeField

2009-09-23 Thread Jim DeLaHunt
Karen: Yayyy!!! Thank you! On Sep 23, 11:45 am, Karen Tracey wrote: ... > /home/kmt/software/web/playground/ttt/newfields.py(56)to_python() > > -> utc_dt = super(DateTimeFieldInTZ, self).__init__(value, *args, **kwargs) ... > I don't actually have a clue what the code here is trying to do,

Re: IntegrityError: may not be NULL for my simple override of models.DateTimeField

2009-09-23 Thread Karen Tracey
On Wed, Sep 23, 2009 at 12:47 PM, Jim DeLaHunt wrote: > > Karen: > > Thank you so much for your reply. > > On Sep 23, 7:01 am, Karen Tracey wrote: > > What you haven't shared is the code for DateTimeFieldInTZ. It's going to > be > > rather hard to figure out what is going wrong without seeing th

Re: IntegrityError: may not be NULL for my simple override of models.DateTimeField

2009-09-23 Thread Jim DeLaHunt
Karen: Thank you so much for your reply. On Sep 23, 7:01 am, Karen Tracey wrote: > What you haven't shared is the code for DateTimeFieldInTZ.  It's going to be > rather hard to figure out what is going wrong without seeing that code. ... > If you show us what is in the DateTimeFieldInTZ impleme

Re: IntegrityError: may not be NULL for my simple override of models.DateTimeField

2009-09-23 Thread Karen Tracey
On Wed, Sep 23, 2009 at 4:46 AM, Jim DeLaHunt wrote: > > Hi, folks: > > I'm new to Django. It's a very powerful system, and I appreciate the > work of the people who built it up into what I'm benefiting from. > > I'm having a difficulty with a very simple app which exercises a > custom field type

Re: IntegrityError!!!

2009-08-12 Thread Karen Tracey
On Wed, Aug 12, 2009 at 8:03 AM, rekha wrote: > > Hi all, > im a newbie, developing online address book application using django, > mod_python, apache2, postgresql. > > i have two tables in my database viz login_table and contact_table.. > login_table stores username and password.. contact table

Re: IntegrityError: columns app_label, model are not unique

2009-03-09 Thread Russell Keith-Magee
On Mon, Mar 9, 2009 at 4:00 AM, He Jibo wrote: > Thank you so much for your detailed explanation. I have tried your > suggestion of "The relatively simple solution that _might_ work (depending > on the details of your project) is to remove references to contrib.auth and > contrib.contenttypes in

Re: IntegrityError: columns app_label, model are not unique

2009-03-08 Thread He Jibo
Thank you so much for your detailed explanation. I have tried your suggestion of "The relatively simple solution that _might_ work (depending on the details of your project) is to remove references to contrib.auth and contrib.contenttypes in your fixture. " It seems to work. However, I confronted a

Re: IntegrityError: columns app_label, model are not unique

2009-03-08 Thread Russell Keith-Magee
On Sun, Mar 8, 2009 at 2:24 PM, He Jibo wrote: > Dear All, > > I ran into the following error of "IntegrityError: columns app_label, model > are not unique" when I tried to > Sync the data to the db with the command of "manage.py syncdb". I am using > python2.5, Django-1.0.2-final, and Window XP.

Re: IntegrityError in admin with django-tagging

2008-10-02 Thread smcoll
Found help on IRC: Since my TagField is named "tags", i have to set ``tag_descriptor_attr`` to some other name when registering it. tagging.register(Post, tag_descriptor_attr='_tags') On Oct 2, 12:01 pm, smcoll <[EMAIL PROTECTED]> wrote: > Can someone tell me if i set up the model and admin cor

Re: IntegrityError in admin with django-tagging

2008-10-02 Thread smcoll
Can someone tell me if i set up the model and admin correctly? On Sep 30, 2:05 pm, smcoll <[EMAIL PROTECTED]> wrote: > i'm trying to get a TagField working in the admin for my model using > django-tagging 0.2.  i get an IntegrityError when i save my model from > the admin- it looks like django is

Re: IntegrityError on newforms-admin

2008-05-09 Thread Nuno Mariz
Thanks Brian, One more question, there is another way to write a custom validator without override the field type? Nuno On May 9, 5:30 pm, Brian Rosner <[EMAIL PROTECTED]> wrote: > On May 9, 4:31 am, Nuno Mariz <[EMAIL PROTECTED]> wrote: > > > I'm using newforms-admin and I've got a "duplicate k

Re: IntegrityError on newforms-admin

2008-05-09 Thread Brian Rosner
On May 9, 4:31 am, Nuno Mariz <[EMAIL PROTECTED]> wrote: > I'm using newforms-admin and I've got a "duplicate key violates unique > constraint" when I'm added new record(with the same value on field > that already exists in the db) in admin interface. > I've an "unique=True" in the field, should

Re: IntegrityError: duplicate key violates unique constraint

2008-03-31 Thread makebelieve
The problem there was that much of the data I was importing came from the site's old MySQL database from before I started using PostGIS and GeoDjango. Does anyone know if there's a way to tell Postgresql to automatically detect what's in the table and resequence? On Mar 28, 1:17 pm, "Brian Armstr

Re: IntegrityError: duplicate key violates unique constraint

2008-03-31 Thread makebelieve
Yes, of course there is a constraint there: the primary key, which of course I don't want to remove. Marty's solution was it. Thanks for the assistance. On Mar 28, 12:50 pm, "James Bennett" <[EMAIL PROTECTED]> wrote: > On Fri, Mar 28, 2008 at 2:35 PM, makebelieve <[EMAIL PROTECTED]> wrote: > >

Re: IntegrityError: duplicate key violates unique constraint

2008-03-31 Thread makebelieve
You, my friend, rule. That's exactly what I needed to do. I've just recently moved from MySQL and am at the point in which I appreciate Postgresql's strictness, but I am still getting used to it. On Mar 28, 12:57 pm, "Marty Alchin" <[EMAIL PROTECTED]> wrote: > Given that you say you're working

Re: IntegrityError: duplicate key violates unique constraint

2008-03-28 Thread Brian Armstrong
Also, if you have access to the old DB still, consider exporting the entire thing out again. Make sure that you include the structural part as well as the data itself. It should export it directly as a series of SQL statements. A complete dump will provide information about the sequences. --~-

Re: IntegrityError: duplicate key violates unique constraint

2008-03-28 Thread Marty Alchin
Given that you say you're working with PG Navicat, I assume you're using Postgresql as your database. Postgresql has a concept of sequences, which it uses to generate IDs for auto-generated fields like Django's AutoField. I think what you've done, by copying data in directly, is created records w

Re: IntegrityError: duplicate key violates unique constraint

2008-03-28 Thread James Bennett
On Fri, Mar 28, 2008 at 2:35 PM, makebelieve <[EMAIL PROTECTED]> wrote: > I haven't added any unique contraints. It really seems as though > django doesn't know > about my existing data. If I obliterate the old data everything works > fine, but > that's not a possibility. At the database l

Re: IntegrityError: duplicate key violates unique constraint

2008-03-28 Thread makebelieve
I haven't added any unique contraints. It really seems as though django doesn't know about my existing data. If I obliterate the old data everything works fine, but that's not a possibility. On Mar 28, 12:13 pm, "James Bennett" <[EMAIL PROTECTED]> wrote: > On Fri, Mar 28, 2008 at 2:10 PM, makeb

Re: IntegrityError: duplicate key violates unique constraint

2008-03-28 Thread James Bennett
On Fri, Mar 28, 2008 at 2:10 PM, makebelieve <[EMAIL PROTECTED]> wrote: > Saving some of my objects work, but only because early IDs have been > removed > so it isn't trying to insert an object with an existing ID. It sounds like you have a unique constraint in the DB that you haven't told Dja

Re: IntegrityError: duplicate key violates unique constraint

2008-03-28 Thread makebelieve
I'm really in a bind here and need to get my site back up. Any help at all will be greatly appreciated. Saving some of my objects work, but only because early IDs have been removed so it isn't trying to insert an object with an existing ID. Is there anyway to make django 'know' about the existin

Re: IntegrityError on unique_together constraint, save() use INSERT instead of UPDATE

2008-03-25 Thread Malcolm Tredinnick
On Tue, 2008-03-25 at 06:24 -0700, sector119 wrote: > My models has primary key it's 'id' field and this field is > prepopulated in Person.save() method > > def _get_id(self): > return int(str(self.pid)+str(self.location.id)) > > def save(self, raw=False): > self.id = se

Re: IntegrityError on unique_together constraint, save() use INSERT instead of UPDATE

2008-03-25 Thread sector119
My models has primary key it's 'id' field and this field is prepopulated in Person.save() method def _get_id(self): return int(str(self.pid)+str(self.location.id)) def save(self, raw=False): self.id = self._get_id() super(Person, self).save(raw=raw) But in: class

Re: IntegrityError on unique_together constraint, save() use INSERT instead of UPDATE

2008-03-25 Thread Malcolm Tredinnick
On Tue, 2008-03-25 at 05:51 -0700, sector119 wrote: [...] > I try to write my own comand to manage.py which imports data in some > format to the db. > I write my own serializer which yields > base.DeserializedObject(self.model(**data), m2m_data). > > When I run deserlialized object save method I

Re: IntegrityError, MySQL, unicode strings equality (accents and umlauts)

2007-08-22 Thread ludo
It should be a collation issue. mysql> set names utf8; Query OK, 0 rows affected (0.00 sec) mysql> select 'm n'='men'; +--+ | 'm n'='men' | +--+ |1 | +--+ 1 row in set (0.00 sec) You might want to use the SELECT BINARY operator: mysql> select bin

Re: IntegrityError: null value in column "id" when inserting via admin

2007-06-08 Thread omat
This was because the default values of the id fields nextval(...) s were not created in the new db, when I port the data by backup & restore. On 7 Haziran, 21:11, omat <[EMAIL PROTECTED]> wrote: > By the way, I suspect that during moving existing data into the new > database, somethings might h

Re: IntegrityError: null value in column "id" when inserting via admin

2007-06-07 Thread omat
By the way, I suspect that during moving existing data into the new database, somethings might have been broken, like auto incrementation sequences. But, although I experimented with them a little, it didn't help. On 7 Haziran, 21:07, omat <[EMAIL PROTECTED]> wrote: > My application is working

Re: IntegrityError Handling

2007-05-01 Thread Malcolm Tredinnick
On Tue, 2007-05-01 at 05:42 -0700, sandro.dentella wrote: > hi all, > > I noticed that recently has been added InterityError as a common > exception > for all db (django.db.IntegrityError), so I wanted to make my view > aware > of that, but I'm uncertain on how to accomplish this. > > I

Re: IntegrityError, Duplicate key, MySQL 5, blank and unique

2006-03-06 Thread Malcolm Tredinnick
On Mon, 2006-03-06 at 12:59 +0300, Ivan Sagalaev wrote: > Malcolm Tredinnick wrote: > > >In a correct SQL implementation, NULL is not comparable to anything, > > > > > Yes... It should be :-). And as you said implementation is the whole > another businness. johnsu01 talked about MySQL and give

Re: IntegrityError, Duplicate key, MySQL 5, blank and unique

2006-03-06 Thread Ivan Sagalaev
Malcolm Tredinnick wrote: >In a correct SQL implementation, NULL is not comparable to anything, > > Yes... It should be :-). And as you said implementation is the whole another businness. johnsu01 talked about MySQL and given its history of not very strong adherence to standard but preferring

Re: IntegrityError, Duplicate key, MySQL 5, blank and unique

2006-03-06 Thread Malcolm Tredinnick
On Mon, 2006-03-06 at 11:25 +0300, Ivan Sagalaev wrote: > johnsu01 wrote: > > >Using trunk, I have a model that has a number of fields which are > >CharFields, that I would like to be optional but if they are filled > >out, unique. > > > > > I may be well wrong but I don't think you can express

Re: IntegrityError, Duplicate key, MySQL 5, blank and unique

2006-03-06 Thread Ivan Sagalaev
Ivan Sagalaev wrote: > if model.get_list(**{'self.field_name'+'__exact':field_data}) > > Ouch :-) Make this 'get_list' to be 'get_count' instead... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django

Re: IntegrityError, Duplicate key, MySQL 5, blank and unique

2006-03-06 Thread Ivan Sagalaev
johnsu01 wrote: >Using trunk, I have a model that has a number of fields which are >CharFields, that I would like to be optional but if they are filled >out, unique. > > I may be well wrong but I don't think you can express this at DB level. Uniqueness at DB level includes empty value (even NU