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

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

2021-05-31 Thread Hugh Frost
Hii all, I hv been struck in last 4 days please fix this error , i'm new to django -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googl

IntegrityError on a foreign key constraint

2021-01-30 Thread degnon...@gmail.com
Hi, I'm having a really incomprehensible error currently. We are working with three models here, "DataImport", "Contact" and "Dataset", the DataImport model import data from a file to a Dataset object, the data is imported as a Contact object , the DataImport model have a foreign key to the Dat

IntegrityError - null value in column "email" violates not-null constraint

2020-08-04 Thread Francisco André
Hey guys. I'm developing a new project and creating a custom user model, extending the AbstractBaseUser class, but when add a new user in admin interface or modelform I get the error: IntegrityError at /null value in column "email" violates not-null constraint. The field ema

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:

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

2020-07-30 Thread Dinolin yp job
I'm trying to save image in postgres database. I have upload model which has a foreign key reference to the extended custom user model. But it shows the following error uploads/model.py from django.db import models from django.contrib.auth import get_user_model User = get_user_model() class U

Re: IntegrityError: NOT NULL constraint failed

2020-05-27 Thread sunday honesty
re > new_comment.save() > > > > *De: *sunday honesty > *Enviado:*quarta-feira, 27 de maio de 2020 19:36 > *Para: *Django users > *Assunto: *IntegrityError: NOT NULL constraint failed > > > > I try to let user add comments to blog post am making... When I run &

RES: IntegrityError: NOT NULL constraint failed

2020-05-27 Thread Samuel Nogueira
: IntegrityError: NOT NULL constraint failed I try to let user add comments to blog post am making... When I run makemigrations and migrate, everything seemed fine . The form displayed well but shows the following error when I fill the form and click on the submit button. Django.db.utils.IntegrityError

IntegrityError: NOT NULL constraint failed

2020-05-27 Thread sunday honesty
I try to let user add comments to blog post am making... When I run makemigrations and migrate, everything seemed fine . The form displayed well but shows the following error when I fill the form and click on the submit button. Django.db.utils.IntegrityError: NOT NULL constraint failed: blog_co

Re: UniqueConstraint raises uncaught IntegrityError in Admin

2019-07-17 Thread Michael Barr
rit : >>> >>> Hey there, >>> >>> I'm trying out the new UniqueConstraint functionality in Django 2.2 and >>> seem to be misunderstanding something. When adding a Constraint to the >>> model I am getting an uncaught IntegrityError in the admin

Re: UniqueConstraint raises uncaught IntegrityError in Admin

2019-07-16 Thread Derek
Hey there, >> >> I'm trying out the new UniqueConstraint functionality in Django 2.2 and >> seem to be misunderstanding something. When adding a Constraint to the >> model I am getting an uncaught IntegrityError in the admin. >> I've got the following s

Re: UniqueConstraint raises uncaught IntegrityError in Admin

2019-07-15 Thread Michael Barr
er you’ll get a database integrity error on > save(). UniqueConstraints are different in this regard, in that they > leverage the existing validate_unique() logic, and thus enable two-stage > validation. In addition to IntegrityError on save(), ValidationError is > also raised durin

Re: UniqueConstraint raises uncaught IntegrityError in Admin

2019-04-09 Thread Simon Charette
Hey there, > > I'm trying out the new UniqueConstraint functionality in Django 2.2 and > seem to be misunderstanding something. When adding a Constraint to the > model I am getting an uncaught IntegrityError in the admin. > I've got the following sample c

Re: UniqueConstraint raises uncaught IntegrityError in Admin

2019-04-09 Thread Robin Riis
> I'm trying out the new UniqueConstraint functionality in Django 2.2 and > seem to be misunderstanding something. When adding a Constraint to the > model I am getting an uncaught IntegrityError in the admin. > I've got the following sample code: > > *models.

UniqueConstraint raises uncaught IntegrityError in Admin

2019-04-09 Thread Ryan Jarvis
Hey there, I'm trying out the new UniqueConstraint functionality in Django 2.2 and seem to be misunderstanding something. When adding a Constraint to the model I am getting an uncaught IntegrityError in the admin. I've got the following sample code: *models.py* class Seminar(mo

Need your help to fix IntegrityError in my Django code.

2018-07-02 Thread prateek gupta
Hi All, I have created a simple database admin panel (Django2..6+Python3.6+Mysql5.7) where admin can operate create/edit/delete operations of database. I am facing following IntegrityError error when I try to Merge two products and click on Preview from my Django admin panel- 2018-07-02 16:17

Re: IntegrityError: FOREIGN KEY constraint failed: Django 2.0.3

2018-03-22 Thread Seven Reeds
t; > Le mercredi 21 mars 2018 10:50:25 UTC-4, Anon Ymous a écrit : >> >> Hi, >> >> I am learning python by trying to create a small Django app. I may have >> found a bug related to Django and/or sqlite3. If you are stackoverflow >> folks then my initial

Re: IntegrityError: FOREIGN KEY constraint failed: Django 2.0.3

2018-03-21 Thread Simon Charette
Django and/or sqlite3. If you are stackoverflow > folks then my initial post is there: > https://stackoverflow.com/questions/49361834/integrityerror-exception-in-deleteview-cbv > > My app really is just creating a small web site to add users and figure > out how to do CRUD ope

IntegrityError: FOREIGN KEY constraint failed: Django 2.0.3

2018-03-21 Thread Anon Ymous
Hi, I am learning python by trying to create a small Django app. I may have found a bug related to Django and/or sqlite3. If you are stackoverflow folks then my initial post is there: https://stackoverflow.com/questions/49361834/integrityerror-exception-in-deleteview-cbv My app really is

Re: get_or_create IntegrityError

2017-02-16 Thread Vijay Khemlani
> One of my users then filled out a form that ran some code that would > 'get_or_create' on the Lookups model. It threw an IntegrityError saying > that the Key (id)=# already exists. > Upon further investigation, I realized that the id # was one that I had > already entere

get_or_create IntegrityError

2017-02-16 Thread Matthew Pava
would 'get_or_create' on the Lookups model. It threw an IntegrityError saying that the Key (id)=# already exists. Upon further investigation, I realized that the id # was one that I had already entered manually in the database several days ago. Only after the user kept running that fo

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
> return self.form_valid(form) > else: > return self.form_invalid(form) > > > I've registered the model with admin and in admin it shows the error for duplication perfectly fine but from frontend I am getting error below: > > > Integri

IntegrityError column email is not unique

2016-07-02 Thread M Hashmi
duplication perfectly fine but from frontend I am getting error below: *IntegrityError at /checkout/ column email is not unique Request Method: POST Request URL:http://localhost:8000/checkout/ Django Version: 1.8.13 Exception Type: IntegrityError Exception Value: column email is not unique Exception Loca

Re: IntegrityError for unique_together ?

2016-06-23 Thread Derek
ango 1.6.11 and MySQL 5.5). Attempting >> to save a new entry (from the admin) with values that violate the >> duplication restriction imposed by the unique_together constraint - in >> other words a duplicate of a record already in the database - raises an >> IntegrityError (s

Re: IntegrityError for unique_together ?

2016-06-23 Thread Simon Charette
e the > duplication restriction imposed by the unique_together constraint - in > other words a duplicate of a record already in the database - raises an > IntegrityError (stack trace listed at the end). > > The model looks like something like : > > name = CharField( >

IntegrityError for unique_together ?

2016-06-23 Thread Derek
IntegrityError (stack trace listed at the end). The model looks like something like : name = CharField( max_length=100) title = ForeignKey(Title) city = CharField( max_length=50, default=CITY_DEFAULT), occupation = ForeignKey(Occupation) class Meta

Re: DJango 1.8 test case fails with IntegrityError error

2015-09-21 Thread Jose Paul
NTO "AUTH_USER" ("PASSWORD", "LAST_LOGIN", "IS_SUPERUSER", >> "USERNAME", "FIRST_NAME", "LAST_NAME", "EMAIL", "IS_STAFF", "IS_ACTIVE", >> "DATE_JOINED") VALUES (%s, %s, %s, %s

Re: DJango 1.8 test case fails with IntegrityError error

2015-09-21 Thread Simon Charette
"IS_ACTIVE", > "DATE_JOINED") VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s) > > Value : (None, None, True, u'superuser', None, None, None, False, True, > u'2015-09-17 12:31:09.562000') > > ibm_db_dbi::IntegrityError: Statement Exec

Re: DJango 1.8 test case fails with IntegrityError error

2015-09-21 Thread Jose Paul
egg\ibm_db_django\pybase.py", line 161, in execute return super( DB2CursorWrapper, self ).execute( operation, parameters ) File "c:\python27\lib\site-packages\ibm_db-2.0.5.1-py2.7.egg\ibm_db_dbi.py", line 1335, in execute self._execute_helper(parameters) File "c:\pytho

DJango 1.8 test case fails with IntegrityError error

2015-09-21 Thread Jose Paul
"LAST_NAME", "EMAIL", "IS_STAFF", "IS_ACTIVE", "DATE_JOINED") VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s) Value : (None, None, True, u'superuser', None, None, None, False, True, u'2015-09-17 12:31:09.562000') ibm_db_dbi::Integrit

IntegrityError : AUTH_USER DJango 1.8

2015-09-21 Thread Jose Paul
Daer All, I am trying to run DJango 1.8 test cases . I am getting several IntegrityError error on AUTH_USER table . SQL generated by test case INSERT INTO "AUTH_USER" ("PASSWORD", "LAST_LOGIN", "IS_SUPERUSER", "USERNAME", "FI

Solved: save as new in the Admin with 1:1 inlines causes IntegrityError

2014-10-17 Thread Mike Dewhirst
I discovered a unicode problem related to the degree symbol (°) when running under Python 2.7 and dealt with that. It somehow fixed the IntegrityError. One of those things I guess AWTEW Mike On 15/10/2014 9:40 AM, Mike Dewhirst wrote: Using Django 1.6.7, in the Admin if I change the name

save as new in the Admin with 1:1 inlines causes IntegrityError

2014-10-14 Thread Mike Dewhirst
"C:\Users\mike\env\xxdx\lib\site-packages\django\db\models\sql\compiler.py" in execute_sql 903. cursor.execute(sql, params) File "C:\Users\mike\env\xxdx\lib\site-packages\django\db\backends\util.py" in execute 69. return super(CursorDebugWrapper, self).execute(sql,

IntegrityError

2014-03-28 Thread Warren Jacobus
Hi, I've been trying to create a simple flight booking system but seem to have trouble. When trying to create a Flight object it says that aircraft_id may not be null and when trying to set a Passenger object it says flight_id may not be null Here is my models.py file from django.db import m

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
ing django using djangobook <http://djangobook.com>, in chapter > 6, i'm having this error: > > IntegrityError at /admin/books/book/add/ > > NOT NULL constraint failed: books_book.publication_date > > > it seems i should set null=True for publication_date f

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

2014-03-26 Thread Sami Razi
i'm learning django using djangobook <http://djangobook.com>, in chapter 6, i'm having this error: IntegrityError at /admin/books/book/add/ NOT NULL constraint failed: books_book.publication_date it seems i should set null=True for publication_date fie

Re: IntegrityError with proxy model but not with parent?

2013-09-26 Thread Rafael Durán Castañeda
f).__init__(*args, **kwargs) > self.stuff = "test" > > If I use the Parent model and try to enter, 'myname' and 'test' as the > name/stuff entries twice, I get the usual warning on the second attempt; the > admin telling me that this model entry a

IntegrityError with proxy model but not with parent?

2013-09-25 Thread Derek
ry to enter, 'myname' and 'test' as the name/stuff entries twice, I get the usual warning on the second attempt; the admin telling me that this model entry already exists. However, if I try the same thing on the Myproxy model (which has a form without the stuff field; a

Re: handling IntegrityError: Duplicate entry in UserCreationForm

2013-04-29 Thread isachin
y >> >> >> On Wednesday, April 24, 2013 9:27:39 AM UTC-6, sachin wrote: >>> >>> Hello, >>> >>> I m extending my auth user model to add addition entries like phone >>> numbers and emp_id. In the model I m marking both the fields as unique=

Re: handling IntegrityError: Duplicate entry in UserCreationForm

2013-04-27 Thread isachin
as unique=True. >> Form generation is using UserCreationForm. But whenever I try to save >> same phone number or emp_id it throws >> >> *IntegrityError: (1062, "Duplicate entry '447' for key 'phone_num'")* >> >> How to handle this

Re: handling IntegrityError: Duplicate entry in UserCreationForm

2013-04-25 Thread Kelly Nicholes
extending my auth user model to add addition entries like phone > numbers and emp_id. In the model I m marking both the fields as unique=True. > Form generation is using UserCreationForm. But whenever I try to save same > phone number or emp_id it throws > > *IntegrityError: (1062,

Re: handling IntegrityError: Duplicate entry in UserCreationForm

2013-04-25 Thread isachin
cate entries > using a script or even from shell. > > After doing that you can use > * try: * > # your code here > * except IntegrityError: * > #create variables here to send user error message > > One more pointer - try checking for the user input( X.object.f

Re: handling IntegrityError: Duplicate entry in UserCreationForm

2013-04-25 Thread Pradeep Kumar
Hi Sachin, If you have added the unique=True later and migrated the existing table, I would also suggest you to first clean up the NULL and duplicate entries using a script or even from shell. After doing that you can use * try: * # your code here * except IntegrityError: * #create

Re: handling IntegrityError: Duplicate entry in UserCreationForm

2013-04-25 Thread Siddharth Ghumre
h the fields as unique=True. > Form generation is using UserCreationForm. But whenever I try to save same > phone number or emp_id it throws > > *IntegrityError: (1062, "Duplicate entry '447' for key 'phone_num'")* > > How to handle this error and show i

handling IntegrityError: Duplicate entry in UserCreationForm

2013-04-24 Thread sachin
Hello, I m extending my auth user model to add addition entries like phone numbers and emp_id. In the model I m marking both the fields as unique=True. Form generation is using UserCreationForm. But whenever I try to save same phone number or emp_id it throws *IntegrityError: (1062

Re: error- IntegrityError at /register/

2013-03-06 Thread Avnesh Shakya
thanks i got it regards, Avnesh shakya On Thu, Mar 7, 2013 at 10:09 AM, Avnesh Shakya wrote: > hi i have got error- IntegrityError at /register/ > > lrntkr_student.contact_no may not be NULL > > ,when i was trying to input data through html page(register.html), but > data

error- IntegrityError at /register/

2013-03-06 Thread Avnesh Shakya
hi i have got error- IntegrityError at /register/ lrntkr_student.contact_no may not be NULL ,when i was trying to input data through html page(register.html), but data is not updating in database and generating that error. please help me i m unable to find this error. thanks -- You received

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
ql_psycopg2/base.py", > line 242, in _commit > six.reraise(utils.IntegrityError, utils.IntegrityError(*tuple(e.args)), > sys.exc_info()[2]) > > File > "/app/.heroku/python/lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/base.py", > l

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

2013-02-28 Thread Ben Roberts
rgs)), sys.exc_info()[2]) File "/app/.heroku/python/lib/python2.7/site-packages/ django/db/backends/postgresql_psycopg2/base.py", line 240, in _commit return self.connection.commit() File "/app/.heroku/python/lib/python2.7/site-packages/ newrelic-1.10.0.28/newrelic/

Re: IntegrityError when creating a brand new model instance

2013-02-16 Thread Some Developer
;ve just found something rather strange. If I just do a simple: tag = BlogTag(title=form.cleaned___data['title'], description=form.cleaned_data[__'description'], num_articles=0) tag.save() I get an IntegrityError and the model fails t

Re: IntegrityError when creating a brand new model instance

2013-02-11 Thread Bill Freeman
> > tag = BlogTag(title=form.cleaned_**data['title'], > > description=form.cleaned_data[**'description'], > num_articles=0) > > tag.save() > > I get an IntegrityError and the model fails to save. On the other hand if > I do the following: &g

Re: IntegrityError when creating a brand new model instance

2013-02-10 Thread Some Developer
OK, I've just found something rather strange. If I just do a simple: tag = BlogTag(title=form.cleaned_data['title'], description=form.cleaned_data['description'], num_articles=0) tag.save() I get an IntegrityError and the model fails to save. On the other ha

Re: IntegrityError when creating a brand new model instance

2013-02-10 Thread Bill Freeman
ject 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 objects. >> >> When I try and save the object in the form_valid() method I always >>

Re: IntegrityError when creating a brand new model instance

2013-02-09 Thread Some Developer
and a description. I also have a FormView based view class which handles the creation of Tag objects. When I try and save the object in the form_valid() method I always get an IntegrityError stating that the title column is not unique. This is somewhat puzzling as I have deleted the SQLite da

Re: IntegrityError when creating a brand new model instance

2013-02-08 Thread Some Developer
and a description. I also have a FormView based view class which handles the creation of Tag objects. When I try and save the object in the form_valid() method I always get an IntegrityError stating that the title column is not unique. This is somewhat puzzling as I have deleted the SQLite da

Re: IntegrityError when creating a brand new model instance

2013-02-08 Thread Andre Terra
on of Tag objects. > > When I try and save the object in the form_valid() method I always get an > IntegrityError stating that the title column is not unique. This is > somewhat puzzling as I have deleted the SQLite database file and recreated > it using syncdb / migrate so it is c

IntegrityError when creating a brand new model instance

2013-02-07 Thread Some Developer
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 objects. When I try and save the object in the form_valid() method I always get an IntegrityError

Re: IntegrityError

2012-12-18 Thread Satinderpal Singh
profile.save() > form.save() >> HttpResponseRedirect(reverse('Automation.report.views.result')) >> >> But get the following error: >> IntegrityError at /report/header/ >> (1048, "Column 'job_id'

Re: IntegrityError

2012-12-18 Thread Satinderpal Singh
nt__client__address_1}} >> Material : {{job.clientjob__material__name}} >> Report >> {% endfor %} >> >> i want to get job id to be saved through header view: >> def header(request): >> if request.method=='POST': >>

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

Re: IntegrityError

2012-12-17 Thread Sandeep kaur
t; cd = form.cleaned_data profile = form.save(commit=False) profile.job = job profile.save() form.save() > HttpResponseRedirect(reverse('Automation.report.views.result&#x

Re: IntegrityError

2012-12-17 Thread Chris Cogdon
__material__name}} > Report > {% endfor %} > > i want to get job id to be saved through header view: > def header(request): > if request.method=='POST': > form = headForm(request.POST) > if form.is_vali

Re: testing unique_together IntegrityError

2012-11-10 Thread Mike Dewhirst
On 11/11/2012 4:45pm, Mike Dewhirst wrote: Can anyone help with some unit test guidance please? How can I trap an IntegrityError in a test to prove unique_together is working? I'm modelling a company and multiple divisions. A solo division doesn't need a division.name so I'm al

testing unique_together IntegrityError

2012-11-10 Thread Mike Dewhirst
Can anyone help with some unit test guidance please? How can I trap an IntegrityError in a test to prove unique_together is working? I'm modelling a company and multiple divisions. A solo division doesn't need a division.name so I'm allowing it to be blank. It's __unicode

Occasional IntegrityError on m2m fields using PostgreSQL

2012-11-01 Thread Bernardo
Hello guys, I can't detect any pattern, maybe 1 in each 1000 thousands edit of a certain model returns an IntegrityError on a m2m field. Most of the times this field wasn't even modified. When a model is saved I believe django always wipes the m2m field and then readds the items, ri

IntegrityError registration_registrationprofile when deleting user from admin

2012-10-23 Thread pietro conconi
Hi i've included django-registration in my project's apps. I've included in my project's settings AUTH_PROFILE_MODULE = "people.Profile" Trying to delete an User from admin interface, I'm still getting this frustrating error message *IntegrityError at /adm

Re: get_or_create gave IntegrityError: (1062, "Duplicate entry) error sometimes

2012-10-15 Thread Zheng Li
t found >>> Thread B get_or_create looks for entry in DB, not found >>> Thread B creates entry in DB >>> Thread A get_or_create tries to create entry in DB >> >> >> Internally, get_or_create code in thread A will now attempt to GET the >> object create

Re: get_or_create gave IntegrityError: (1062, "Duplicate entry) error sometimes

2012-10-15 Thread Tom Evans
atically reflect the error to > the caller. See: > > https://github.com/django/django/blob/stable/1.4.x/django/db/models/query.py#L430 I regularly - once every few months - see get_or_create raise IntegrityError due to duplicate key on MySQL 5.0/MyISAM/Django 1.3. So whilst that is the intentio

Re: get_or_create gave IntegrityError: (1062, "Duplicate entry) error sometimes

2012-10-15 Thread Karen Tracey
On Mon, Oct 15, 2012 at 9:43 AM, Tom Evans wrote: > On Mon, Oct 15, 2012 at 1:50 PM, Zheng Li wrote: > > get_or_create shouldn't give duplicate entry error > > anyone help. > > > > This is incorrect, and a common misconception: get_or_create() is not > atomic. If this happens, you will get dupli

Re: get_or_create gave IntegrityError: (1062, "Duplicate entry) error sometimes

2012-10-15 Thread Tom Evans
On Mon, Oct 15, 2012 at 1:50 PM, Zheng Li wrote: > get_or_create shouldn't give duplicate entry error > anyone help. > This is incorrect, and a common misconception: get_or_create() is not atomic. If this happens, you will get duplicate key errors: Thread A calls get_or_create(a='a', b='b') Thre

Re: get_or_create gave IntegrityError: (1062, "Duplicate entry) error sometimes

2012-10-15 Thread Reinout van Rees
On 15-10-12 14:50, Zheng Li wrote: get_or_create shouldn't give duplicate entry error Perhaps you have existing data that violates your unique-together constraint? Data that existed before that constraint was in place? Check it directly in your database by searching for that a=a, b=b entry.

Re: get_or_create gave IntegrityError: (1062, "Duplicate entry) error sometimes

2012-10-15 Thread Zheng Li
ss Meta: > unique_together = (('a', 'b'),) > > I have a class like above. > when I call get_or_create, sometimes IntegrityError: (1062, "Duplicate entry) > error happens. > a, _ = AB.objects.get_or_create(a=a, b=b) > > I really have googl

Re: get_or_create gave IntegrityError: (1062, "Duplicate entry) error sometimes

2012-10-12 Thread Wei Wei
) > c = models.IntegerField(default=0) > d = models.FloatField(default=0) > e = models.IntegerField(default=0) > f = models.FloatField(default=0) > class Meta: > unique_together = (('a', 'b'),) > > I have a class like above. > when I call ge

get_or_create gave IntegrityError: (1062, "Duplicate entry) error sometimes

2012-10-12 Thread Zheng Li
7;b'),) I have a class like above. when I call get_or_create, sometimes IntegrityError: (1062, "Duplicate entry) error happens. a, _ = AB.objects.get_or_create(a=a, b=b) I really have googled and worked on it for a while, but still nothing. anyone can help? Thanks in advance. --

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

2012-09-27 Thread akaariai
ws, database > > structure > > > After adding data to database I have error (data is added correctly but > > displays an error): > > > Exception Type: IntegrityError at /add/Exception Value: PRIMARY KEY must be > > unique > > > def add(request): >

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

2012-09-27 Thread Amyth Arora
ucture > > > After adding data to database I have error (data is added correctly but > displays an error): > > > > Exception Type: IntegrityError at /add/Exception Value: PRIMARY KEY must be > unique > > > def add(request): > if request.user.is_authent

IntegrityError at /add/ PRIMARY KEY must be unique

2012-09-27 Thread enemybass
http://wklej.org/id/837631/ - models, traceback, urls, views, database structure After adding data to database I have error (data is added correctly but displays an error): Exception Type: IntegrityError at /add/Exception Value: PRIMARY KEY must be unique def add(request): if

Re: Syncdb Error With Oracle Database - IntegrityError Exception

2012-08-31 Thread Jon Blake
Thanks, Ian, I did miss that. Bookmarked for future reference. On Saturday, September 1, 2012 3:16:38 PM UTC+10, Ian wrote: > > On Fri, Aug 31, 2012 at 10:03 PM, Jon Blake > > wrote: > > Querying column timestamp of view user_objects for tables, sequences and > > triggers appears to confirm my

Re: Syncdb Error With Oracle Database - IntegrityError Exception

2012-08-31 Thread Jon Blake
I've just dropped and re-created my user account with required privileges, and all has gone as expected. Table auth_permission has 18 rows. At the point where I'm prompted to create a superuser account, I made the mistake of resizing my terminal window, which resulted in exception EOFError bein

Re: Syncdb Error With Oracle Database - IntegrityError Exception

2012-08-31 Thread Ian Kelly
On Fri, Aug 31, 2012 at 10:03 PM, Jon Blake wrote: > Querying column timestamp of view user_objects for tables, sequences and > triggers appears to confirm my understanding of what base.py does. I'll drop > and recreate my user account, and try again. I'll advise how this goes. Does > the Django d

Re: Syncdb Error With Oracle Database - IntegrityError Exception

2012-08-31 Thread Jon Blake
Thanks, Ian and Amyth, for your responses. I encountered the CREATE TRIGGER privilege issue early in my trials with Django with the Oracle database back end - Django propagated an Oracle "insufficient privileges" exception. That was quickly sorted by granting the required privilege to my user a

Re: Syncdb Error With Oracle Database - IntegrityError Exception

2012-08-31 Thread Ian
On Friday, August 31, 2012 12:10:54 AM UTC-6, Amyth wrote: > > Hey Jon, > > I guess this is because of a bug in django. Django already has a open > ticket for this bug. Check it out > here > . > > As described in that ticket, the reason for the proble

Re: Syncdb Error With Oracle Database - IntegrityError Exception

2012-08-30 Thread Amyth Arora
Hey Jon, I guess this is because of a bug in django. Django already has a open ticket for this bug. Check it out here . On Fri, Aug 31, 2012 at 7:17 AM, Jon Blake wrote: > Just discovered Django and trying out the Django 1.4 tutorial with an > Oracle

Syncdb Error With Oracle Database - IntegrityError Exception

2012-08-30 Thread Jon Blake
Just discovered Django and trying out the Django 1.4 tutorial with an Oracle backend database. In my database, I have created user django with privs create session, create table, create sequence, create trigger. The DATABASES dictionary in settings has been edited to set the default settings to

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 m

  1   2   3   >