> If you're talking about building queries, your point is moot -- the 
> operations happen in the database, not Python.
>

I don't know what you mean by this...
For complex-queries, I would still be using web2py's DAL layer, even if I 
had this ORM on top. I would either use them outside the ORM, or insert 
them into the ORM.

My example was not meant to show that you should do complex queries in 
Python - that would obviously be absurd, and you don't even need a 
relational database for that - any NoSQL one would do fine.

I was giving an example to a case in which I have a simple comparison to 
make, and want to reuse the ORM objects I already have for it.
The DAL is not built for that.
 

> As for comparisons in Python, in web2py, you wouldn't be testing equality 
> of a whole object/record -- typically it would be a scalar (e.g., the 
> integer ID).
>

That would still be much slower than an equality-test - especially for 
large data-sets.
 

> And you wouldn't have multiple copies of records in memory either.
>
>
How so?

If I do this:

row1 = db.Country[1]
...
row2 = db.Country[1]

Would I then get:

row1 is row2 == True

?

How about:

row1.Name is row2.Name == True

?

I would be surprised to find out this is the case...

-- 

--- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to