Or as Leonel, suggests, DAL(..., migrate=False), which simply sets the 
default value of the "migrate" argument to db.define_table to False (rather 
than completely disabling all migrations). In that case, you can simply 
override that default when needed via db.define_table(..., migrate=True).

Anthony

On Tuesday, March 29, 2016 at 5:49:30 PM UTC-4, Anthony wrote:
>
> If all the tables you define in the shell will be pre-existing, use 
> DAL(..., migrate_enabled=False), which will prevent all migrations. If you 
> only need to prevent migrations on a per table basis, then do 
> db.define_table(..., migrate=False).
>
> Anthony
>
> On Tuesday, March 29, 2016 at 5:28:14 PM UTC-4, Aman Bindal wrote:
>>
>> Hi,
>>       I need to access web2py sqlite database from python.
>> So, I wrote a python code like this
>>
>> >> from pydal import DAL, Field
>> >> db = DAL('sqlite://storage.sqlite')
>> >> print db.tables
>> []
>> >> db.define_table(... Already existing table,....)
>> it is showing an error of sqlite3.OperationalError: table Account_Details 
>> already exists
>>
>> Please don't print this e-mail unless you really need to.
>>
>> Disclaimer:
>> "This communication (including any accompanying documents) is intended 
>> only for the use of the addressee(s) and contains PRIVATE AND CONFIDENTIAL 
>> information. Unauthorized reading, dissemination, distribution or copying 
>> of this communication is prohibited. If you have received this 
>> communication in error, please return the email to the sender promptly and 
>> delete the original communication. 
>> Please be informed that any review, dissemination, distribution, or 
>> copying of this message is strictly prohibited, unless stated.The sender 
>> confirms that Creditas Solutions shall not be responsible if this email 
>> message is used for any indecent, unsolicited or illegal purposes, which 
>> are in violation of any existing laws and the same shall solely be the 
>> responsibility of the sender and that Creditas Solutions shall at all times 
>> be indemnified of any civil and/ or criminal liabilities or consequences 
>> thereof. 
>> To the contrary, any opinions or comments are personal to the writer and 
>> do not represent the official view of the company. In case where it 
>> represents our official view, it needs to be re-validated and is subject to 
>> the terms of our engagement. Thank you for your co-operation.”
>>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to