Thanks guys,
I think Ill go with .import filename tablename
I have the table
sqlite> .schema promo_new
CREATE TABLE "promo_new" (
"id" integer NOT NULL PRIMARY KEY,
"title" varchar(200) NOT NULL,
"news_content" varchar(200) NOT NULL,
"pub_date" datetime NOT NULL
);
for news model suppose I want title = 'Some title' , content = 'some
content' and pub_date= '2009-06-22 12:33:30' till id 2000 (2000 rows)
How would I do that with import statement?
On Wed, Jun 24, 2009 at 11:45 AM, Carl Zmola <[email protected]> wrote:
>
> in sqlite3 (the sqlite3 shell), you can use .import to import data from
> a text file. It works great. You may need to change the separator.
> For a one time load, this is probably the easiest method.
>
> Dhruv Adhia wrote:
> > Hey,
> >
> > I would prefer second method as I am using sqlite3.
> >
> > Is this what you mean?
> > django-admin.py loaddata mydata.json , If so I how do I populate json
> file
> > such large amounts of data?
> >
> > Thanks,
> >
> > On Wed, Jun 24, 2009 at 10:48 AM, creecode <[email protected]> wrote:
> >
> >> Hello Dhruv,
> >>
> >> Two ways you can do this, that I know. Use your databases' built in
> >> data import technique. For example with MySql you can use LOAD DATA.
> >> Alternately you could use manage.py shell to run python code to load
> >> your data.
> >>
> >> Read about manage.py shell and dbshell here <
> >> http://docs.djangoproject.com/en/dev/ref/django-admin/ >.
> >>
> >> Toodle-looooooo...........
> >> creecode
> >>
> >> On Jun 24, 10:23 am, Dhruv Adhia <[email protected]> wrote:
> >>
> >>> I have news field in django admin and I would like to enter 2000 news
> >>> items at once. May I know how to do it in shorter way?
> >>>
> >
> >
>
> --
> Carl Zmola
> [email protected]
>
>
> >
>
--
Dhruv Adhia
http://thirdimension.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---