We dont need to give primary key it automatically define the key.

rahul

On Thu, Aug 23, 2018, 11:20 PM Vishak Raj <[email protected]> wrote:

> Hello
>
> Thanks for replying..
>
> I have a confusion
>
> In normal python shell, we import sqlite3 and insert values without giving
> the  Id or primary key..
>
> Why we giving primary key in django..
> Is it possible to insert values without primary key like we give in python
> shell..
>
> Thanks in advance
>
> On Thursday, August 23, 2018, 'Vinod Kumar' via Django users <
> [email protected]> wrote:
>
>> By default model have id column , so you have to put value of id.
>>
>> On Thu, Aug 23, 2018, 5:00 PM Vishak Raj <[email protected]> wrote:
>>
>>> hello,
>>>
>>> i am inserting the values in the table using custome sql in django
>>> shell..
>>>
>>> p.execute('INSERT INTO webapp_information 
>>> VALUES(%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s)',i)
>>>
>>> i is the list of values
>>>
>>> it shows the error:OperationalError: table webapp_information has 32 
>>> columns but 31 values were supplied
>>>
>>> I created the only 31 columns in models.py
>>>
>>>
>>> What to do.. thanks
>>>
>>> --
>>> 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 [email protected].
>>> To post to this group, send email to [email protected].
>>> Visit this group at https://groups.google.com/group/django-users.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/10ad145e-5e0b-4d52-a8c9-54af6fa69fba%40googlegroups.com
>>> <https://groups.google.com/d/msgid/django-users/10ad145e-5e0b-4d52-a8c9-54af6fa69fba%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> ************************************************************************
>>
>> *This e-mail and all attachments are intended solely for use by the
>> intended recipient and may contain confidential / proprietary information
>> of KiwiTech, LLC, subject to important disclaimers and conditions including
>> restrictions on the use, disclosure, transfer or export of such
>> information.* *If you have received this message in error or are not the
>> named recipient(s), please immediately notify the sender at the telephone
>> number stated above or by reply e-mail and delete this e-mail from your
>> computer*
>>
>> --
>> 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 [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAJOHC1xufhygtCtBOjxZhUf26oonYYLxaZeqv05QRJS%3DK%2BPOJQ%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAJOHC1xufhygtCtBOjxZhUf26oonYYLxaZeqv05QRJS%3DK%2BPOJQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> --
> vishakraj
>
> --
> 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 [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAFL71Cz5ZrAwDc2EgrXfX-QOLt-nL4tcM3fyMHGGRZQEjyrJJw%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAFL71Cz5ZrAwDc2EgrXfX-QOLt-nL4tcM3fyMHGGRZQEjyrJJw%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2B8bEuRd7uqkw2dHt3_3J7QqJvXFD4_Kt4bAVXS2ynQtf9B9_w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to