ds99 wrote: > Hi Alex, > Thanks a lot or quick reply. A couple of queries below: > > 1) How can this be handled when the tables are created dynamically? > Actually the tables will be created dynamically by some other process > and will be deleted after its purpose is over. So is there any other > way or we need to call python script with inspectdb everytime we get a > new request? > > 2) This is possible for only one database as it would inspect database > pointed by DATABASE_NAME setting and create models. Can this be done > if we have one database per session? > > Thanks again, > ds99 > > On May 26, 8:13 am, Alex Gaynor <alex.gay...@gmail.com> wrote: > >> On Mon, May 25, 2009 at 10:07 PM, ds99 <cozydarsh...@gmail.com> wrote: >> >> >>> Hi, >>> I am new to django.I have a requirement where in have to access tables >>> which are not created using django models, using django APIs. >>> >>> For eg: I already have tables "book_111" and "book_222" created in >>> sqlite db by some different process. Both having same schema.I want to >>> access them to retrieve records using django database APIs. How can i >>> do that? >>> Do i need to add their schema in models.py? Can one model be used to >>> refer to multiple tables in database? >>> >>> Please let me know. >>> >>> Thanks, >>> ds99 >>> >> Yes, you can use those models with django, you'll need to create Model >> classes for them >> though,http://docs.djangoproject.com/en/dev/ref/django-admin/#inspectdbcan >> assist >> with this task. No one model can't be used to refer to multiple tables. >> >> Alex >> >> -- >> "I disapprove of what you say, but I will defend to the death your right to >> say it." --Voltaire >> "The people's good is the highest law."--Cicero >> > > > . > > hi
If there is table in the database you are connected to django will not create a new one.If you are using django1.1 you can manually set whether to create a table or not in the db(manged option in class meta).Is complete table is being drop or only the data is being deleted.what you to do with these tables.Explanation is required. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---