r/Python • u/yanni • Apr 27 '10
Beginners question about good design. Web2py.
I am putting together a site, from scratch, that is a cross between craigslist/yelp/travelocity. Basically there are multiple categories such as tutoring / computer repair / house related / etc.
When I am creating the model (database tables/etc) should I try to create a comprehensive submit form for all categories, or individual submit forms for each category? Some fields in one category have no meaning in another category. For example in tutoring there is an "Instructor-to-Student Ratio" field, and in computer repair there are Operating System type fields "apple, windows, linux etc."
Also some of the categories might have "sub-categories." Tutoring might have physical training, and educational, which in turn might have karate, ninjitsu, and math / science respectively.
What do the tables (in the model/DB) look like for this sort of a site?
2
u/mdipierro Apr 27 '10
I am sorry you get voted down but reddit is nor very web2py friendly.
My two cents without knowing much about your project. I would create a table category, a table sub-category (that reference category) and I would generate the form dynamically (SQLFORM.factory) based on the list of subcategories.