Anthony thanks. Previously i worked with various languages and frameworks 
and my general practice was to use models only for things related to data 
model. Here i am not sure for what models are intended, firstly i used them 
for create_table definitions, but as my code grew i moved this definitions 
to 0.py. Now i use models like Classes that work with data from db.

class EntryClassAttribute():

    @staticmethod
    def get_by_entry_class_id(entry_class_id, grid=True):

        query = (db.entry_class_attribute.entry_class_id == entry_class_id)

        if grid:
            query &= (db.entry_class_attribute.grid == True)

        entry_class_attributes = db(query).select(db.entry_class_attribute.
ALL,
                                                  orderby=db.
entry_class_attribute.field_position)

        return entry_class_attributes

-- 

--- 
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/groups/opt_out.


Reply via email to