Hi,

I know this is silly question, but I just need confirmation - Python 'sorted' doesn't affect in any way data stored in DB?

Example:

class PPL(db.Model):

    person_pk_id = db.Column(db.Integer, primary_key=True)
    person_type = db.Column(db.Integer)
    person_order_s = db.Column(db.Integer)
    person_order_k = db.Column(db.Integer)

all_ppl = PPL.query.all()

technician = [person for person in all_ppl if person.person_type == 1]

technician_sorted = sorted(technician, key=lambda k: getattr(k, u'person_order_' + extra_par))

Using 'sorted' won't make any changes in the rows which are in table used by PPL?

Thank you very much!

Cheers

--
SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- You received this message because you are subscribed to the Google Groups "sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to