hi,
what mean the param cr in some or all orm osv functions
thanks in advance
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
Hello Zouhair,
Cr means a "cursor" which is the concept of SQL. The role of cursor(cr in Odoo) is to enumerate/iterate over each rows in result set one by one.
Hence cursor act like a looping statement to fetch data row by row basis
Enough of theory now , lets take an simple example of sql:
import psycopg2
conn = psycopg2.connect(database="mydb", user="postgres", password="postgres", host="127.0.0.1", port="5432")
cur = conn.cursor() #cursor object is created
cur.execute('''select name,date_order from sale.order''')
rows = cur.fetchall()
cur.close()
Hi, the cr parameters is a cursor to the database,
you can see the class here : https://github.com/odoo/odoo/blob/master/openerp/sql_db.py#L75.
As the class description says it's a wrapper around a psycopg cursor.
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up| Related Posts | Replies | Views | Activity | |
|---|---|---|---|---|
|
0
सित॰ 19
|
98 | |||
|
1
जुल॰ 17
|
5193 | |||
|
4
अग॰ 16
|
9630 | |||
|
1
मई 16
|
5978 | |||
|
1
मार्च 16
|
6068 |
1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.