Hi Anvesh,

I didn't understand how you were trying to insert into the tables. Probably
your sql code would have helped us hitting on the nail of the problem but
anyways let me give you general answers:

a) If id field is auto in the database one doesn't need to mention or enter
it explicitly while entering table data in the database. Thats how django
does or any other application does.
b) What is your query are you trying to send blank id to the database and
expecting it would take care of like

INSERT INTO XYZ (id, blah, blah ...) values ('', blah, blah ...) ?

Depending on what you have defined the ID field in the database( it should
be a primary key so obviously not null, blank=False) it won't accept the
above query.

Try inserting all the other fields in the table except id this way

INSERT INTO XYZ (blah, blah ...) values (' blah, blah ...)

ID will be automatically generated to the tables.


c) Try checking for other constraints in the table which you are inserting
into, are the fields NOT NULL, UNIQUE etc etc? Once you meet all the
constraints then only the data can be pushed to the table.


Please try to post the exact error and some code to get better idea for us
to reply.



Thanks,
Pradeep


On Fri, May 10, 2013 at 3:23 PM, Avnesh Shakya <avnesh.n...@gmail.com>wrote:

> Hi,
>      I am inserting data into my models using sqlite3 manually, but it's
> not storing without id, it's generating error,  this Id is generated
> automatically in django. how is it possible that i can store data without
> taking id value. please help me out.....
>
> 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 django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to