[sqlalchemy] disable notifications in terminal

2019-07-22 Thread Mohsen Pahlevanzadeh
I use sqlalchemy and when I run my program , get the following notifications: // 2019-07-22 20:53:41,207 INFO sqlalchemy.engine.base.Engine SELECT CAST('test plain returns' AS VARCHAR(60)) AS anon_1 2019-07-22

[sqlalchemy] sqlite session

2019-04-09 Thread Mohsen Pahlevanzadeh
I have a code for mysql.(by sqlalchemy), Now I converted my data to sqlite3 for some reasons.Do i have to use session for sqlite? I already write the following class for support mysql : //

[sqlalchemy] a list of int, and check for id

2013-11-19 Thread Mohsen Pahlevanzadeh
I don't know all of function call of sqlalchemy, So i can't use completely, i have a set of integer (id of my table), I should retrieve project_typpe field according to list of my id, What do you suggesst code? my table : (id: int, project_type: text) -- You received this message because you

[sqlalchemy] sqlite and two serious question

2013-10-17 Thread Mohsen Pahlevanzadeh
Dear all, I migrated from mysql to sqlite for a tablet project, i made my tables and work fine with mysql, but dont' work with sqlite, My question are: 1. hwo can i input utf8 in sqlite? 2. how can input date data type in sqlite? -- You received this message because you are subscribed to

[sqlalchemy] how to count function

2013-09-12 Thread Mohsen Pahlevanzadeh
Dear all, I have the following code: // query = self.dbObj.session.query(MaterialsTable) rowCounter = self.dbObj.session.query(MaterialsTable) for attr , val in

[sqlalchemy] dynamic query with many parametters

2013-09-07 Thread Mohsen Pahlevanzadeh
Suppose i need to send a set of table field and a value to search, i found the following code: /// q = session.query(myClass)for attr, value in web_dict.items(): q = q.filter(getattr(myClass, attr).like(%%%s%% % value)) ///

[sqlalchemy] Re: an unkown object in code.

2013-09-03 Thread Mohsen Pahlevanzadeh
Thank you for your information. On Sunday, September 1, 2013 10:04:48 PM UTC+4:30, herzaso wrote: the c object is short for columns (you can use either) check out http://docs.sqlalchemy.org/en/rel_0_7/core/schema.html On Sunday, September 1, 2013 8:27:12 PM UTC+3, Mohsen Pahlevanzadeh

Re: [sqlalchemy] an unkown object in code.

2013-09-03 Thread Mohsen Pahlevanzadeh
Thank you for your information. On Monday, September 2, 2013 2:33:21 AM UTC+4:30, Simon King wrote: On 1 Sep 2013, at 18:27, Mohsen Pahlevanzadeh m.pahle...@gmail.comjavascript: wrote: Dear all, Before apply code or writing code from a documentation, At first i test

[sqlalchemy] DateTime vs timestamp

2013-09-03 Thread Mohsen Pahlevanzadeh
Dear all, I'm using mysql, and define my field as timestamp data type. Then i defined DateTime in my class table and Table() constructor same field. Is it true? Does it save epoch ? -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To unsubscribe

[sqlalchemy] Re: Optimization my table (unicode disccussion)

2013-09-02 Thread Mohsen Pahlevanzadeh
this is more optimal for you or not depends on your use case... On Monday, September 2, 2013 9:22:36 AM UTC+10, Mohsen Pahlevanzadeh wrote: Dear all, I have the following Table: sellers = Table('sellers', MetaData(), Column('id', Integer, primary_key=True

[sqlalchemy] Re: how to combine conditions

2013-09-01 Thread Mohsen Pahlevanzadeh
Oh, Thank you. On Saturday, August 31, 2013 3:19:34 PM UTC+4:30, gbr wrote: If I understand you correctly, this should help: http://docs.sqlalchemy.org/en/rel_0_8/core/tutorial.html#conjunctions On Saturday, August 31, 2013 8:42:47 PM UTC+10, Mohsen Pahlevanzadeh wrote: Dear all, I

[sqlalchemy] an unkown object in code.

2013-09-01 Thread Mohsen Pahlevanzadeh
Dear all, Before apply code or writing code from a documentation, At first i test it into test.py, Now ,I read the following doc: conjuctions in sqlalchemyhttp://docs.sqlalchemy.org/en/rel_0_8/core/tutorial.html#conjunctions I supposed users a class such as tables class:

[sqlalchemy] sqlalchemy.exc.ArgumentError: Valid strategies for session synchronization are 'evaluate', 'fetch', False

2013-09-01 Thread Mohsen Pahlevanzadeh
Dear all, i get the following traceback for session.query().filter(sellers.c.name == 'golrang').delete('sellers') line: /// Traceback (most recent call last): File /home/mohsen/codes/amlak/amlak/src/test.py, line 106, in module

[sqlalchemy] Re: sqlalchemy.exc.ArgumentError: Valid strategies for session synchronization are 'evaluate', 'fetch', False

2013-09-01 Thread Mohsen Pahlevanzadeh
i solved it with : /// session.query(Sellers).filter(or_(sellers.c.name == 'golrang')).delete('sellers') /// On Monday, September 2, 2013 2:00:49 AM UTC+4:30, Mohsen Pahlevanzadeh wrote: Dear all, i get the following traceback

[sqlalchemy] Re: sqlalchemy.exc.ArgumentError: Valid strategies for session synchronization are 'evaluate', 'fetch', False

2013-09-01 Thread Mohsen Pahlevanzadeh
I solved it vie: // session.query(Sellers).filter(or_(sellers.c.name == 'golrang')).delete() On Monday, September 2, 2013 2:00:49 AM UTC+4:30, Mohsen Pahlevanzadeh wrote: Dear all, i get the following traceback for session.query().filter

[sqlalchemy] Optimization my table (unicode disccussion)

2013-09-01 Thread Mohsen Pahlevanzadeh
Dear all, I have the following Table: sellers = Table('sellers', MetaData(), Column('id', Integer, primary_key=True, autoincrement = True), Column('name', String, nullable=False), Column('name_type', String, nullable=False), Column('addresses', String,

[sqlalchemy] how to combine conditions

2013-08-31 Thread Mohsen Pahlevanzadeh
Dear all, I need to combine conditions, (variable number) , But i do just add (Insert query) in sqlalchemy,Does sqlalchemy have same featuers? Please explain with code. Yours, Mohsen -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To

[sqlalchemy] Re: sqlalchemy.exc.InvalidRequestError: Instance 'MYCALSSTABLENAME at 0x994a90c' is not persisted

2013-08-27 Thread Mohsen Pahlevanzadeh
:30, Mohsen Pahlevanzadeh wrote: Dear all, i have the following delete record function: def deleteRecord(self,tableObj): self.session.delete(tableObj); self.session.commit(); When i call the abobe function, before commit(), i get the following traceback: Traceback

[sqlalchemy] Session() and UnboundLocalError: local variable 'Session' referenced before assignment

2013-08-25 Thread Mohsen Pahlevanzadeh
Dear all, When i using Session = Session(); i get the following error: UnboundLocalError: local variable 'Session' referenced before assignment *Wher's my problem?* -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To unsubscribe from this group

[sqlalchemy] Base word in Table class

2013-08-24 Thread Mohsen Pahlevanzadeh
According to sqlalchey's documentations, we should create class correspond to table name, such as class MyTable(Base), But i got the following error: // class MaterialsTable(Base): NameError: name 'Base' is not defined / my imports: / from sqlalchemy

[sqlalchemy] Re: Base word in Table class

2013-08-24 Thread Mohsen Pahlevanzadeh
On Saturday, August 24, 2013 11:34:34 AM UTC+4:30, Mohsen Pahlevanzadeh wrote: According to sqlalchey's documentations, we should create class correspond to table name, such as class MyTable(Base), But i got the following error: // class MaterialsTable(Base): NameError: name

[sqlalchemy] Re: Base word in Table class

2013-08-24 Thread Mohsen Pahlevanzadeh
I solved my problem with the following code before definition class: / Base = declarative_base() /// On Saturday, August 24, 2013 11:34:34 AM UTC+4:30, Mohsen Pahlevanzadeh wrote: According to sqlalchey's documentations, we should create class correspond to table name