Re: The database backend does not accept 0 as a value for AutoField.

2020-04-29 Thread Mayur Bagul
el returns username as string autofield so >> what shall i put as default their? >> i tried to put None for default value but while migrating it giving same >> error :-- >> >> line 192, in validate_autopk_value >> raise ValueError('The database

Re: The database backend does not accept 0 as a value for AutoField.

2020-04-26 Thread Divash Singh
lue for each specific field > > Sent from Mail for Windows 10 > > From: Mayur Bagul > Sent: Sunday, 26 April 2020 18:39 > To: Django users > Subject: Re: The database backend does not accept 0 as a value for AutoField. > > Hey thanks for your response i did so beca

Re: The database backend does not accept 0 as a value for AutoField.

2020-04-26 Thread Jorge Gimeno
alueError('The database backend does not accept 0 as a ' > ValueError: The database backend does not accept 0 as a value for > AutoField. > > guys help me with this error . > > > On Sunday, April 26, 2020 at 9:10:41 PM UTC+5:30, Antje Kazimiers wrote: >> >> s

Re: The database backend does not accept 0 as a value for AutoField.

2020-04-26 Thread Antje Kazimiers
how about adding null=True and blank=True to the field? On 4/26/20 6:38 PM, Mayur Bagul wrote: > Hey thanks for your response i did so because initially at the time of > migration it was asking for default value and i just putted false in > rush. that filed user from User model returns username as

RE: Re: The database backend does not accept 0 as a value for AutoField.

2020-04-26 Thread Divash Singh
their?i tried to put None for default value but while migrating it giving same error :--   line 192, in validate_autopk_value    raise ValueError('The database backend does not accept 0 as a 'ValueError: The database backend does not accept 0 as a value for AutoField. guys help me with this

RE: Re: The database backend does not accept 0 as a value for AutoField.

2020-04-26 Thread Divash Singh
Also, Please make sure that any foreign key fields are not default nulls Sent from Mail for Windows 10 From: Mayur BagulSent: Sunday, 26 April 2020 18:39To: Django usersSubject: Re: The database backend does not accept 0 as a value for AutoField. Hey thanks for your response i did so because

Re: The database backend does not accept 0 as a value for AutoField.

2020-04-26 Thread Mayur Bagul
while migrating it giving same error :-- line 192, in validate_autopk_value raise ValueError('The database backend does not accept 0 as a ' ValueError: The database backend does not accept 0 as a value for AutoField. guys help me with this error . On Sunday, April 26, 2020 at

RE: The database backend does not accept 0 as a value for AutoField.

2020-04-26 Thread Divash Singh
Think you shouldn’t use false as a default for fields which are not bool Sent from Mail for Windows 10 From: Antje Kazimiers Sent: Sunday, 26 April 2020 17:40 To: django-users@googlegroups.com Subject: Re: The database backend does not accept 0 as a value for AutoField. setting default=False is

Re: The database backend does not accept 0 as a value for AutoField.

2020-04-26 Thread Antje Kazimiers
setting default=False is odd for any field other than a BooleanField. I would take that out for the OneToOneField at least and see how things go. Antje On 4/26/20 4:19 PM, Mayur Bagul wrote: > Hello guys, > > im stucked with this error mentioned in subject. > below link redirect details about que

The database backend does not accept 0 as a value for AutoField.

2020-04-26 Thread Mayur Bagul
Hello guys, im stucked with this error mentioned in subject. below link redirect details about question. https://stackoverflow.com/q/61427882/11351226 let me know how to get rid of this problem. Thanking You. -- You received this message because you are subscribed to the Google Groups "Djan

Re: ValueError: The database backend does not accept 0 as a value for AutoField.

2020-04-06 Thread Simon Charette
>> "/home/lenovo/.local/lib/python3.7/site-packages/django/db/models/sql/compiler.py" >>> , line 1335, in as_sql >>> for obj in self.query.objs >>> File >>> "/home/lenovo/.local/lib/python3.7/site-packages/django/db/models/sql/compiler.

Re: ValueError: The database backend does not accept 0 as a value for AutoField.

2020-04-06 Thread Hamza Mirchi
ery.objs >> File >> "/home/lenovo/.local/lib/python3.7/site-packages/django/db/models/sql/compiler.py" >> , line 1334, in >> [self.prepare_value(field, self.pre_save_val(field, obj)) for field >> in fields] >> File >> "/home/lenovo/.local/lib/python3.7/s

Re: ValueError: The database backend does not accept 0 as a value for AutoField.

2020-04-06 Thread Simon Charette
ields] > File > "/home/lenovo/.local/lib/python3.7/site-packages/django/db/models/sql/compiler.py" > , line 1275, in prepare_value > value = field.get_db_prep_save(value, connection=self.connection) > File > "/home/lenovo/.local/lib/python3.7/site-packages/d