As I keep saying, I'm a newbie to web2py and python coming from a Java background. Some things that I do as "standard" are not described in examples so I would like some advice, i.e. should I still be doing X and if so how?
My app has a "user" table and in Java I would have a class to hold the data and methods with an associated class to handle persistence. In web2py, the associated class is replaced by the DAL which is great. However, encapsulating "user" related methods in a class still seems "a good thing". Is it? My first instinct is to create a User class with an optional __init__ argument to allow creation from the db so that I can do something like: results=db(db.user.id=id).select() if len(results)==1: user=User(results[0]) else: user=User() The User class contains various methods, etc. To test this, I just put the class code in the controller but I plan to have several controllers all of which could reference User. Should the class be put into a module perhaps with other similar classes (Animal, Vet, etc)? Where is the preferred location for such application related class and/ or module files? Am I missing anything else? Bill --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---

